sentence
stringlengths
3
347
sql
stringlengths
18
804
List the names of all winners who played in both 2013 and 2016.
SELECT winner_name FROM matches WHERE YEAR = 2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR = 2016
What's the title of the episode that Rob Heyland wrote?
SELECT title FROM table_14330096_3 WHERE writer = "Rob Heyland"
How many gold medals were given to the winners in the Ice Hockey Men's Ice Hockey event?
SELECT COUNT(T2.competitor_id) FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id WHERE T1.event_name LIKE 'Ice Hockey Men%s Ice Hockey' AND T2.medal_id = 1
List the 3 highest salaries of the players in 2001?
SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3;
Find the id and name of the most expensive base price room.
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;
When was the most recent appointment? | do you want the most recent start or end of appointment | Start
select appointmentid from appointment order by start desc limit 1
What are the name and level of catalog structure with level number between 5 and 10
SELECT catalog_level_name , catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
What are the favorite project types of each of the top 10 donors?
SELECT project_resource_type FROM ( SELECT T1.donor_acctid, T3.project_resource_type FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid ORDER BY T1.donation_total DESC LIMIT 10 ) GROUP BY project_resource_type ORDER BY COUNT(project_resource_type) DESC LIMIT 1
Name the sum of swimsuit when the evening gown is less than 6.983 and the average is less than 7.362
SELECT SUM(swimsuit) FROM table_name_67 WHERE average < 7.362 AND evening_gown < 6.983
What was the Score when the Losing Semifinalists were Toluca Unam?
SELECT score FROM table_name_88 WHERE losing_semifinalists = "toluca unam"
Among all the orders, which products sold for the most amount?
SELECT ProductID FROM `Order Details` GROUP BY ProductID ORDER BY SUM(Quantity) DESC LIMIT 1
What's the title of the episode seen by 12.85 millions of people in the US?
SELECT title FROM table_28212888_2 WHERE us_viewers__millions_ = "12.85"
What date was the 200m breaststroke event?
SELECT date FROM table_name_53 WHERE event = "200m breaststroke"
I want the constructor for brakes and grid less than 14
SELECT constructor FROM table_name_39 WHERE time_retired = "brakes" AND grid < 14
What Opponent in the final had a match with a Score in the final of 7–5, 6–2?
SELECT opponent_in_the_final FROM table_name_31 WHERE score_in_the_final = "7–5, 6–2"
Yes please
SELECT T1.course_name , COUNT ( * ) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name
What team had a race time of 2:53:57?
SELECT team FROM table_2268216_1 WHERE race_time = "2:53:57"
How many different last names do the actors and actresses have?
SELECT count(DISTINCT last_name) FROM actor
What tie number featured Chelsea as the home team?
SELECT MIN(tie_no) FROM table_17736890_5 WHERE home_team = "Chelsea"
List the title of films that do not have any market estimation.
SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)
Name the round of 32 in conference usa
SELECT round_of_32 FROM table_10722506_6 WHERE conference = "conference USA"
What date did the episode originally air on with salvatore giunta as a guest?
SELECT original_airdate FROM table_25691838_11 WHERE guest = "Salvatore Giunta"
What are the customer phone numbers under the policy "Life Insurance"?
SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance"
Find the number of trains for each station, as well as the station network name and services.
SELECT count(*) , t1.network_name , t1.services FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id;
What are the number of different course codes?
SELECT count(DISTINCT crs_code) FROM CLASS
Show the member names which are in both the party with id 3 and the party with id 1.
SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1
Which regular season was 2013 in?
SELECT regular_season FROM table_name_50 WHERE year = 2013
What are the city addresses of the customers located in the United States of America?
SELECT DISTINCT T2.city FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T1.country_name = 'United States of America'
What is the title of project that have the most expensive funds?
SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.projectid = ( SELECT projectid FROM resources ORDER BY item_unit_price * item_quantity DESC LIMIT 1 )
Show the ids for projects with at least 2 documents.
SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2
What are the average and maximum number of tickets bought in all visits?
SELECT AVG(num_of_ticket), MAX(num_of_ticket) FROM visit
Which place has horton smith as the player?
SELECT place FROM table_name_10 WHERE player = "horton smith"
Show the name of the company with company_id 1.0?
SELECT Name from company where Company_ID = 1.0
What is the total number of games played?
SELECT sum(gamesplayed) FROM Sportsinfo
Give the names of poker players who have earnings above 300000.
SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000
What are the names of all photos taken by Olympus brand cameras?
SELECT T2.name FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id where T1.brand = "Olympus"
Name the team anthem that was written by quentin eyers and les kaczmarek.
SELECT name_of_team_song FROM table_28243323_1 WHERE writer_composer = "Quentin Eyers and Les Kaczmarek"
list out the station names
SELECT DISTINCT name FROM station
When 123 is the number in series who is the director?
SELECT directed_by FROM table_2468961_7 WHERE no_in_series = 123
What are the name and typical buying and selling prices of the products that have color described as "yellow"?
SELECT t1.product_name , t1.typical_buying_price , t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "yellow"
What are the life spans of representatives from New York state or Indiana state?
SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana"
What was the title of the episode viewed by 5.03 million viewers?
SELECT title FROM table_27987623_1 WHERE us_viewers__in_million_ = "5.03"
How many movie reviews does each director get?
SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
What is the IHSAA class when the county was 83 vermillion?
SELECT ihsaa_class FROM table_name_40 WHERE county = "83 vermillion"
What is the amount of viewers if the series number is 14?
SELECT viewers__in_millions_ FROM table_24639086_3 WHERE series__number = 14
What is the total amount of tax charged for the order placed by customer 88931 on 7/13/994?
SELECT SUM(T2.l_extendedprice * (1 - T2.l_discount) * (1 + T2.l_tax)) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_custkey = 88931 AND T1.o_orderdate = '1994-07-13'
What's the team #2 in the round where team #1 is Iraklis?
SELECT team__number2 FROM table_19130829_4 WHERE team__number1 = "Iraklis"
Which member has Cook as the electorate?
SELECT member FROM table_name_16 WHERE electorate = "cook"
List all department names ordered by their starting date.
SELECT dname FROM department ORDER BY mgr_start_date
What is the average avg/game of the player with 97 goals and a rank above 7?
SELECT AVG(avg_game) FROM table_name_51 WHERE goals = 97 AND rank < 7
What country in Kunlong in?
SELECT country FROM table_name_46 WHERE location = "kunlong"
What is the investor that has invested in the most number of entrepreneurs?
SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
How many districts have John C. Calhoun as the incumbent?
SELECT COUNT(district) FROM table_2668352_16 WHERE incumbent = "John C. Calhoun"
What are the different names of the colleges involved in the tryout in alphabetical order?
SELECT DISTINCT cName FROM tryout ORDER BY cName
can you show me campuses county?
SELECT County FROM Campuses
Name the least ai %
SELECT MIN(ai___percentage_) FROM table_18012738_1
Who is the team at vikings stadium?
SELECT team FROM table_name_64 WHERE stadium = "vikings stadium"
What was the result of the election of the incumbent harry r. sheppard?
SELECT result FROM table_1341973_6 WHERE incumbent = "Harry R. Sheppard"
What is the production company of the movie "Crazy Heart"?
SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Crazy Heart'
How many resources with a unit price less than 15 are not technology type? List them by vendor id
SELECT vendorid FROM resources WHERE project_resource_type = 'Technology' AND item_unit_price <= 15
How many stages were won by Robbie McEwen?
SELECT COUNT(stage) FROM table_17672470_19 WHERE winner = "Robbie McEwen"
When Sagittarius is the wester name what is the sanskrit gloss?
SELECT sanskrit AS gloss FROM table_186462_1 WHERE western_name = "Sagittarius"
What's the clock speed of the model that costs $910?
SELECT clock_speed FROM table_12740151_8 WHERE price___usd__ = "$910"
What is the Annual Generation at Kawerau (Bope)?
SELECT annual_generation__average_gwh_ FROM table_name_83 WHERE name = "kawerau (bope)"
What were his winnings when he had 14 top 10s?
SELECT winnings FROM table_2169966_2 WHERE top_10 = 14
What opera has 19.87% as the firefox?
SELECT opera FROM table_name_48 WHERE firefox = "19.87%"
Which position has a lower minimum salary, Account Representative or Trainee?
SELECT positiontitle FROM position WHERE positiontitle = 'Account Representative' OR positiontitle = 'Trainee' ORDER BY minsalary ASC LIMIT 1
Give the order ids for all orders, as well as the total product quantity in each.
SELECT order_id , sum(product_quantity) FROM Order_items GROUP BY order_id
What year had the supernova award?
SELECT year FROM table_name_46 WHERE category = "supernova award"
How many times has the student Linda Smith visited Subway?
SELECT count(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway";
How many prefectures have an area of 361.719 kilometers squared?
SELECT COUNT(prefecture) FROM table_221398_1 WHERE area__km²_ = "361.719"
Which venue has a Result of 1–0?
SELECT venue FROM table_name_96 WHERE result = "1–0"
What are the issue dates of volumes associated with the artist "Gorgoroth"?
SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = "Gorgoroth"
What is the lowest pick of a player for the SS, P Position for the Minnesota Twins?
SELECT MIN(pick) FROM table_name_51 WHERE position = "ss, p" AND team = "minnesota twins"
Which grid is the highest and has a time/retired of +0.3?
SELECT MAX(grid) FROM table_name_11 WHERE time_retired = "+0.3"
What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?
SELECT name , operating_system FROM web_client_accelerator WHERE CONNECTION != 'Broadband'
what's the won with tries for being 84
SELECT won FROM table_14058433_5 WHERE tries_for = "84"
Great! Of those 8 customers, how many also have the status of "Shipped"?
select count ( * ) from ( SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped" )
Name the episode that aired october 8, 1988
SELECT episode_title FROM table_name_81 WHERE original_airdate = "october 8, 1988"
What is the total round with pick of 109?
SELECT SUM(round) FROM table_name_37 WHERE pick = 109
Which product's detail contains the word "Latte" or "Americano"? Return the full detail.
SELECT product_details FROM products WHERE product_details LIKE "%Latte%" OR product_details LIKE "%Americano%"
What is the Outcome when All England Open is the Opponent in the final?
SELECT outcome FROM table_name_67 WHERE opponent_in_the_final = "all england open"
What is the scheduled local departure time and the actual departure time of the flight from Philadelphia to Harrisburg with the plane's tail number N627AE on the 13th of August 2018?
SELECT CRS_DEP_TIME, DEP_TIME FROM Airlines WHERE ORIGIN = 'PHL' AND DEST = 'MDT' AND TAIL_NUM = 'N627AE' AND FL_DATE = '2018/8/13'
What is the number of 2011 populations having a 2002 population of 29449?
SELECT COUNT(population__2011_) FROM table_2562572_2 WHERE population__2002_ = 29449
What date did the Steelers play against the New York Jets?
SELECT date FROM table_name_39 WHERE opponent = "new york jets"
What team was the away team for the venue punt road oval?
SELECT away_team FROM table_name_4 WHERE venue = "punt road oval"
What lowest round has orlando pace as the player?
SELECT MIN(round) FROM table_name_3 WHERE player = "orlando pace"
Find the names of the customers who have an deputy policy.
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy"
List the full amount of week 36 results when week 32 is 13.2%.
SELECT COUNT(week_36) FROM table_23680576_3 WHERE week_32 = "13.2%"
In 2009, who among the married patients had undergone a care plan for more than 60 days?
SELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.marital = 'M' AND strftime('%J', T2.STOP) - strftime('%J', T2.START) > 60
How much money did Lucas Mancini spend?
SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini";
What is the Format of the release in Greece?
SELECT format FROM table_name_16 WHERE region = "greece"
List out all award titles nominated for episode 20.
SELECT T2.award FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 20 AND T2.result IN ('Winner', 'Nominee')
What was the result of the election with incumbent bob barr?
SELECT result FROM table_27487712_1 WHERE incumbent = "Bob Barr"
Show names of musicals and the number of actors who have appeared in the musicals.
SELECT T2.Name , COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID
Which Opposition has a Year smaller than 1911, and a Venue of old trafford?
SELECT opposition FROM table_name_51 WHERE year < 1911 AND venue = "old trafford"
Find the number of games taken place in city Atlanta in 2000.
SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta';
State the total number of projects of the list?
SELECT count ( * ) FROM projects
What rank does Mark Giuliano have?
SELECT Rank from faculty where Lname = 'Giuliano' and fname = 'Mark'
Which poll resource provided the most number of candidate information?
SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1