sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
How many bands are there? | SELECT count(*) FROM Band |
Show different colleges along with the number of authors of submission from each college. | SELECT College, COUNT(*) FROM submission GROUP BY College |
What was the total amount of Value ($M), when the Rank was higher than 6, and the % change on year was -27? | SELECT COUNT(value__) AS $m_ FROM table_name_36 WHERE rank > 6 AND _percentage_change_on_year = "-27" |
Which cmi cross reference id is not related to any parking taxes? | SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines |
What is the average win as a percentage of German racer Rudi Altig, who has ridden in over 79 races? | SELECT AVG(win_average) FROM table_name_50 WHERE nationality = "german" AND name = "rudi altig" AND races_ridden > 79 |
Which Matches is on 24 march 1963 with a Rank larger than 44? | SELECT MAX(matches_as_champion) FROM table_name_6 WHERE title_last_held = "24 march 1963" AND rank > 44 |
Where was the location of the Mong Kok Stadium? | SELECT location FROM table_name_12 WHERE home_ground = "mong kok stadium" |
What is the characteristic name used by most number of the products? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1 |
What are the regions that use English or Dutch? | SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" OR T2.Language = "Dutch" |
How many car makers are there in france? | SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france'; |
What are the names of mountains in ascending alphabetical order? | SELECT Name FROM mountain ORDER BY Name ASC |
Return the full names and salaries of employees with null commissions. | SELECT first_name , last_name , salary FROM employees WHERE commission_pct = "null" |
Could you list the names of all counties in ascending alphabetical order? | SELECT County_name FROM county order by County_name |
Provide the number of events participated by the device users at coordinates of (80,37). | SELECT COUNT(event_id) FROM events WHERE longitude = 80 AND latitude = 37 |
Find the county where produces the most number of wines with score higher than 90. | SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY count(*) DESC LIMIT 1 |
What are the heights of body builders with total score smaller than 315? | SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315 |
Show the ids of all employees who have either destroyed a document or made an authorization to do this. | SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed |
What are the products with the maximum page size eqal to A4 or a pages per minute color less than 5? | SELECT product FROM product WHERE max_page_size = "A4" OR pages_per_minute_color < 5 |
How many items were shipped on 4th December, 1993? | SELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipdate = '1993-12-04' |
Name the appearance for independence bowl | SELECT COUNT(appearances) FROM table_2517159_1 WHERE name_of_bowl = "Independence Bowl" |
What is the title of the book in the order ID 931? | SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.order_id = 931 |
What is the highest Total, when Gold is 1, when Nation is Hungary, and when Bronze is less than 0? | SELECT MAX(total) FROM table_name_32 WHERE gold = 1 AND nation = "hungary" AND bronze < 0 |
What is the id, name and nationality of the architect who built most mills? | SELECT T1.id , T1.name , T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1 |
What was the winning score at bellerive country club? | SELECT score FROM table_275162_1 WHERE course = "Bellerive country Club" |
Which poll had a week 10 larger than 2, a week 2 of exactly 12, and a week 13 of 8? | SELECT poll FROM table_name_10 WHERE wk_10 > 2 AND wk_2 = "12" AND wk_13 = 8 |
What is the sum of votes for the green party? | SELECT SUM(votes__gib_) FROM table_name_38 WHERE party = "green" |
Which problems are reported before 1978-06-26? Give me the ids of the problems. | SELECT problem_id FROM problems WHERE date_problem_reported < "1978-06-26" |
Could you please show me the average share count of transactions of each investor? | SELECT investor_id , avg ( share_count ) FROM TRANSACTIONS GROUP BY investor_id |
Who does Nancy Edwards report to? | The first and last names of the employee whom Nancy Edwards reports to is Andrew Adams. | Who does Andrew Adams report to? | SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T2.first_name = "Andrew" AND T2.last_name = "Adams" |
show me the first and last names of students in Wisconsin. | SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Wisconsin" |
Which country is dated October 20, 1976? | SELECT country FROM table_name_83 WHERE date = "october 20, 1976" |
What is the total overall for the pick that went before round 4, who went to Tennessee for college, and was picked at a number bigger than 9? | SELECT SUM(overall) FROM table_name_60 WHERE round < 4 AND college = "tennessee" AND pick__number > 9 |
Return the grade for the high schooler named Kyle. | SELECT grade FROM Highschooler WHERE name = "Kyle" |
Drawn of 0, and a Games larger than 5 has what amount of highest points? | SELECT MAX(points) FROM table_name_62 WHERE drawn = 0 AND games > 5 |
How many types of music does Yelp business No."1141" have? | SELECT COUNT(T1.attribute_name) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T2.business_id = 1141 |
Count the number of documents that do not have expenses. | SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses ) |
Which College has an Overall larger than 211, a Position of db, and a Name of carl charon? | SELECT college FROM table_name_7 WHERE overall > 211 AND position = "db" AND name = "carl charon" |
Calculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577. | SELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - AVG(T1.num_sales)) * 100.0 / AVG(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T1.game_platform_id = 9577 |
Which country has a rank of 2? | SELECT country FROM table_name_93 WHERE rank = 2 |
What is the date of birth of the actor who played the role of a "writer"? | SELECT T2.birthdate FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.role = 'writer' |
What were the highest points before the year 1974? | SELECT MAX(points) FROM table_name_61 WHERE year < 1974 |
What is the site when the superintendent was John Barry? | SELECT site FROM table_name_28 WHERE superintendent = "john barry" |
What is the original NFL team of the College of Oregon DT Player? | SELECT original_nfl_team FROM table_name_51 WHERE college = "oregon" AND pos = "dt" |
What is the UK singles chart rank of the single released on 26 February 1990? | SELECT uk_singles_chart FROM table_name_9 WHERE release_date = "26 february 1990" |
If the UK air date is February 18, 2013, who was the episode written by? | SELECT written_by FROM table_25640730_7 WHERE uk_air_date = "February 18, 2013" |
What city has Sky Tower? | SELECT city FROM table_name_35 WHERE name = "sky tower" |
Compute the total order quantity for Uncle Bob's Organic Dried Pears so far. | SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName LIKE 'Uncle Bob%s Organic Dried Pears' |
How about just for Cola? | SELECT avg ( price_in_euros ) , min ( price_in_euros ) FROM catalog_contents where catalog_entry_name = 'Cola' |
What was the score for the game where the home team was Wycombe Wanderers? | SELECT score FROM table_name_73 WHERE home_team = "wycombe wanderers" |
What player went to DePaul University? | SELECT player FROM table_name_80 WHERE college = "depaul" |
For each grant id, how many documents does it have, and which one has the most? | SELECT grant_id , count(*) FROM Documents GROUP BY grant_id ORDER BY count(*) DESC LIMIT 1 |
Find the titles and studios of the films that are produced by some film studios that contained the word "Universal". | SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%" |
What is the largest series number? | SELECT MAX(series__number) FROM table_19517621_4 |
How many businesses are with high review count? | SELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'High' |
What is the average Round for wide receiver r. jay soward and Overall smaller than 29? | SELECT AVG(round) FROM table_name_16 WHERE position = "wide receiver" AND name = "r. jay soward" AND overall < 29 |
Show all the distinct product names with price higher than the average. | SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS) |
How many OPPO users participated in events which were held around 12 AM on 1st May,2016? | SELECT COUNT(T1.device_id) FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' AND STRFTIME('%Y-%m-%d', T1.`timestamp`) = '2016-05-01' |
Show ids for all students who live in CHI. | SELECT StuID FROM Student WHERE city_code = "CHI" |
What episode number in the series had a production code of bdf405? | SELECT MIN(series__number) FROM table_28019988_5 WHERE production_code = "BDF405" |
How many of the drivers are over 40? | SELECT count ( * ) FROM driver WHERE age > 40 |
What is the lowest Gold count if the Bronze is 4 and Silver is greater than 5? | SELECT MIN(gold) FROM table_name_45 WHERE bronze = 4 AND silver > 5 |
What is the highest pick of the wr player with an overall less than 15? | SELECT MAX(pick) FROM table_name_62 WHERE position = "wr" AND overall < 15 |
List all customers’ names in the alphabetical order. | SELECT name FROM accounts ORDER BY name |
Name the vote for gigit | SELECT vote FROM table_16976547_2 WHERE eliminated = "Gigit" |
WHAT IS THE TITLE WITH CATEGORY OF best r&b song? | SELECT title FROM table_name_95 WHERE category = "best r&b song" |
what is id of students who registered some courses but the least number of courses in these students? | SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1 |
What is the number of professors for different school? | SELECT count(*) , T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code |
Count the number of captains that have each rank. | SELECT count(*) , rank FROM captain GROUP BY rank |
When did Shakespeare write the first poem? | SELECT MIN(Date) FROM works WHERE GenreType = 'Poem' |
What is the Visitor of the game with a Record of 21–17–13? | SELECT visitor FROM table_name_70 WHERE record = "21–17–13" |
Count the number of members in club "Bootup Baltimore" whose age is above 18. | SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.age > 18 |
Name the points against for november 7 | SELECT points_against FROM table_15607589_2 WHERE date = "November 7" |
What is the Physician name of the following Employee ID? tell me the SSN. | Sorry what employee IDs are you talking about? | Sorry for my mistake.
What is the Physician name of the following Employee ID 2? tell me the SSN. | select name,SSN from physician where employeeid = 2 |
What is Winner, when Win # is greater than 1, and when Points is less than 94? | SELECT winner FROM table_name_76 WHERE win__number > 1 AND points < 94 |
Who was the opponent in week 4? | SELECT opponent FROM table_14875671_1 WHERE week = 4 |
How much is her GDP in agriculture for the country with the least area? | SELECT T2.GDP * T2.Agriculture FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T1.Area ASC LIMIT 1 |
Which county has the lowest crime rate? | Would you like the county name corresponding to the lowest crime rate? | yes | SELECT Name FROM county_public_safety ORDER BY Crime_rate ASC LIMIT 1 |
What is the Eurozone result for Population M (LUZ) of 3.08? | SELECT eurozone FROM table_name_24 WHERE population_m__luz_ = 3.08 |
Among the female users of the devices, how many of them are over 30? | SELECT COUNT(device_id) FROM gender_age WHERE age > 30 AND gender = 'F' |
How many distinct transaction types are used in the transactions? | SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS |
What percentage of users rated the movie "Patti Smith: Dream of Life" by more than 3? | SELECT CAST(SUM(CASE WHEN T1.rating_score > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Patti Smith: Dream of Life' |
Find the names of all wines produced in 2008. | SELECT Name FROM WINE WHERE YEAR = "2008" |
What is the prefix for the teacher who handled the 'Reading About Other Cultures' project? | SELECT T2.teacher_prefix FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Reading About Other Cultures' |
Which organizations are not a parent organization of others? List the organization id. | SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations |
What are the prices of those? | SELECT T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 |
What is the position of the employee with the 10th highest salary? Indicate his/her salary amount and his/her full name. | SELECT T2.JobTitle, T1.Rate, T3.FirstName, T3.MiddleName, T3.LastName FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID ORDER BY T1.Rate DESC LIMIT 9, 1 |
List the eateries' names and addresses which had reinspection on 2nd February, 2015. | SELECT T2.name, T2.address FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2015-02-02' AND T1.type = 'Reinspection/Followup' |
What was the average year that the Nashville Metros did not qualify for the Playoffs, did not qualify for the Open Cup, and had the Regular Season 7th, Southeast? | SELECT AVG(year) FROM table_name_78 WHERE playoffs = "did not qualify" AND open_cup = "did not qualify" AND regular_season = "7th, southeast" |
Which apps have not been updated since year 2015 and what kind of sentiment users hold on it? | SELECT DISTINCT App, Sentiment FROM user_reviews WHERE App IN ( SELECT App FROM playstore WHERE CAST(SUBSTR('Last Updated', -4, 4) AS INTEGER) < 2015 ) |
great, can you give me the organization type and detail too? | SELECT T1.organisation_id , T1.organisation_type , T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count ( * ) DESC LIMIT 1 |
What shows for Scorers when the Opponent was west germany on October 7? | SELECT scorers FROM table_name_31 WHERE opponent = "west germany" AND date = "october 7" |
What is the the birth country of player-ids? | Do you mean the birth country of all players? | yes | SELECT birth_country FROM player |
what is the date of attendance of the student is 121? | the date of attendance of the student with id 121 is 2012-04-09 11:44:34. | which student id attend english and french both course? | SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English" intersect SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "French" |
What is the Diameter of the Dog Sled (gold variant) Theme coin? | SELECT diameter FROM table_name_74 WHERE theme = "dog sled (gold variant)" |
What year did Coenraad Breytenbach have their Int'l Debut? | SELECT year FROM table_name_92 WHERE player = "coenraad breytenbach" |
What are the average, maximum, and minimum number of floors for all buildings? | SELECT avg(floors) , max(floors) , min(floors) FROM building |
How high did Arnold Palmer score in 1962? | SELECT MAX(score) FROM table_name_69 WHERE player = "arnold palmer" |
How many hours of training has the student with the most hours completed? | SELECT hs from player order by hs desc limit 1 |
How many publishers published the Minecraft game? | SELECT COUNT(T2.publisher_id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id WHERE T1.game_name = 'Minecraft' |
What group was the Hollindale Stakes in? | SELECT group FROM table_2062148_3 WHERE race = "Hollindale Stakes" |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.