sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What are the last name of staff id 1? | Do you mean customer, not staff? | yes | SELECT last_name FROM customer WHERE customer_id = 1 |
how many album id | SELECT count ( distinct album_id ) from tracks |
How many live births were there in 2006 in South Yorkshire (met county)? | SELECT live_births_2006 FROM table_12251936_1 WHERE county = "South Yorkshire (Met county)" |
What are the names of all tracks that are on the Movies playlist but not in the music playlist? | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' |
How many copies per particle are there for the base pair that is size 1059? | SELECT COUNT(copies_per_particle) FROM table_140968_1 WHERE size___s_base_pair__ = 1059 |
Which college have both players with position midfielder and players with position defender? | SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender" |
Calculate the total quantity ordered for 18th Century Vintage Horse Carriage and the average price. | SELECT SUM(T2.quantityOrdered) , SUM(T2.quantityOrdered * T2.priceEach) / SUM(T2.quantityOrdered) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode WHERE T1.productName = '18th Century Vintage Horse Carriage' |
List the name of the school with the smallest enrollment. | SELECT school_name FROM school ORDER BY enrollment LIMIT 1 |
Which method has the record of 11-1? | SELECT method FROM table_name_4 WHERE record = "11-1" |
How many Summer games were held in Stockholm? | SELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Stockholm' AND T3.season = 'Summer' |
What are the different continents and the total popuation and average life expectancy corresponding to each, for continents that have an average life expectancy less than 72? | SELECT sum(Population) , avg(LifeExpectancy) , Continent FROM country GROUP BY Continent HAVING avg(LifeExpectancy) < 72 |
What candidates are from mississippi 6? | SELECT candidates FROM table_1342233_24 WHERE district = "Mississippi 6" |
And what are their student numbers? | SELECT T2.STU_NUM FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting' |
In the matches where the winning margin is less than fifty, how many teams won by wicket? | SELECT COUNT(T2.Win_Id) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_Type = 'wickets' AND T1.Win_Margin < 50 |
What was the away teams score at Glenferrie Oval? | SELECT away_team AS score FROM table_name_92 WHERE venue = "glenferrie oval" |
what is the method when the time is 0:51? | SELECT method FROM table_name_5 WHERE time = "0:51" |
Which teams had more than 3 eliminations? | SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3 |
Which vocal type has the band mate with first name "Marianne" played the most? | SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Marianne" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1 |
find the ten customers with the most total orders | SELECT * FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT ( * ) DESC LIMIT 10 |
On the date november 24-december 6 what's the winner when the country is united states? | SELECT winner FROM table_name_35 WHERE country = "united states" AND date = "november 24-december 6" |
Calculate the difference in the average number of low-priority orders shipped by truck in each month of 1995 and 1996. | SELECT (CAST(SUM(IIF(STRFTIME('%Y', T2.l_shipdate) = 1995, 1, 0)) AS REAL) / 12) - (CAST(SUM(IIF(STRFTIME('%Y', T2.l_shipdate) = 1996, 1, 0)) AS REAL) / 12) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderpriority = '5-LOW' AND T2.l_shipmode = 'TRUCK' |
Return the codes of countries that do not speak English and do not have Republics for governments. | SELECT Code FROM country WHERE GovernmentForm != "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" |
Which player went to the college Southern California? | SELECT player FROM table_11677691_4 WHERE college = "Southern California" |
Who went there? | SELECT name FROM member where college_id = 4 |
What is the date (to) associated wiht a traction type of electric and the Yarmouth Light and Power Company system? | SELECT date__to_ FROM table_name_38 WHERE traction_type = "electric" AND name_of_system = "yarmouth light and power company" |
Name the mens singles for 1944/1945 | SELECT mens_singles FROM table_12193259_1 WHERE season = "1944/1945" |
Among the American casts, how many were uncredited on episode ID tt0629228? | SELECT COUNT(T1.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629228' AND T1.category = 'Cast' AND T1.credited = 'false' AND T2.birth_country = 'USA' |
Find the appelations that produce wines after the year of 2008 but not in Central Coast area. | SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast" |
What was the margin of victory in the tournament with a winning score of −3 (74-68-72-71=285)? | SELECT margin_of_victory FROM table_name_60 WHERE winning_score = −3(74 - 68 - 72 - 71 = 285) |
How much time do businesses in El Mirage City, AZ State operate in average daily? | SELECT SUM(T2.closing_time - T2.opening_time) FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'El Mirage' AND T1.state = 'AZ' |
Find the distinct last names of all the students who have president votes and whose advisor is 8741. | SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = "8741" |
What is the date for the flag of Norway? | SELECT date FROM table_name_73 WHERE flag = "norway" |
What companies are in the banking or retailing industry? | Do you want their company id or name? | What are the names of the companies in the banking or retail industries? | SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing" |
How many Scottish League One games took place on the day that "Pro Vercelli" and "Pescara"had a 5-2 game? | SELECT COUNT(T1.Date) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish League One' AND T1.Date = ( SELECT Date FROM matchs WHERE FTHG = 5 AND FTAG = 2 AND HomeTeam = 'Pro Vercelli' AND AwayTeam = 'Pescara' ) |
Which years have a Decile smaller than 6, an Area of te kuiti, and an Authority of state integrated? | SELECT years FROM table_name_41 WHERE decile < 6 AND area = "te kuiti" AND authority = "state integrated" |
What are the headquarters with at least two companies in the banking industry? | SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING count(*) >= 2 |
Who finished in third place when the winner was Karina Bacchi? | SELECT third_place FROM table_25214321_1 WHERE winner = "Karina Bacchi" |
How many languages have le roman de renart as the original title? | SELECT COUNT(languages) FROM table_22073745_1 WHERE original_title = "Le Roman de Renart" |
How many teams lost at the sydney football stadium, sydney (11)? | SELECT COUNT(losingteam) FROM table_11236195_5 WHERE location = "Sydney Football Stadium, Sydney (11)" |
Which player had a conference of PAC-10 and position of G? | SELECT player FROM table_name_56 WHERE conf = "pac-10" AND pos = "g" |
What are the ids and names of the web accelerators that are compatible with two or more browsers? | SELECT T1.id, T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 |
What is the greatest elevation of all of those airports? | SELECT max ( elevation ) FROM airports |
What city does the employee who helps the customer with postal code 70174 live in? | SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = "70174" |
What is the high lap total for mika salo with a grid greater than 17? | SELECT MAX(laps) FROM table_name_66 WHERE driver = "mika salo" AND grid > 17 |
Ok thank you.Can you please show me the music festivals with counts more than 1? | Did you mean to ask for the categories of the music festivals with counts more than 1? | Yes. | SELECT Category FROM music_festival GROUP BY Category HAVING COUNT ( * ) > 1 |
Which Proto-Oceanic has a Proto-Polynesian of *lima? | SELECT proto_oceanic FROM table_name_48 WHERE proto_polynesian = "*lima" |
How many actively running Yelp businesses are there located in "Phoenix" city? | SELECT COUNT(business_id) FROM Business WHERE active = 'true' AND city = 'Phoenix' |
which round is u.s. open cup division semifinals | SELECT us_open_cup FROM table_1046170_5 WHERE playoffs = "division Semifinals" |
What is Weekly Rank of TV series with Episode "A Love of a Lifetime"? | SELECT Weekly_Rank FROM TV_series WHERE Episode = "A Love of a Lifetime"; |
State the full height and width for menu called "El Fuerte Del Palmar". | SELECT T1.full_height, T1.full_width FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.name = 'El Fuerte Del Palmar' |
What country does the goaltender come from? | SELECT nationality FROM table_1213511_6 WHERE position = "Goaltender" |
List the products whose supplier is Pavlova, Ltd. Please include the product ID and re-order level. | SELECT T1.ProductName, T1.ProductID, T1.ReorderLevel FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Pavlova, Ltd.' |
Which publisher has published the most number of Action games? | SELECT T.publisher_name FROM ( SELECT T4.publisher_name, COUNT(DISTINCT T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id INNER JOIN game_publisher AS T3 ON T2.id = T3.game_id INNER JOIN publisher AS T4 ON T3.publisher_id = T4.id WHERE T1.genre_name = 'Action' GROUP BY T4.publisher_name ORDER BY COUNT(DISTINCT T2.id) DESC LIMIT 1 ) t |
What are the names of the wrestlers, ordered descending by days held? | SELECT Name FROM wrestler ORDER BY Days_held DESC |
What event was the opponent Karl Knothe and had a submission (rear naked choke)? | SELECT event FROM table_name_16 WHERE method = "submission (rear naked choke)" AND opponent = "karl knothe" |
List all info about all people. | SELECT * FROM people |
What is the Championship Game when the Final Four is 1 and the conference is American South? | SELECT championship_game FROM table_name_29 WHERE final_four = "1" AND conference = "american south" |
what is the claim that incurred most number of settlements? | what do you want to know about this claim? | what is the claim id? | SELECT T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count ( * ) DESC LIMIT 1 |
Find the average price of all product clothes. | SELECT avg(product_price) FROM products WHERE product_type_code = 'Clothes' |
What is the Date for the Away team University? | SELECT date FROM table_name_73 WHERE away_team = "university" |
Which events have the number of notes between one and three? List the event id and the property id. | SELECT T1.Customer_Event_ID , T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING count(*) BETWEEN 1 AND 3 |
How many elections in this table? | SELECT count ( * ) FROM election |
Which project has the highest hours on the list? | SELECT name FROM projects ORDER BY hours DESC LIMIT 1 |
list all the names of the sports available | SELECT distinct sportname FROM Sportsinfo |
Name the june when it has july of 84 °f / 28.9 °c | SELECT jun FROM table_name_28 WHERE jul = "84 °f / 28.9 °c" |
How many teachers does the student named CHRISSY NABOZNY have? | SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY" |
Can you list the IDs and middle names of all students who have no more than 2 enrollments? | SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT ( * ) < = 2 |
List down the actor IDs of film titled "BOUND CHEAPER". | SELECT T2.actor_id FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'BOUND CHEAPER' |
When has a Score of 0–0, and a Away team of scunthorpe united? | SELECT date FROM table_name_65 WHERE score = "0–0" AND away_team = "scunthorpe united" |
Which team plays at Lake Oval? | SELECT home_team FROM table_name_39 WHERE venue = "lake oval" |
What is the name of the conductor who has worked the greatest number of years? | SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1 |
What opponent has 8-10 as the record? | SELECT opponent FROM table_name_76 WHERE record = "8-10" |
What is the school with the nickname Tornadoes Lady Tornadoes? | SELECT school FROM table_name_65 WHERE nickname_s_ = "tornadoes lady tornadoes" |
What school/club had pick 33? | SELECT school_club_team FROM table_name_31 WHERE pick = 33 |
If the market name is Xperia U, what is the weight? | SELECT weight FROM table WHERE market_name = "Xperia U" |
What city is that building in? | SELECT City FROM buildings ORDER BY Height DESC LIMIT 1 |
State the name of the category which has the most number of films. | SELECT T.name FROM ( SELECT T2.name, COUNT(T1.film_id) AS num FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T2.name ) AS T ORDER BY T.num DESC LIMIT 1 |
What is the score March 27? | SELECT score FROM table_name_55 WHERE date = "march 27" |
cool can you tell me what that roller coaster's height is too? | SELECT height FROM roller_coaster order BY speed desc limit 1 |
What is the most common problem ID reported by all staff? | SELECT problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id GROUP BY problem_id ORDER BY count ( * ) DESC LIMIT 1 |
On what Surface was the match against Malek Jaziri played? | SELECT surface FROM table_name_78 WHERE opponent = "malek jaziri" |
Show me the names of players who received salary in both 2005 and 2007? | SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 or T1.year = 2007 |
how many credit cards there | SELECT count ( * ) from Customers_Cards where card_type_code = "Credit" |
Please list the names of all the products ordered in order no. 10248. | SELECT T1.ProductName FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10248 |
Who has the status of jr synonym of protosialis casca? | SELECT novelty FROM table_name_75 WHERE status = "jr synonym of protosialis casca" |
What is the station name for the id's 1 and 2 ? | SELECT name, id FROM station where id = 1 or id = 2 |
who is get the high salary? | Do you mean the id of the player who gets the highest salary? | Yes. | SELECT player_id FROM salary order by salary desc limit 1 |
Who is the stunt coordinator in episode 3? | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 3 AND T2.role = 'stunt coordinator' |
What are the names of perpetrators? | SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID |
What is the Regionalliga Sud for 1995-96? | SELECT regionalliga_süd FROM table_name_13 WHERE season = "1995-96" |
Name the district for carolyn mccarthy | SELECT district FROM table_1341423_32 WHERE incumbent = "Carolyn McCarthy" |
Which episode number visited India? | SELECT episode_no FROM table_name_56 WHERE countries_visited = "india" |
What was the highest crowd at Windy Hill? | SELECT MAX(crowd) FROM table_name_56 WHERE venue = "windy hill" |
How many touchdowns were made by the person with 7 extra points? | SELECT COUNT(touchdowns__5_points_) FROM table_14342210_14 WHERE extra_points_1_point = 7 |
What was the round when nueza silva played against greece? | SELECT round FROM table_name_31 WHERE against = "greece" |
Find the total number of students living in the male dorm (with gender M). | SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M' |
Give me the average prices of wines that are produced by appelations in Sonoma County. | SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma" |
What average Year has Losses 4, and Wins less than 18, and Draws greater than 1? | SELECT AVG(year) FROM table_name_24 WHERE loses = 4 AND wins < 18 AND draws > 1 |
Which country has a score of 72 by Andrew Brooks? | SELECT country FROM table_name_41 WHERE score = 72 AND player = "andrew brooks" |
How many times longer is the longest river in Tajikistan than the shortest river? | SELECT MAX(T2.Length) / MIN(T2.Length) FROM located AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name WHERE T1.Country = 'TJ' |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.