sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What position did the draft pick going to saskatchewan play? | SELECT position FROM table_28059992_5 WHERE cfl_team = "Saskatchewan" |
Please tell me the names of the person who has friends with age above 40 and under age 30. | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN ( SELECT name FROM Person WHERE age > 40 ) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN ( SELECT name FROM Person WHERE age < 30 ) |
What job does Bob do? | SELECT job from person where name = "Bob" |
Which Date has a Tournament of at&t pebble beach national pro-am, and a Margin of victory of 1 stroke, and a To par of –11? | SELECT date FROM table_name_14 WHERE tournament = "at&t pebble beach national pro-am" AND margin_of_victory = "1 stroke" AND to_par = "–11" |
Who is the winner constructor with driver riccardo patrese? | SELECT winning_constructor FROM table_name_79 WHERE winning_driver = "riccardo patrese" |
what type is the institute that enrolled 2102 | SELECT type FROM table_1974632_1 WHERE enrollment = 2102 |
What was strikeforce: barnett vs. cormier's record? | SELECT record FROM table_name_26 WHERE event = "strikeforce: barnett vs. cormier" |
What is the Motion Picture Association of America rating for the movie featuring a villain named Turbo? | SELECT T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.villian = 'Turbo' |
Provide the number of staff at the University of Auckland in 2015. | SELECT CAST(SUM(T1.num_students) AS REAL) / SUM(T1.student_staff_ratio) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'University of Auckland' AND T1.year = 2015 |
What are the total number of Domestic Passengers of airports that contain the word "London." | SELECT sum ( Domestic_Passengers ) FROM airport WHERE Airport_Name LIKE "%London%" |
Name the circuit when the fastest lap was john surtees and the winning driver was john surtees. | SELECT circuit FROM table_name_53 WHERE fastest_lap = "john surtees" AND winning_driver = "john surtees" |
How many tries against did the club with 383 points against have? | SELECT tries_against FROM table_name_39 WHERE points_against = "383" |
List all the ingredients of Apricot Yogurt Parfaits. | SELECT T3.name, T3.category FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Apricot Yogurt Parfaits' |
What is the rank of the team with 1 bronze and 0 gold medals? | SELECT rank FROM table_name_2 WHERE bronze = 1 AND gold = 0 |
How many people watched episode number 13? | SELECT viewers FROM table_27547668_3 WHERE _number = 13 |
How many checks were issued by Euro+ Shopping Channel in the year 2004? | SELECT COUNT(T1.checkNumber) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE customerName = 'Euro+ Shopping Channel' AND STRFTIME('%Y', T1.paymentDate) = '2004' |
what is the place when the event is 4000 m individual pursuit? | SELECT place FROM table_name_94 WHERE event = "4000 m individual pursuit" |
What is the district with the incumbent john nicholas? | SELECT district FROM table_2668405_17 WHERE incumbent = "John Nicholas" |
How many country uses the 2008 System of National Accounts methodology? List our their table name. | SELECT TableName FROM Country WHERE SystemOfNationalAccounts = 'Country uses the 2008 System of National Accounts methodology.' |
What are the names of products with price at most 200? | SELECT name FROM products WHERE price <= 200 |
What is the genre of the movie title which was well-received by the audiences but made the lowest revenue? | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id ORDER BY T1.vote_average DESC, T1.revenue LIMIT 1 |
Which Silver has a Nation of total, and a Bronze smaller than 18? | SELECT MAX(silver) FROM table_name_1 WHERE nation = "total" AND bronze < 18 |
What is Date, when Away is High Park Demons? | SELECT date FROM table_name_43 WHERE away = "high park demons" |
What Displacement has 185hp (138kw) Power o | SELECT displacement FROM table_name_57 WHERE power = "185hp (138kw)" |
What is the total number of rounds with a 4-0 record? | SELECT COUNT(round) FROM table_name_57 WHERE record = "4-0" |
Find the name and age of the person who is a friend of both Dan and Alice. | SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' |
What are the addresses of all the customers with credit cards? | SELECT T2.customer_address FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_type_code = "Credit" |
How many allergies does the food allergy type have? | select count ( Allergy ) from Allergy_Type where AllergyType = 'food' |
For how long was Elly Koss required to take Acetaminophen? | SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description LIKE 'Acetaminophen%' |
If the innings is 68, what is the average? | SELECT average FROM table_23316034_16 WHERE innings = 68 |
How many debates are there? | SELECT COUNT(*) FROM debate |
Which school has a decile of 8 and a roll of 705? | SELECT name FROM table_name_27 WHERE decile = 8 AND roll = 705 |
What was the away team score at Corio Oval? | SELECT away_team AS score FROM table_name_42 WHERE venue = "corio oval" |
Where was the tournament where the score was 1–6, 6–3, 3–6? | SELECT tournament FROM table_name_66 WHERE score = "1–6, 6–3, 3–6" |
What notes have the 8th position? | SELECT notes FROM table_name_39 WHERE position = "8th" |
What is the largest jersey number for the player from maryland | SELECT MAX(no) FROM table_11545282_4 WHERE school_club_team = "Maryland" |
Tell the number of 4-year public schools in UT whose graduation rate exceeds the average for the state. | SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'UT' AND T1.level = '4-year' AND T1.control = 'Public' AND T1.awards_per_value > T1.awards_per_state_value |
Show all cities where students live. | SELECT DISTINCT city_code FROM Student |
Which school has a state authority and a roll of 318? | SELECT name FROM table_name_27 WHERE authority = "state" AND roll = 318 |
What is the title of the episode written by David J. Burke? | SELECT title FROM table_name_6 WHERE written_by = "david j. burke" |
What is the lowest number of three pointers in games where the number of rebounds was 178? | SELECT MIN(three_pointers) FROM table_22824324_2 WHERE rebounds = 178 |
What is the score [A] of the match at Vanuatu (n) on 5 September 1998? | SELECT score_[a_] FROM table_name_39 WHERE venue = "vanuatu (n)" AND date = "5 september 1998" |
What position did Roseau High School (USHS-MN) play? | SELECT position FROM table_2897457_7 WHERE college_junior_club_team = "Roseau High School (USHS-MN)" |
Among all the Olympic competitors from Finland, how many of them are female? | SELECT COUNT(T3.id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Finland' AND T3.gender = 'F' |
Give the religion of the legislator whose YouTube name is MaxineWaters. | SELECT T2.religion_bio FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T1.youtube = 'MaxineWaters' |
How many attempts did the player ranking with a number higher than 1, who started after 1997 and had yds/att of 5 have? | SELECT SUM(attempts) FROM table_name_66 WHERE start > 1997 AND yds_att = 5 AND rank > 1 |
Who was the opponent on september 27, 1998? | SELECT opponent FROM table_name_16 WHERE date = "september 27, 1998" |
Show first name for all students with major 600. | SELECT Fname FROM Student WHERE Major = 600 |
what is the township when the land (sqmi) is more than 36.112, the geo id is higher than 3801985060 and the latitude is 46.062384? | SELECT township FROM table_name_20 WHERE land___sqmi__ > 36.112 AND geo_id > 3801985060 AND latitude = 46.062384 |
What is the lowest total that has draws less than 2 and wins less than 1, losses bigger than 1 with a goal difference of 1:2 | SELECT MIN(total) FROM table_name_89 WHERE draws < 2 AND wins < 1 AND goal_difference = "1:2" AND losses > 1 |
What is the opening time of the active businesses in Glendale that have a medium review count. | SELECT DISTINCT T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city = 'Glendale' AND T1.review_count = 'Medium' AND T1.active = 'true' |
what is the minimum kerry # with bush % being 78.40% | SELECT MIN(kerry__number) FROM table_13606924_1 WHERE bush__percentage = "78.40%" |
What was Footscray's score when it played as the home team? | SELECT home_team AS score FROM table_name_2 WHERE home_team = "footscray" |
Find the average age and number of male students (with sex M) from each city. | SELECT count(*) , avg(age) , city_code FROM student WHERE sex = 'M' GROUP BY city_code |
Who won best actor? | SELECT awardee_s_ FROM table_25926120_3 WHERE name_of_award = "Best Actor" |
Find the countries in south Asia which are in the low-income group. What is the source of their recent income and expenditure data? List it alongside the table name of the countries. | SELECT TableName, SourceOfMostRecentIncomeAndExpenditureData FROM Country WHERE Region = 'South Asia' AND IncomeGroup = 'Low income' |
What is the comment of the product "burlywood plum powder puff mint"? | SELECT p_comment FROM part WHERE p_name = 'burlywood plum powder puff mint' |
Please list the IDs of the advisors of the students who are in the 5th year of their program. | SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_5' |
show the train name and station name for each train. | SELECT T2.name , T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id |
What is the college name for that one? | SELECT T1.cName FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker' |
On what date does Yuji Tachikawa have the fastest lap in round 1? | SELECT date FROM table_name_24 WHERE fastest_lap = "yuji tachikawa" AND round = 1 |
When did the Senior Tool Designer, who was 33 years old at the time he was hired, stopped working in the Engineering department? | SELECT T2.EndDate FROM Employee AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID WHERE T1.JobTitle = 'Senior Tool Designer' AND STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) = 33 AND T2.EndDate IS NOT NULL |
Find the number of different products that are produced by companies at different headquarter cities. | SELECT count(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter |
What is the area of the parish with a population larger than 1,172 and a census ranking of 1,871 of 5,008? | SELECT COUNT(area_km_2) FROM table_name_16 WHERE census_ranking = "1,871 of 5,008" AND population > 1 OFFSET 172 |
Who was in the East when TUS Geretsried II was in the South? | SELECT east FROM table_name_9 WHERE south = "tus geretsried ii" |
What percentage of businesses in the Northwest US have forecasted annual sales of above 300,000? | SELECT CAST(SUM(CASE WHEN T1.SalesQuota > 300000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T2.CountryRegionCode = 'US' AND T2.Name = 'Northwest' |
What are the first and last names of the employee with the earliest date of birth? | SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1 |
Show names of actors that have appeared in musical with name "The Phantom of the Opera". | SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID WHERE T2.Name = "The Phantom of the Opera" |
What is the position of the player with an overall of 45? | SELECT position FROM table_name_70 WHERE overall = 45 |
In which country and state does staff with first name as Janessa and last name as Sawayn live? | SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; |
Who are the co-authors for Jei Keon Chae and what is the title of paper written by them? | SELECT T2.AuthorId, T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Jei Keon Chae' |
Provide the number of airplanes that landed on Oakland Airport on 2018/8/7. | SELECT SUM(CASE WHEN T1.Description LIKE '%Oakland%' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/7' |
If the opponents in the final is Hewitt McMillan and the partner is Fleming, what is the surface? | SELECT surface FROM table_22597626_2 WHERE partner = "Fleming" AND opponents_in_the_final = "Hewitt McMillan" |
How many distinct delegates are from counties with population larger than 50000? | SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000 |
What is the date of the game when the home team is melbourne? | SELECT date FROM table_29090919_1 WHERE home_team = "Melbourne" |
Name the publisher for resident evil 4 | SELECT publisher_s_ FROM table_14325653_2 WHERE video_game = "Resident Evil 4" |
What date was game 78 played on? | SELECT date FROM table_23248967_10 WHERE game = 78 |
Show names of technicians and series of machines they are assigned to repair. | SELECT T3.Name , T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID |
On games against the Devil Rays and a score of 2 - 1 (10), what was the attendance? | SELECT AVG(attendance) FROM table_name_52 WHERE opponent = "devil rays" AND score = "2 - 1 (10)" |
What is the sum of Games for Allofs, Klaus, with Goals less than 177? | SELECT SUM(games) FROM table_name_53 WHERE name = "allofs, klaus" AND goals < 177 |
Where was the attendance more than 57,347? | SELECT location FROM table_name_27 WHERE attendance > 57 OFFSET 347 |
Which country scored 66-68=134? | SELECT country FROM table_name_60 WHERE score = 66 - 68 = 134 |
Show institution names along with the number of proteins for each institution. | SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id |
Which Venue has a Date of january 9, 2011? | SELECT venue FROM table_name_51 WHERE date = "january 9, 2011" |
What is the name of the country with the most number of home airlines? | SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1 |
How many votes did the security guard get? | SELECT votes FROM table_name_78 WHERE occupation = "security guard" |
What is the description of document type 'Paper'? | SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = "Paper"; |
What country was the player with the score line 69-71-72-69=281 from? | SELECT country FROM table_name_6 WHERE score = 69 - 71 - 72 - 69 = 281 |
How many directors have multiple show times? | SELECT count ( distinct T2.directed_by ) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id where T1.show_times_per_day>1 |
Give the names and scores of wines made from white grapes. | SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" |
What was the result of the dance which had a style of contemporary jazz? | SELECT results FROM table_name_1 WHERE style = "contemporary jazz" |
What is the percentage of star score 5 that was collected by title "Sex, Pies and Idiot Scrapes"? | SELECT CAST(SUM(CASE WHEN T2.stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Sex, Pies and Idiot Scrapes'; |
Which chassis was used when over 6 points were earned? | SELECT chassis FROM table_name_47 WHERE points = 6 |
Where was the game played when the score was 1-4? | SELECT venue FROM table_name_72 WHERE score = "1-4" |
When was the first ever project went live on the site and what were the names of the resources being requested? If there are multiple projects that have the same date, indicate each of them and their items. | SELECT T2.date_posted, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.date_posted = ( SELECT date_posted FROM projects ORDER BY date_posted ASC LIMIT 1 ) |
Where is il-36β located? | SELECT chromosomal_location FROM table_29871617_1 WHERE name = "IL-36β" |
How many injury accidents are there in total? | SELECT count ( * ) from injury_accident |
What was the date of the game in which Holt (4-4) took the loss? | SELECT date FROM table_name_36 WHERE loss = "holt (4-4)" |
What's the smallest amount of laps that suzuki ran with a grid value of 8? | SELECT MIN(laps) FROM table_name_26 WHERE manufacturer = "suzuki" AND grid = 8 |
Great! Can you tell me where Jack Campbells birthplace was? | SELECT birth_place FROM people WHERE name = "Jack Campbell" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.