sentence
stringlengths
3
347
sql
stringlengths
18
804
Provide the shipping dates and products of the orders by Gene Hale.
SELECT DISTINCT T2.`Ship Date`, T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Gene Hale'
How many players born in USA are right-handed batters? That is, have the batter value 'R'.
SELECT count(*) FROM player WHERE birth_country = 'USA' AND bats = 'R';
What is the score of the friendly match competition on 24 July 2008?
SELECT score FROM table_name_3 WHERE competition = "friendly match" AND date = "24 july 2008"
What is the team in 1989?
SELECT team FROM table_name_50 WHERE year = "1989"
How many people watch at Western Oval venue?
SELECT COUNT(crowd) FROM table_name_4 WHERE venue = "western oval"
Which position has a School of green valley high school?
SELECT position FROM table_name_26 WHERE school = "green valley high school"
What are the ids of the students who registered course statistics by order of registration date?
SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date
Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.
SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC
How many points does the team with 3 losses have?
SELECT points FROM table_name_52 WHERE lost = "3"
Among the male users, how many users use device model of Desire 820?
SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Desire 820' AND T1.gender = 'M'
What was the prize won by Sebastian Ruthenberg?
SELECT prize FROM table_name_88 WHERE name = "sebastian ruthenberg"
What is the median income of Maule?
SELECT MIN(median_income___intl) AS $__ FROM table_25042332_16 WHERE region = "Maule"
What is the province amount if the % 2011 is 0.0%
SELECT COUNT(province) FROM table_1939367_1 WHERE _percentage_2011 = "0.0%"
What is the average number of complaints on credit cards filed by clients from New York in the 3 consecutive years starting from 2015?
SELECT CAST(COUNT(T2.`Complaint ID`) AS REAL) / 3 AS average FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2015' AND '2017' AND T1.city = 'New York City' AND T2.Product = 'Credit card'
What team was the home team when Tottenham Hotspur is the away team?
SELECT home_team FROM table_name_86 WHERE away_team = "tottenham hotspur"
How many items were sold by store 9 during a snowy day?
SELECT COUNT(DISTINCT item_nbr) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr INNER JOIN sales_in_weather AS T3 ON T2.store_nbr = T3.store_nbr WHERE T3.store_nbr = 9 AND T1.snowfall <> 0 AND T1.snowfall IS NOT NULL
What is the total number of Asian patients who are allergic to peanuts?
SELECT COUNT(T2.patient) FROM allergies AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Allergy to peanuts' AND T2.race = 'asian'
What is the name and country of origin of the artist who released a song that has "love" in its title?
SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%"
What country is Richard Vanquelef from?
SELECT nationality² FROM table_24565004_22 WHERE name = "Richard Vanquelef"
Name the main character of Disney's most popular adventure movie based on its inflation-adjusted gross.
SELECT T2.hero FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Adventure' ORDER BY CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
What are the response received dates for the documents described as 'Regular'?
SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular'
What is the minimum number of wins?
SELECT MIN(wins) FROM table_15431122_2
What is th IATA for Norway with an ICAO of ENTO?
SELECT iata FROM table_name_99 WHERE country = "norway" AND icao = "ento"
What are the first names of staff who did not give any lesson?
SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id
Which loss happened april 18?
SELECT loss FROM table_name_87 WHERE date = "april 18"
When was the result 3-1?
SELECT date FROM table_name_22 WHERE result = "3-1"
Wh owas the captian of the north east stars?
SELECT captain FROM table_25794138_1 WHERE team = "North East Stars"
Which player has the lowest HS score?
SELECT pName FROM Player ORDER BY HS ASC LIMIT 1
What is the contact URL of Claire McCaskill?
SELECT T2.contact_form FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Claire McCaskill' GROUP BY T2.contact_form
Name the surface when the partner is carlos berlocq
SELECT surface FROM table_name_13 WHERE partner = "carlos berlocq"
Give all the bounding boxes for image 2222 whose object classes are feathers.
SELECT T2.X, T2.Y, T2.H, T2.W FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2222 AND T1.OBJ_CLASS = 'feathers'
How many of the actors are named "Dan"?
SELECT COUNT(actor_id) FROM actor WHERE first_name = 'Dan'
Which school is the player who is headed to Duke from?
SELECT school FROM table_name_68 WHERE college = "duke"
How many restaurants are on Irving Street?
SELECT COUNT(id_restaurant) FROM location WHERE street_name = 'irving'
What's the name of that movie?
SELECT title FROM Movie WHERE YEAR = ( SELECT max ( YEAR ) FROM Movie )
What are the names of the departments they teach classes for?
SELECT DISTINCT T4.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code
What was the final score at texas stadium on September 17?
SELECT final_score FROM table_name_43 WHERE stadium = "texas stadium" AND date = "september 17"
On what date is St Kilda the away team?
SELECT date FROM table_name_31 WHERE away_team = "st kilda"
Among the books published by publisher ID 1929, how many of them have over 500 pages?
SELECT COUNT(*) FROM book WHERE publisher_id = 1929 AND num_pages > 500
What are the different locations of the school with the code BUS?
SELECT count(DISTINCT dept_address) FROM department WHERE school_code = 'BUS'
In what region was Degeneration released in digital format on 19 July 2008?
SELECT region FROM table_name_41 WHERE format = "digital" AND date = "19 july 2008"
Hello! Can you please list all of the product names that have the color description of "white"?
SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "white"
When was tony parker (guard) born?
SELECT MAX(year_born) FROM table_name_31 WHERE position = "guard" AND player = "tony parker"
What is the industry of the company named General Electric?
SELECT Industry FROM Companies WHERE name = "General Electric"
What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> "Rachel Elnaugh"
What is the party of the representative first elected in 1894 from the Ohio 16 district?
SELECT party FROM table_name_22 WHERE first_elected = 1894 AND district = "ohio 16"
Who's ranked less than 2?
SELECT player FROM table_name_32 WHERE rank < 2
Who was the prep nurse of that appointment?
SELECT PrepNurse FROM appointment ORDER BY START DESC LIMIT 1
What are the names of the events they reported?
SELECT T3.Name , T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID
Can you show me all the id of the department store that has both marketing and managing department?
SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = "marketing" INTERSECT SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = "managing"
Give the number of claims did Ms. Abbie Cole have in the year of 2011.
SELECT COUNT(T2.BILLABLEPERIOD) FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Abbie' AND T1.last = 'Cole' AND T2.BILLABLEPERIOD BETWEEN '2010-12-31' AND '2012-01-01'
Did legendsID "P194502" personally attend his Hall of Fame dedication?
SELECT IIF(T1.note = 'posthumous', 'YES', 'NO') FROM AwardsMisc AS T1 RIGHT JOIN Master AS T2 ON T1.ID = T2.playerID WHERE T2.legendsID = 'P194502'
List all the public institutes from the state with the least number of graduate cohort in 2013.
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2013 AND T1.control = 'Public' ORDER BY T2.grad_cohort LIMIT 1
What is the home for league 3rd liga, and an away of 4-0?
SELECT home FROM table_name_11 WHERE league = "3rd liga" AND away = "4-0"
What nation had a moving from of espanyol?
SELECT nat FROM table_name_97 WHERE moving_from = "espanyol"
What was the attendance of the Cup Quarterfinals game?
SELECT attendance FROM table_name_21 WHERE game_site = "cup quarterfinals"
WHAT ARE THE HIGHEST POINTS WITH GOALS LARGER THAN 48, WINS LESS THAN 19, GOALS AGAINST SMALLER THAN 44, DRAWS LARGER THAN 5?
SELECT MAX(points) FROM table_name_1 WHERE goals_for > 48 AND wins < 19 AND goals_against < 44 AND draws > 5
Name the time for georgia
SELECT time FROM table_26842217_10 WHERE visiting_team = "Georgia"
What was the attendance on 10 november 2004?
SELECT AVG(attendance) FROM table_name_31 WHERE date = "10 november 2004"
What is the sum of points for teams with more than 10 matches, more than 0 draws, and 7 losses?
SELECT SUM(points) FROM table_name_86 WHERE draw > 0 AND lost = 7 AND match > 10
What are all the distinct participant ids who attended any events?
SELECT count(DISTINCT participant_id) FROM participants_in_Events
What was the To par for United States golfer fred couples?
SELECT to_par FROM table_name_17 WHERE country = "united states" AND player = "fred couples"
Please provide the id of the respository that received the most forks among the respositories that receive 21 stars.
SELECT Id FROM Repo WHERE Stars = 21 AND Forks = ( SELECT MAX(Forks) FROM Repo WHERE Stars = 21 )
How many distinct governors are there?
SELECT count(DISTINCT Governor) FROM party
What are the states of the colleges where students who tried out for the striker position attend?
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'
What's the total number of floors built after 2006, and have a rank of 12?
SELECT SUM(floors) FROM table_name_73 WHERE built > 2006 AND rank = 12
From year 1991 to 2000, calculate the difference betweeen the total number of papers published under the conference "International Conference on Supercomputing " and "Informatik & Schule"?
SELECT SUM(CASE WHEN T2.FullName = 'Informatik & Schule' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.FullName = 'International Conference on Supercomputing' THEN 1 ELSE 0 END) AS DIFF FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year > 1990 AND T1.Year < 2001
What is the brand name of the root beer that gained a 1-star rating from customer ID 331115 while saying, "Yuk, more like licorice soda"?
SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.CustomerID = 331115 AND T2.Review = 'Yuk, more like licorice soda.' AND T2.StarRating = 1
What is the total shipment by "cargo transport 5" cost of all purchase orders created on 12/14/2011?
SELECT SUM(t2.freight) FROM ShipMethod AS t1 INNER JOIN PurchaseOrderHeader AS t2 ON t1.shipmethodid = t2.shipmethodid WHERE t1.name = 'cargo transport 5' AND t2.orderdate = '2011-12-14'
What is the average height of all players?
SELECT avg ( height ) FROM player
Which pilot won the most matches?
SELECT winning_pilot FROM match group by winning_pilot order by count ( * ) desc limit 1
What college has a pick greater than 4 and an overall of 21?
SELECT college FROM table_name_9 WHERE pick > 4 AND overall = 21
For all movies where users left a critic, find the movie name, user, rating and critics comments from the user.
SELECT T2.movie_title, T1.user_id, T1.rating_score, T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic IS NOT NULL
What is the precise location of the establishment with the highest number of failed inspections?
SELECT T1.latitude, T1.longitude FROM establishment AS T1 INNER JOIN ( SELECT license_no FROM inspection WHERE results = 'Fail' GROUP BY license_no ORDER BY COUNT(results) DESC LIMIT 1 ) AS T2 ON T1.license_no = T2.license_no
When boston university is the team what is the record?
SELECT record FROM table_29846807_5 WHERE team = "Boston University"
What is the nickname of the NBA player whose team competed in the Western Conference in the season 2006 and who had a total of two blocks?
SELECT T2.nameNick FROM player_allstar AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.blocks = 2 AND T1.conference = 'West' AND T1.season_id = 2006
Which Type has a Company of epcor?
SELECT type FROM table_name_21 WHERE company = "epcor"
Which of the mill names contains the french word 'Moulin'?
SELECT name FROM mill WHERE name LIKE '%Moulin%'
Which conference does the school from Gainesville, Florida, play in?
SELECT present_conference FROM table_name_5 WHERE location = "gainesville, florida"
What is the home ground for the team whose home city is Trondheim with 27 seasons?
SELECT home_ground FROM table_2522473_1 WHERE seasons = 27 AND home_city = "Trondheim"
What are the names of all airports whose elevation is between -50 and 50?
SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
Can you just list the id of the most recent order?
SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
What are the names and ids of the tourist attractions that are visited at most once?
SELECT T1.Name , T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*) <= 1
How many different departments are there in each school that has less than 5 apartments?
SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name) < 5
Who is in October when Carina Ragnarsson is in November?
SELECT october FROM table_name_61 WHERE november = "carina ragnarsson"
Find the names of the workshop groups where services with product name "film" are performed.
SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film"
What are the project ids that staff member worked on?
SELECT project_id from Project_staff where staff_id = '5137097.0'
What is the 1991 when 1997 is 18?
SELECT 1991 FROM table_name_26 WHERE 1997 = "18"
What are the name and ID of the product bought the most.
SELECT t2.product_details , t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY sum(t1.order_quantity) LIMIT 1
State the description of the reason why Angelo Buckridge needs the care plan.
SELECT DISTINCT T1.REASONDESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Angelo' AND T2.last = 'Buckridge'
who were the semifinalists for the tournament in montreal?
SELECT semifinalists FROM table_name_95 WHERE tournament = "montreal"
How many patients do each physician take care of? List their names and number of patients they take care of.
SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid
Released on April 12, 1968 in LP format, what was the catalog?
SELECT catalog FROM table_name_20 WHERE format = "lp" AND date = "april 12, 1968"
Which Driver has a Grid smaller than 17, and Points larger than 0, and a Lapse of 87, and a Time/Retired of 1:48:11.023?
SELECT driver FROM table_name_72 WHERE grid < 17 AND points > 0 AND laps = 87 AND time_retired = "1:48:11.023"
Find the product list of the product name?
SELECT product_name FROM products
Name the total number of date for score being l 106–116 (ot)
SELECT COUNT(date) FROM table_23281862_10 WHERE score = "L 106–116 (OT)"
Who was Silva's Partner in the match with a Score of 6–3, 7–6 (7–3)?
SELECT partner FROM table_name_64 WHERE score = "6–3, 7–6 (7–3)"
What is the area of Tuscany?
SELECT MAX(area__km²_) FROM table_14532_1 WHERE region = "Tuscany"
Find the supply key of the top ten suppliers with the most account balance, and list the supply key along with the account balance in descending order of account balance.
SELECT s_suppkey, s_acctbal FROM supplier ORDER BY s_acctbal DESC LIMIT 10
Which Week has an Opponent of washington redskins, and an Attendance larger than 56,077?
SELECT COUNT(week) FROM table_name_74 WHERE opponent = "washington redskins" AND attendance > 56 OFFSET 077