sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
How many books were ordered in the last month of the year 2020? | SELECT COUNT(*) FROM cust_order WHERE order_date LIKE '2020-12%' |
Can you list the ids of them by the numer of people attended? | Do you want to list them in ascending order or descending order? | Descending please | SELECT event_id FROM event ORDER BY Event_Attendance DESC |
List the names of aircrafts and that did not win any match. | SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH) |
List the total number of years that have a score of 3–6, 4–6, 2–6. | SELECT COUNT(year) FROM table_2201724_1 WHERE score_in_the_final = "3–6, 4–6, 2–6" |
How many first downs were there when the attendance was 13196? | SELECT MIN(first_downs) FROM table_14877831_2 WHERE attendance = 13196 |
What is the average review given by a subscriber? | SELECT AVG(T2.StarRating) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.SubscribedToEmailList = 'TRUE' |
What's the total number of League Cup with a Play-off larger than 2, and a Name of Mitch Cook Category:Articles with hCards? | SELECT COUNT(league) AS Cup FROM table_name_8 WHERE play_offs > 2 AND name = "mitch cook category:articles with hcards" |
What is the lowest drawn for entries with a lost of 13? | SELECT MIN(drawn) FROM table_name_38 WHERE lost = 13 |
Great, what is the most common name? | SELECT staff_name from staff group by staff_name order by count ( * ) desc limit 1 |
Find the name of the stadium that has the maximum capacity. | SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1 |
Which nationaly is ranked greater than 1, with a time of 59.75? | SELECT nationality FROM table_name_1 WHERE rank > 1 AND time = "59.75" |
Please list bikes id were used in trips which start station were installed in 2013. | SELECT DISTINCT T1.bike_id FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.installation_date LIKE '%2013' |
Please list the phone numbers of all the customers in the household segment and are in Brazil. | SELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'BRAZIL' |
What is the total round for a wide receiver with an overall of more than 145? | SELECT COUNT(round) FROM table_name_4 WHERE position = "wide receiver" AND overall > 145 |
Show each school name, its budgeted amount, and invested amount in year 2002 or after. | SELECT T2.school_name , T1.budgeted , T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002 |
What was the lowest home attendance for the southern derby? | SELECT MIN(home_attendance) FROM table_14302582_1 WHERE competition = "Southern Derby" |
Find the average millisecond length of Latin and Pop tracks. | SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Latin" OR T1.Name = "Pop" |
Please list the destination cities of all the flights that were cancelled on 2018/8/1. | SELECT DEST FROM Airlines WHERE FL_DATE = '2018/8/1' AND CANCELLED = 1 GROUP BY DEST |
Excellent! Thanks for that! Can you add to this list the event name associated with each member name? | SELECT distinct member_name, T2.Event_Name FROM member as T1 join party_events as T2 on T1.Member_ID = T2.Member_in_charge_ID |
What County scored with a speed of 98.09mph? | SELECT country FROM table_name_7 WHERE speed = "98.09mph" |
List the name of stations that were installed from 8/5/2013 to 12/31/2013. Indicate their installation date and city name. | SELECT name, installation_date, city FROM station WHERE (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) = '5' AND SUBSTR(CAST(installation_date AS TEXT), INSTR(installation_date, '/') + 1, -6) >= '8' AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013') OR (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) IN ( '6', '7', '8', '9', '10', '11', '12' ) AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013') |
What away team played at Kardinia Park? | SELECT away_team AS score FROM table_name_63 WHERE venue = "kardinia park" |
What was the final number for the winning manufacturer with Mercedes-benz, and a circuit of hockenheimring? | SELECT COUNT(round) FROM table_name_18 WHERE winning_manufacturer = "mercedes-benz" AND circuit = "hockenheimring" |
Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed? | SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1 |
On August 2018, which day had the highest number of cancelled flights due to the most serious reasons in Dallas/Fort Worth International? | SELECT T2.FL_DATE FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Dallas/Fort Worth, TX: Dallas/Fort Worth International' AND T2.ORIGIN = 'DFW' AND T2.CANCELLED = 1 AND T2.CANCELLATION_CODE = 'A' GROUP BY T2.FL_DATE ORDER BY COUNT(T2.FL_DATE) DESC LIMIT 1 |
What was the earliest year that an event held in Berlin, Germany had a 100 m hurdles event? | SELECT MIN(year) FROM table_name_98 WHERE venue = "berlin, germany" AND event = "100 m hurdles" |
How many times did K Goel played as a player only? | SELECT COUNT(T1.Match_Id) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'K Goel' AND T3.Role_Id = 3 |
What is the overall length with a designation of s-8ko? | SELECT length_overall FROM table_name_38 WHERE designation = "s-8ko" |
What is the id of the problem log that is created most recently? | SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1 |
What is the content of TV Channel with serial name "Sky Radio"? | SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio"; |
WHICH ARTISTS SUNG THE SONGS? | SELECT artist_name from song |
What is the NOAA of the higher harmonics that have a Darwin of mn 4? | SELECT noaa FROM table_name_49 WHERE darwin = "mn 4" |
what is the high enrollment of school | Are you asking the highest enrollment number for all schools? | exactly | SELECT max ( enrollment ) from school |
What did the away team score when they visited south melbourne? | SELECT away_team AS score FROM table_name_26 WHERE home_team = "south melbourne" |
What type of institution is San Diego Christian college? | SELECT type FROM table_2562113_1 WHERE institution = "San Diego Christian College" |
Identify the number of movies that starred Nick Stallone. | SELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id AND T2.first_name = 'NICK' AND T2.last_name = 'STALLONE' |
What is the name of the oldest artist? | SELECT name FROM artist ORDER BY AGE DESC LIMIT 1 |
What is the average adolescent fertility rate of the country whose Alpha2Code is 1A over the years this indicator was calculated. | SELECT AVG(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName LIKE 'adolescent fertility rate%' |
How many orders in total are made by customers in Germany? | SELECT COUNT(T2.c_custkey) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY' |
Name the average ERP W and call sign of w237br | SELECT AVG(erp_w) FROM table_name_36 WHERE call_sign = "w237br" |
What is the full name of the employee who gave the highest amount of fine of all time? | SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T3.fine) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id GROUP BY T1.first_name, T1.last_name ORDER BY SUM(T3.fine) DESC LIMIT 1 ) t |
In what Week is the Rome Tournament? | SELECT week FROM table_name_70 WHERE tournament = "rome" |
Who was the winning team for round 3? | SELECT winning_team FROM table_name_1 WHERE round = "3" |
In what district was the incumbent Edwin Gray? | SELECT district FROM table_2668401_17 WHERE incumbent = "Edwin Gray" |
List every book that Ursola Purdy has ordered. | SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Ursola' AND T4.last_name = 'Purdy' |
What are the names of parties that have both delegates on "Appropriations" committee and | SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Economic Matters" |
What is the sum of the number of wins for teams with more than 0 draws? | SELECT SUM(wins) FROM table_name_51 WHERE draws > 0 |
Show all track names that have had no races. | SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race) |
Provide the zip codes and CBSA officers of the postal point in Oxford. | SELECT T2.zip_code, T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'Oxford' |
If the date of birth is 1961-08-09 9 august 1961, what is the start date of (first) term? | SELECT start_date_of__first__term FROM table_25182437_1 WHERE date_of_birth = "1961-08-09 9 August 1961" |
Which countries have greater area than that of any country in Europe? | SELECT Name FROM country WHERE SurfaceArea > (SELECT min(SurfaceArea) FROM country WHERE Continent = "Europe") |
Name the score for march 29, 1997 | SELECT score FROM table_20745759_1 WHERE date = "March 29, 1997" |
What are the ids, names, and descriptions for all documents? | SELECT document_id , document_name , document_description FROM Documents |
What is the Site when the date is 11/11/1950? | SELECT site FROM table_name_37 WHERE date = "11/11/1950" |
Show me the name of artist with artist id 3? | SELECT Name FROM ARTIST where ArtistId = 3 |
What is the Year for fleet number 5000? | SELECT year_made FROM table_name_98 WHERE fleet_number_s_ = "5000" |
How many continents speak Chinese? | SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese" |
What are the revenue of manufacture name Hewlett-Packard? | SELECT revenue from manufacturers where name = "Hewlett-Packard" |
What team did they play when the series was 1-1? | SELECT team FROM table_name_51 WHERE series = "1-1" |
How many people have won at least 3 awards? | SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.result = 'Winner' GROUP BY T1.person_id HAVING COUNT(T2.award_id) >= 3 |
Which of the Rounds has an Entrant of automobiles Talbot-Darracq, and Pierre Levegh as the driver? | SELECT rounds FROM table_name_72 WHERE entrant = "automobiles talbot-darracq" AND driver = "pierre levegh" |
what is the capacity when the acceleration 1-100km/h is 11.1 s? | SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = "11.1 s" |
Hello, how are you! Can you provide me with a list of all of the email addresses in this database? | select email_address from people |
What are the precise locations of the cities with an area code of 787? | SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = '787' GROUP BY T2.latitude, T2.longitude |
What week did the Seahawks play at los angeles memorial coliseum? | SELECT MIN(week) FROM table_13258876_2 WHERE game_site = "Los Angeles Memorial Coliseum" |
What is Score, when Player is "Deane Beman"? | SELECT score FROM table_name_20 WHERE player = "deane beman" |
List first name and last name of customers that have more than 2 payments. | SELECT T2.first_name , T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) > 2; |
Find the number of rooms with more than 50 capacity for each building. | SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building |
What is the average width and height of the objects in image ID 47? List their object classes as well. | SELECT T2.OBJ_CLASS, AVG(T1.W), AVG(T1.H) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 47 GROUP BY T2.OBJ_CLASS |
How many locations was game 3 played at? | SELECT COUNT(location_attendance) FROM table_23248967_5 WHERE game = 3 |
Name the player who scored the most goals in a single game in the 2007-2008 season of WHL? | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.LEAGUE = 'WHL' ORDER BY T1.G DESC LIMIT 1 |
What is the Place of the Player with a To par of +2 and a Score of 70-72-73=215? | SELECT place FROM table_name_22 WHERE to_par = "+2" AND score = 70 - 72 - 73 = 215 |
What is the average capacity of the rooms? | SELECT avg ( capacity ) FROM classroom |
How many items were listed under world rank under the nation of Nigeria? | SELECT COUNT(world_rank) FROM table_2248991_2 WHERE nation = "Nigeria" |
Which country is the most award-winning player from? | SELECT T1.birthCountry FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthCountry ORDER BY COUNT(T2.award) DESC LIMIT 1 |
Which Location Attendance has a Date of april 15? | SELECT location_attendance FROM table_name_52 WHERE date = "april 15" |
What is the number of Silver medals with 2 Bronze and 0 Gold? | SELECT COUNT(silver) FROM table_name_78 WHERE bronze = 2 AND gold < 0 |
What is the most points earlier than 1953 with a Ferrari 375/50 chassis? | SELECT MAX(points) FROM table_name_22 WHERE year < 1953 AND chassis = "ferrari 375/50" |
Which Surface has a Tournament of olbia? | SELECT surface FROM table_name_62 WHERE tournament = "olbia" |
What is Date, when Score is "0-2", and when Opponents is "Bayer Leverkusen"? | SELECT date FROM table_name_4 WHERE score = "0-2" AND opponents = "bayer leverkusen" |
What is the smallest border's length, and what form of government do the two nations bordering it have? | SELECT T1.Government, T3.Government FROM politics AS T1 INNER JOIN borders AS T2 ON T1.Country = T2.Country1 INNER JOIN politics AS T3 ON T3.Country = T2.Country2 ORDER BY T2.Length ASC LIMIT 1 |
Name the attendance for atlanta braves opponent for september 9 | SELECT AVG(attendance) FROM table_name_26 WHERE opponent = "atlanta braves" AND date = "september 9" |
Which aircraft did not win any match? | What information do you want about the aircrafts? Their names, their ids, or all their information? | Their names. | SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN ( SELECT Winning_Aircraft FROM MATCH ) |
What is the name of the club with 22 points? | SELECT club FROM table_name_2 WHERE points = "22" |
How many high risks violations did the Tiramisu Kitchen violate? | SELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'High Risk' |
what is the tournament when the outcome is winner and the opponents is kerry-anne guse corina morariu? | SELECT tournament FROM table_name_39 WHERE outcome = "winner" AND opponents = "kerry-anne guse corina morariu" |
How long does it take for the business to receive the item it has purchased? Who is the vendor for business number 1496? | SELECT T1.AverageLeadTime, T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 USING (businessentityid) WHERE T2.BusinessEntityID = 1496 GROUP BY T1.AverageLeadTime, T2.Name |
Find the names of stadiums that the most swimmers have been to. | SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1 |
What is the title of the paper published in 1995 and whose author included Thomas Wiegand? | SELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Thomas Wiegand' AND T2.Year = 1995 |
For the flight with the tail number 'N702SK', which air carrier does it belong to? | SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.TAIL_NUM = 'N702SK' GROUP BY T2.Description |
Find the captain rank that has some captains in both Cutter and Armed schooner classes. | SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner' |
How many released albums are there? | SELECT count ( * ) from albums |
What period has 0.25% as the other mozilla? | SELECT period FROM table_name_66 WHERE other_mozilla = "0.25%" |
What is the race name in the Monza circuit? | SELECT race_name FROM table_1140116_5 WHERE circuit = "Monza" |
When are all dates with a score of 205 (–8) in Australia? | SELECT dates FROM table_15315816_1 WHERE score = "205 (–8)" AND country = "Australia" |
Who is the author of Episode 38 (16)? | SELECT written_by FROM table_name_2 WHERE episode__number = "38 (16)" |
How many events were participated by the users at longitude of "-156"? | SELECT COUNT(event_id) FROM events WHERE longitude = -156 |
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 |
Among the low quality product, which product has the highest line total? List the product name and its line total? | SELECT T1.Name, T2.LineTotal FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE Class = 'L' ORDER BY OrderQty * UnitPrice DESC LIMIT 1 |
What is the highest Played that's for the Team of Cerro Porteño, with a Position that's larger than 1? | SELECT MAX(played) FROM table_name_59 WHERE team = "cerro porteño" AND position > 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.