sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Show the minimum, average, maximum order quantity of all invoices. | SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES |
What is the joined year of the pilot of the highest rank? | SELECT Join_Year FROM pilot ORDER BY Rank ASC LIMIT 1 |
What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8? | SELECT f_id FROM song WHERE resolution > (SELECT max(resolution) FROM song WHERE rating < 8) |
What is Streak, when Heat Points is "101", and when Game is "16"? | SELECT streak FROM table_name_12 WHERE heat_points = 101 AND game = 16 |
Name the total number of viewers for audience share in timeslot for 10.2% | SELECT COUNT(viewers__millions_) FROM table_19834691_4 WHERE audience_share_in_timeslot = "10.2%" |
Find the first name and country code of the player who did the most number of tours. | SELECT T1.country_code , T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id ORDER BY T2.tours DESC LIMIT 1 |
What is the lowest pick for the Buffalo Bills? | SELECT MIN(pick) FROM table_name_60 WHERE team = "buffalo bills" |
Which report includes Bobby Unser as the Pole Position and Rick Mears as the Winning driver? | SELECT report FROM table_name_33 WHERE pole_position = "bobby unser" AND winning_driver = "rick mears" |
Show the location name for document "Robin CV". | SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = "Robin CV" |
Which sign has a fall of Venus? | SELECT sign FROM table_name_5 WHERE fall = "venus" |
Who are the ministers and what parties do they belong to, listed descending by the times they took office? | SELECT minister , party_name FROM party ORDER BY took_office DESC |
Tell me the sum of gold for bronze less than 0 | SELECT SUM(gold) FROM table_name_31 WHERE bronze < 0 |
How many courses are in Mech. eng? | SELECT count ( * ) FROM course where dept_name = 'Mech. Eng.' |
what is 2004 when the tournament is paris masters? | SELECT 2004 FROM table_name_49 WHERE tournament = "paris masters" |
Give me the names of members whose address is in Harford or Waterbury. | SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury' |
What is the total number of teams founded that were left in 1976? | SELECT SUM(founded) FROM table_name_47 WHERE left = "1976" |
What is the original air date of the episode that was directed by Bruce Seth Green? | SELECT original_air_date FROM table_29584044_1 WHERE directed_by = "Bruce Seth Green" |
On May 8 what series is it? | SELECT series FROM table_name_41 WHERE date = "may 8" |
In users yelping since 2011 to 2013, how many of them have high count of fans? | SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year BETWEEN 2011 AND 2013 AND user_fans LIKE 'High' |
What player had a school of missouri | SELECT player FROM table_name_13 WHERE school_club_team_country = "missouri" |
Find the document type name of the document named "How to read a book". | SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = "How to read a book" |
Which From club had a Transfer fee of £3.87m? | SELECT from_club FROM table_name_40 WHERE transfer_fee = "£3.87m" |
What are the names of scientists who are assigned to any project? | SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn |
Show all student ids and the number of hours played. | SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid |
How many matches were played in 2013 or 2016? | SELECT count(*) FROM matches WHERE YEAR = 2013 OR YEAR = 2016 |
what is the original air date for the episoe written by vanessa reisen? | SELECT original_air_date FROM table_13336122_5 WHERE written_by = "Vanessa Reisen" |
What Elector was Elevated on December 18, 1182? | SELECT elector FROM table_name_31 WHERE elevated = "december 18, 1182" |
What is the name of the director who directed the movie that Raintree Pictures produced? | SELECT director FROM table_name_13 WHERE producer = "raintree pictures" |
Where was game 62 played? | SELECT location FROM table_16864968_7 WHERE game = 62 |
The Palazzo's street address is listed as what? | SELECT street_address FROM table_name_73 WHERE name = "the palazzo" |
Count the number of programs broadcast for each time section of a day. | SELECT count(*) , time_of_day FROM broadcast GROUP BY time_of_day |
When 5 is the rank of 2011 what is the country? | SELECT country FROM table_293465_1 WHERE rank_2011 = 5 |
List the name and the number of enrolled student for each course. | 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 |
Find the major that is studied by the largest number of students. | SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1 |
What is the last transcript release date? | SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1 |
What is the average point count for tristan gommendy? | SELECT AVG(points) FROM table_name_30 WHERE driver = "tristan gommendy" |
Name the least attendance for may 6 | SELECT MIN(attendance) FROM table_name_1 WHERE date = "may 6" |
WHAT IS THE ERUPE WITH HEAD COACH vainauskas , sakalauskas AND WITH NEBL FINALIST? | SELECT europe FROM table_name_68 WHERE head_coach = "vainauskas , sakalauskas" AND regional_competitions = "nebl finalist" |
Tell me the circuit for 10 may for targa florio | SELECT circuit FROM table_name_79 WHERE date = "10 may" AND name = "targa florio" |
What is the status of player Philipp Kohlschreiber? | SELECT status FROM table_24431348_18 WHERE player = "Philipp Kohlschreiber" |
retrieve the country that has published the most papers? | SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY count ( * ) DESC LIMIT 1 |
Who is every stage winner at the distance of 162.5? | SELECT stage AS winner FROM table_275506_1 WHERE distance__km_ = "162.5" |
Tell me the average goals with apps less than 3 | SELECT AVG(goals) FROM table_name_16 WHERE apps < 3 |
Which sport was held in Huntsville at the Von Braun Center as part of the Southern Indoor Football League? | SELECT sport FROM table_name_76 WHERE city = "huntsville" AND venue = "von braun center" AND league = "southern indoor football league" |
What year was Black Swan up for the Gotham Awards? | SELECT COUNT(year) FROM table_name_47 WHERE title = "black swan" AND award = "gotham awards" |
With which kind of payment method were the least number of payments processed? | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1 |
What is the simplified Chinese name for the 9th album? | SELECT chinese__simplified_ FROM table_name_21 WHERE album_number = "9th" |
how many wiaa classifications does fort vancouver high school have? | SELECT COUNT(wiaa_classification) FROM table_22058547_1 WHERE high_school = "Fort Vancouver" |
Which English name has a Color of green? | SELECT english_name FROM table_name_54 WHERE color = "green" |
that was quick, thank you again. then could you please let me know if there is any station which has less than 10 maximum precipitation? | SELECT t2.id FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING max ( t1.precipitation ) < 10 |
Which Rebuilt has a Builder of derby, and a Name as rebuilt of ben madigan? | SELECT rebuilt FROM table_name_64 WHERE builder = "derby" AND name_as_rebuilt = "ben madigan" |
Who is the heaviest athlete from Russia? | SELECT T3.full_name 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 = 'Russia' ORDER BY T3.weight DESC LIMIT 1 |
What is the surface on 15 August 2009? | SELECT surface FROM table_name_45 WHERE date = "15 august 2009" |
How many voice-actors were involved in the Bambi movie? | SELECT COUNT(DISTINCT 'voice-actor') FROM `voice-actors` WHERE movie = 'Bambi' |
How many females does this network has? | SELECT count(*) FROM Person WHERE gender = 'female' |
Which Church has 27 stops? | SELECT church FROM table_name_71 WHERE stops = "27" |
What is the id of the patient who stayed in room 111 most recently? | SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1 |
Which product has the highest price in 2012? | SELECT ProductID FROM ProductListPriceHistory WHERE StartDate LIKE '2012%' ORDER BY ListPrice DESC LIMIT 1 |
On what date was the score 2-1? | SELECT date FROM table_name_38 WHERE score = "2-1" |
Find the names of courses taught by the tutor who has personal name "Julio". | SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio" |
Which skill is used in fixing the most number of faults? List the skill id and description. | SELECT T1.skill_id , T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1 |
What is their average salary? | SELECT avg ( salary ) FROM instructor WHERE dept_name = "Statistics" |
How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total? | SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990 |
Which Crowd has a Home team of geelong? | SELECT crowd FROM table_name_86 WHERE home_team = "geelong" |
Find the ids of all distinct customers who made order after some orders that were Cancelled. | SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code = "Cancelled") |
What is every entry for Tuesday August 23 when Thursday August 25 is 24' 31.87 92.282mph? | SELECT tues_23_aug FROM table_30058355_3 WHERE thurs_25_aug = "24' 31.87 92.282mph" |
Find out which business ID are opened all the time. | SELECT DISTINCT business_id FROM Business_Hours WHERE day_id >= 1 AND day_id < 8 AND opening_time = closing_time |
Who was the constructor of car 22? | SELECT constructor FROM table_15491596_1 WHERE no = 22 |
How many episodes were directed by Tim Matheson? | SELECT COUNT(original_air_date) FROM table_25740548_2 WHERE directed_by = "Tim Matheson" |
What is the item "Moving to", when the Transfer fee is £300,000? | SELECT moving_to FROM table_name_56 WHERE transfer_fee = "£300,000" |
What is the newest established organization where Singapore is a member of? | SELECT T3.Name FROM country AS T1 INNER JOIN isMember AS T2 ON T1.Code = T2.Country INNER JOIN organization AS T3 ON T3.Country = T2.Country WHERE T1.Name = 'Singapore' ORDER BY T3.Established DESC LIMIT 1 |
WHAT IS THE TO PAR WITH A FINISH OF T11, FOR DAVID GRAHAM? | SELECT to_par FROM table_name_23 WHERE finish = "t11" AND player = "david graham" |
Can you tell the Lost that has the Try BP of 10, and the Club of uwic rfc? | SELECT lost FROM table_name_50 WHERE try_bp = "10" AND club = "uwic rfc" |
Thanks! I'm a bit short on time, so can you provide me with Owens loan amount? | SELECT t2.amount FROM loan AS T2 JOIN customer AS T1 ON T1.cust_id = T2.cust_id WHERE t1.cust_name = "Owen" |
Can you get me the first names of students that have a milk allergy? | SELECT DISTINCT T1.fname FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" |
What is the record of the team that lost to Alexander (5-2)? | SELECT record FROM table_name_12 WHERE loss = "alexander (5-2)" |
What is the skip with a second of Philippe Caux? | SELECT skip FROM table_name_30 WHERE second = "philippe caux" |
what is the listing for 1999 when 1990 is more than 0, 2003 is 3, 2007 is more than 1 and 1996 is more than 0? | SELECT SUM(1999) FROM table_name_27 WHERE 1990 > 0 AND 2003 = 3 AND 2007 > 1 AND 1996 > 0 |
Can you tell me the average Laps that has the Time of +17.485, and the Grid smaller than 7? | SELECT AVG(laps) FROM table_name_16 WHERE time = "+17.485" AND grid < 7 |
What is listed as the highest Gold that also has a Silver that's smaller than 1, and has a Total that's smaller than 0? | SELECT MAX(gold) FROM table_name_23 WHERE silver < 1 AND total < 0 |
What are the first names of all students that are not enrolled in courses? | SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN) |
What is the mobile phone number of the student named Timmothy Ward ? | SELECT cell_mobile_number FROM students WHERE first_name = 'timmothy' AND last_name = 'ward' |
What is the kind of Democratic ticket has a Office of comptroller? | SELECT democratic_ticket FROM table_name_14 WHERE office = "comptroller" |
How many captains with younger than 50 are in each rank? | SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank |
What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction? | SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "254 Ottilie Junction" OR T2.How_to_Get_There = "bus" |
Name the timeslot for season 5 | SELECT timeslot FROM table_143554_1 WHERE season = 5 |
What was the latest order that customer No.114 made? Give the name of the product. | SELECT t3.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t1.productCode = t3.productCode WHERE t2.customerNumber = '114' ORDER BY t2.orderDate DESC LIMIT 1 |
On which date is the tournament final with the opponents michael berrer & kenneth carlsen? | SELECT date FROM table_name_98 WHERE opponents_in_the_final = "michael berrer & kenneth carlsen" |
Find the name and active date of the customer that use email as the contact channel. | SELECT t1.customer_name , t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' |
What is the Date of the game with a Record of 1–2–4? | SELECT date FROM table_name_27 WHERE record = "1–2–4" |
What are the characters of actors in descending order of age? | SELECT Character FROM actor ORDER BY age DESC |
Which archbishop was ordained as bishop November 30, 1925? | SELECT archbishop FROM table_1656555_1 WHERE ordained_bishop = "November 30, 1925" |
what is the card number of Aniyah | Do you mean the customer with first name Aniyah | exactly | SELECT T2.card_number from Customers as T1 JOIN Customers_Cards as T2 ON T1.customer_id = T2.customer_id WHERE customer_first_name = "Aniyah" |
What are the Poles for Season 2006 | SELECT poles FROM table_name_91 WHERE season = 2006 |
What are the entry names of catalog with the attribute processed by most entries? | SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = ( SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count ( * ) DESC LIMIT 1 ) |
How many students and instructors are in each department? | SELECT count(DISTINCT T2.id) , count(DISTINCT T3.id) , T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name |
What was the qualifying 2 time for the team with a qualifying 1 time of 1:01.630? | SELECT qual_2 FROM table_name_55 WHERE qual_1 = "1:01.630" |
how many ships have more than one captain? | Select count ( * ) from ( SELECT * FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count ( * ) > 1 ) |
Who was the republican candidate in 2013 when Staten Island was 451? | SELECT 2013 AS _republican_primary FROM table_1108394_6 WHERE staten_island = "451" |
What is the status in the district with the incumbent Bob Barr? | SELECT status FROM table_26336739_1 WHERE incumbent = "Bob Barr" |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.