interaction_utterance
sequencelengths 0
6
| interaction_query
sequencelengths 0
6
| final_utterance
stringlengths 19
224
| final_query
stringlengths 22
577
| db_id
stringclasses 140
values |
---|---|---|---|---|
[
"List all the account owner names.",
"Is there an owner with the name that has 'ee' in it?",
"What is the savings balance for that owner?",
"How about the checking balance?"
] | [
"SELECT name FROM accounts",
"SELECT name FROM accounts where name LIKE '%ee%'",
"SELECT T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'",
"SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'"
] | What is the checking balance of the account whose owner’s name contains the substring ‘ee’? | SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%' | small_bank_1 |
[
"Is there an owner named Brown?",
"What is his checking balance?",
"What is his savings balance?",
"Please show both at the same time."
] | [
"SELECT * FROM accounts where name = \"Brown\"",
"SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name = 'Brown'",
"SELECT T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name = 'Brown'",
"SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'"
] | Find the checking balance and saving balance in the Brown’s account. | SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown' | small_bank_1 |
[
"What is the average saving balance?",
"Who have savings account balances below that?",
"What are their checking account balances?",
"Who of these users have checking account balances above the average checking balance of all users?"
] | [
"SELECT avg(balance) FROM savings",
"SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM savings)",
"SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.custid in (SELECT T1.custid FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM savings))",
"SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM savings)"
] | Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance. | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM savings) | small_bank_1 |
[
"What is the average savings balance?",
"How many people have savings account balances over it?",
"What are their names?",
"What are their checking account balances?"
] | [
"SELECT avg(balance) FROM savings",
"SELECT count(*) FROM savings where balance > (SELECT avg(balance) FROM savings)",
"SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM savings)",
"SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM savings))"
] | Find the checking balance of the accounts whose savings balance is higher than the average savings balance. | SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM savings)) | small_bank_1 |
[
"What is the name of the user that has the lowest checking balance?",
"the lowest saving balance?",
"how about the lowest total sum of checking and saving balance?"
] | [
"SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid ORDER BY T2.balance limit 1",
"SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance limit 1",
"SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance LIMIT 1"
] | Find the name of account that has the lowest total checking and saving balance. | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance LIMIT 1 | small_bank_1 |
[
"How many accounts have savings balances greater than the average savings balance?",
"What are their names?",
"What are their checking account balances?",
"How about both their total checking and savings balances."
] | [
"SELECT count(*) FROM savings where balance > (SELECT avg(balance) FROM savings)",
"SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM savings)",
"SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT avg(balance) FROM savings)",
"SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT avg(balance) FROM savings)"
] | Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance. | SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT avg(balance) FROM savings) | small_bank_1 |
[
"What are all the savings balances?",
"What is the lowest one?",
"What is the name on the account has the lowest one?",
"Also provide the checking balance."
] | [
"SELECT balance FROM savings",
"SELECT min(balance) FROM savings",
"SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance LIMIT 1",
"SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1"
] | Find the name and checking balance of the account with the lowest savings balance. | SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1 | small_bank_1 |
[
"Show all the names for each account.",
"What are the unique set of names?",
"How many savings accounts under each of these names?",
"How about checking accounts?"
] | [
"SELECT name FROM accounts",
"SELECT DISTINCT name FROM accounts",
"SELECT count(*), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name",
"SELECT count(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name"
] | Find the number of checking accounts for each account name. | SELECT count(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name | small_bank_1 |
[
"What are the names of all the accounts?",
"Show the savings balances for all accounts.",
"Now show me the total by account name."
] | [
"SELECT name FROM accounts",
"SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid",
"SELECT sum(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name"
] | Find the total saving balance for each account name. | SELECT sum(T2.balance) , T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name | small_bank_1 |
[
"What is the average checking balance?",
"What is the account information for those have greater checking balances than that?",
"How about for lower checking balances?",
"What are their account names?"
] | [
"SELECT avg(balance) FROM checking",
"SELECT * FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking)",
"SELECT * FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM checking)",
"SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM checking)"
] | Find the name of accounts whose checking balance is below the average checking balance. | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM checking) | small_bank_1 |
[
"Whose checking balance is the highest?",
"What is it?",
"what is her saving balance?"
] | [
"SELECT name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid ORDER BY T2.balance desc limit 1",
"SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid ORDER BY T2.balance desc limit 1",
"SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1"
] | Find the saving balance of the account with the highest checking balance. | SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1 | small_bank_1 |
[
"What are the total checking and saving balances for all accounts?",
"Show me the the balances FROM greatest to least?",
"How about FROM least to greatest?"
] | [
"SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid",
"SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance desc",
"SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance"
] | Find the total checking and saving balance of all accounts sorted by the total balance in ascending order. | SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance | small_bank_1 |
[
"What is the average saving balance?",
"how about the lowest saving balance?",
"What is the name of the user that has this?",
"Also show his checking balance too."
] | [
"SELECT avg(balance) FROM savings",
"SELECT balance FROM savings order by balance limit 1",
"SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance LIMIT 1",
"SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1"
] | Find the name and checking balance of the account with the lowest saving balance. | SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1 | small_bank_1 |
[
"How many accounts are there in the bank?",
"What are the names for each?",
"Include the checking and saving balances for each."
] | [
"SELECT count(*) FROM accounts",
"SELECT name FROM accounts",
"SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid"
] | Find the name, checking balance and saving balance of all accounts in the bank. | SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid | small_bank_1 |
[
"Show me the names, checking balances, and savings balance for all accounts?",
"Also provide their total checking and saving balances?",
"Just show names, checking balance, saving balance but sort them by savings account balance.",
"Actually, sort them by the total checking and savings balance FROM greatest to least."
] | [
"SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid",
"SELECT T2.balance + T3.balance, T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid",
"SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance",
"SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC"
] | Find the name, checking balance and savings balance of all accounts in the bank sorted by their total checking and savings balance in descending order. | SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC | small_bank_1 |
[
"How many accounts have higher savings balances than their checking balances?",
"How about higher checking balances than their saving balances?",
"Show me the checking balances and saving balances for each of these accounts.",
"Actually, just show me the corresponding names."
] | [
"SELECT count(*) FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > T2.balance",
"SELECT count(*) FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance",
"SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance",
"SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance"
] | Find the name of accounts whose checking balance is higher than corresponding saving balance. | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance | small_bank_1 |
[
"What are the name, checking, and saving balances for all accounts?",
"Show me the total checking and savings balance of the accounts!",
"Show me only the accounts that have a lower savings balance than their checking balance?",
"Show just the name and total checking and savings balance."
] | [
"SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid",
"SELECT T2.balance , T3.balance , T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid",
"SELECT T2.balance , T3.balance , T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid where T3.balance < T2.balance",
"SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance"
] | Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance. | SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance | small_bank_1 |
[
"Find the names of all artists whose names end with \"b\".",
"How about artists whose names contain \"b\"?",
"Now do the same for \"a\"."
] | [
"SELECT Name FROM ARTIST WHERE Name LIKE \"%b\"",
"SELECT Name FROM ARTIST WHERE Name LIKE \"%b%\"",
"SELECT Name FROM ARTIST WHERE Name LIKE \"%a%\""
] | Find the names of all artists that have "a" in their names. | SELECT Name FROM ARTIST WHERE Name LIKE "%a%" | chinook_1 |
[
"Find the ids of all albums of \"AC/DC\".",
"Show me the titles of those albums."
] | [
"SELECT AlbumId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = \"AC/DC\"",
"SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = \"AC/DC\""
] | Find the title of all the albums of the artist "AC/DC". | SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC" | chinook_1 |
[
"Show me all the albums from \"Metallica\".",
"How many are there?"
] | [
"SELECT * FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = \"Metallica\"",
"SELECT Count(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = \"Metallica\""
] | How many albums does the artist "Metallica" have? | SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica" | chinook_1 |
[
"Is there an album called \"Balls to the Wall\"?",
"Who made it?"
] | [
"SELECT * FROM ALBUM WHERE Title = \"Balls to the Wall\"",
"SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = \"Balls to the Wall\""
] | Which artist does the album "Balls to the Wall" belong to? | SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = "Balls to the Wall" | chinook_1 |
[
"Which artist has the least albums?",
"How about the most albums?"
] | [
"SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) ASC LIMIT 1",
"SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1"
] | Which artist has the most albums? | SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1 | chinook_1 |
[
"Find the names of all the albums that contain the word \"you\".",
"Oops, I meant tracks not albums."
] | [
"SELECT Title FROM ALBUM WHERE title LIKE '%you%'",
"SELECT Name FROM TRACK WHERE Name LIKE '%you%'"
] | Find the names of all the tracks that contain the word "you". | SELECT Name FROM TRACK WHERE Name LIKE '%you%' | chinook_1 |
[
"What is the longest track?",
"The shortest?",
"Show me both."
] | [
"SELECT max(Milliseconds) from TRACK",
"SELECT min(Milliseconds) from TRACK",
"SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK"
] | What are the durations of the longest and the shortest tracks in milliseconds? | SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK | chinook_1 |
[
"Show me the names and ids of each album.",
"Show me the number of tracks each album has as well."
] | [
"SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID",
"SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID"
] | Show the album names, ids and the number of tracks for each album. | SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID | chinook_1 |
[
"Show me the 10 most common genres in all tracks.",
"Show me the 10 least common genres.",
"Show me the most common one."
] | [
"SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 10",
"SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) ASC LIMIT 10",
"SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1"
] | What is the name of the most common genre in all tracks? | SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1 | chinook_1 |
[
"Show me all the media types in tracks.",
"What is the most common one?",
"How about the least common one?"
] | [
"SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId",
"SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) DESC LIMIT 1",
"SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1"
] | What is the least common media type in all tracks? | SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1 | chinook_1 |
[
"Show me all the tracks with unit price bigger than 1.",
"Show me their album names and ids"
] | [
"SELECT Name FROM TRACK WHERE UnitPrice > 1",
"SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID"
] | Show the album names and ids for albums that contain tracks with unit price bigger than 1. | SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID | chinook_1 |
[
"Show me tracks that belong to rock genre.",
"How many are there?"
] | [
"SELECT T2.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Rock\"",
"SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Rock\""
] | How many tracks belong to rock genre? | SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock" | chinook_1 |
[
"What is the most expensive track with Jazz genre?",
"Show me the average unit price of all Jazz genre tracks."
] | [
"SELECT max(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Jazz\"",
"SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Jazz\""
] | What is the average unit price of tracks that belong to Jazz genre? | SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Jazz" | chinook_1 |
[
"Show me first name of customers with emails that contain \"gmail.com\".",
"How many are there?"
] | [
"SELECT FirstName FROM CUSTOMER WHERE Email LIKE \"%gmail.com%\"",
"SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE \"%gmail.com%\""
] | How many customers have email that contains "gmail.com"? | SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%" | chinook_1 |
[
"Show me the customer with first name Leonie.",
"What is the first and last name of the employee assigned to this customer?"
] | [
"SELECT * FROM CUSTOMER WHERE FirstName = \"Leonie\"",
"SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = \"Leonie\""
] | What is the first name and last name employee helps the customer with first name Leonie? | SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = "Leonie" | chinook_1 |
[
"Find me a customer with postal code 70174.",
"Which employee was assigned to this customer? Give me the first and last names.",
"Which city does he/she live?"
] | [
"SELECT * FROM CUSTOMER WHERE PostalCode = 70174",
"SELECT T2.FirstName, T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = \"70174\"",
"SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = \"70174\""
] | 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" | chinook_1 |
[
"Find all invoice dates of customer named Astrid.",
"Hm, find them for Astrids with last name Gruber."
] | [
"SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = \"Astrid\"",
"SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = \"Astrid\" AND LastName = \"Gruber\""
] | Find all invoice dates corresponding to customers with first name Astrid and last name Gruber. | SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" | chinook_1 |
[
"Show me first names of all customers that have invoice totals less than 20.",
"I meant last names.",
"Oh I meant invoice totals larger than 20, not less than."
] | [
"SELECT FirstName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total < 20",
"SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total < 20",
"SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20"
] | Find all the customer last names that do not have invoice totals larger than 20. | SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20 | chinook_1 |
[
"Find the first names of all customers that live in Brazil",
"Among them, find ones who have an invoice."
] | [
"SELECT DISTINCT FirstName FROM CUSTOMER WHERE country = \"Brazil\"",
"SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = \"Brazil\""
] | Find the first names of all customers that live in Brazil and have an invoice. | SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil" | chinook_1 |
[
"Find the address of all customers who live in Germany.",
"Among those, find the ones who have invoice."
] | [
"SELECT DISTINCT Address FROM CUSTOMER WHERE country = \"Germany\"",
"SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = \"Germany\""
] | Find the address of all customers that live in Germany and have invoice. | SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Germany" | chinook_1 |
[
"Show me the tracks that are in AAC audio file media type",
"How many are there?"
] | [
"SELECT * FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = \"AAC audio file\"",
"SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = \"AAC audio file\""
] | How many tracks are in the AAC audio file media type? | SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = "AAC audio file" | chinook_1 |
[
"What is the average duration of tracks that belong to Latin genre?",
"How about Pop?",
"Show me the average for both genres."
] | [
"SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Latin\"",
"SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Pop\"",
"SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Latin\" OR T1.Name = \"Pop\""
] | What is the average duration in milliseconds of tracks that belong to Latin or Pop genre? | SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Latin" OR T1.Name = "Pop" | chinook_1 |
[
"Show the first names and ids of employees serving 10 customers.",
"Show me those serving at least 10 customers."
] | [
"SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) = 10",
"SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10"
] | Please show the employee first names and ids of employees who serve at least 10 customers. | SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10 | chinook_1 |
[
"Show me first names for employees serving 20 customers.",
"Show me their last names.",
"Show me the same for employees serving no more than 20 customers."
] | [
"SELECT T1.FirstName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) = 20",
"SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) = 20",
"SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20"
] | Please show the employee last names that serves no more than 20 customers. | SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20 | chinook_1 |
[
"Show me all artists with at least 3 albums.",
"Show me their names and ids.",
"Sort them in alphabetical order."
] | [
"SELECT * FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3",
"SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name",
"SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name"
] | Please list the name and id of all artists that have at least 3 albums in alphabetical order. | SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name | chinook_1 |
[
"How many artists don't have any albums?",
"Find me their names."
] | [
"SELECT Count(*) FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId",
"SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId"
] | Find the names of artists that do not have any albums. | SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId | chinook_1 |
[
"What is the max unit price of rock tracks?",
"What is the average?"
] | [
"SELECT max(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Rock\"",
"SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Rock\""
] | What is the average unit price of rock tracks? | SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock" | chinook_1 |
[
"How long is the longest pop track?",
"How about the shortest one?",
"Show me durations for both of those pop tracks."
] | [
"SELECT max(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Pop\"",
"SELECT min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Pop\"",
"SELECT max(Milliseconds) , min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Pop\""
] | What are the duration of the longest and shortest pop tracks in milliseconds? | SELECT max(Milliseconds) , min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop" | chinook_1 |
[
"Show me the names of artists with no album.",
"How many are there?"
] | [
"SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId",
"SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM)"
] | How many artists do not have any album? | SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM) | chinook_1 |
[
"Show me the names of all entrepreneurs.",
"Whose investor is not Rachel Elnaugh?"
] | [
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != \"Rachel Elnaugh\""
] | What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"? | SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != "Rachel Elnaugh" | entrepreneur |
[
"Show me the names of all people.",
"Who has the shortest height?",
"What is this people's weight?"
] | [
"SELECT Name FROM people",
"SELECT Name FROM people ORDER BY Height ASC LIMIT 1",
"SELECT Weight FROM people ORDER BY Height ASC LIMIT 1"
] | What is the weight of the shortest person? | SELECT Weight FROM people ORDER BY Height ASC LIMIT 1 | entrepreneur |
[
"Show me the names of all entrepreneurs.",
"Who has the greatest weight?"
] | [
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1"
] | What is the name of the entrepreneur with the greatest weight? | SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1 | entrepreneur |
[
"Show me the names of all entrepreneurs.",
"Show me those with height taller than 1.85.",
"What is the total money requested by them?"
] | [
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85",
"SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85"
] | What is the total money requested by entrepreneurs with height more than 1.85? | SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85 | entrepreneur |
[
"Show me the names of all entrepreneurs.",
"Whose investor is Simon Woodroffe or Peter Jones?",
"Show me their dates of birth."
] | [
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = \"Simon Woodroffe\" OR T1.Investor = \"Peter Jones\"",
"SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = \"Simon Woodroffe\" OR T1.Investor = \"Peter Jones\""
] | What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"? | SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" | entrepreneur |
[
"Show me the names of all entrepreneurs.",
"How much money did they each request?",
"Give me the weights of them only, in descending order of money requested."
] | [
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Name,T1.Money_Requested FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC"
] | What are the weights of entrepreneurs in descending order of money requested? | SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC | entrepreneur |
[
"Show me the name of all investors.",
"Who has invested in the most number of entrepreneurs?"
] | [
"SELECT Investor FROM entrepreneur GROUP BY Investor",
"SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1"
] | Who is the investor that has invested in the most number of entrepreneurs? | SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1 | entrepreneur |
[
"Show me the name of all investors.",
"Who have invested in at least two entrepreneurs?"
] | [
"SELECT Investor FROM entrepreneur GROUP BY Investor",
"SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2"
] | Who are the investors that have invested in at least two entrepreneurs? | SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2 | entrepreneur |
[
"Show me the names of all entrepreneurs.",
"What are their companies?",
"List them in descending order of money requested."
] | [
"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Name,T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested"
] | List the names of entrepreneurs and their companies in descending order of money requested? | SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested | entrepreneur |
[
"What are the name of all the people?",
"Show me those who are not entrepreneurs."
] | [
"SELECT Name FROM people",
"SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur)"
] | List the names of people that are not entrepreneurs. | SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur) | entrepreneur |
[
"Show me the name of all investors.",
"Who have been requested more than 140000 by any entrepreneurs?",
"Among them, who have been requested less than 120000 by any entrepreneurs?"
] | [
"SELECT Investor FROM entrepreneur GROUP BY Investor",
"SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000",
"SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000"
] | Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000. | SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000 | entrepreneur |
[
"Tell me everything about the farms.",
"Show me the bulls produced by all the farms.",
"What about the cows?",
"Tell me the maximum and minimum number of cows."
] | [
"SELECT * FROM farm",
"SELECT bulls FROM farm",
"SELECT cows FROM farm",
"SELECT max(Cows) , min(Cows) FROM farm"
] | What are the maximum and minimum number of cows across all farms. | SELECT max(Cows) , min(Cows) FROM farm | farm |
[
"Show me the official names of all the cities.",
"Which of these cities has the largest population?",
"What is its population?",
"Can you only show the official name and status of this city?"
] | [
"SELECT official_name FROM city",
"SELECT official_name FROM city ORDER BY population DESC LIMIT 1",
"SELECT official_name, population FROM city ORDER BY population DESC LIMIT 1",
"SELECT Official_Name , Status FROM city ORDER BY Population DESC LIMIT 1"
] | List the official name and status of the city with the largest population. | SELECT Official_Name , Status FROM city ORDER BY Population DESC LIMIT 1 | farm |
[
"List all the city names.",
"Can you also show me the competition id of these cities?",
"How about the themes of these competitions?",
"Which of these cities hosted more than one competition?"
] | [
"SELECT official_name FROM city",
"SELECT t1.official_name, t2.competition_id FROM city as t1 join farm_competition AS t2 ON t1.city_id = t2.host_city_id",
"SELECT t1.official_name, t2.theme FROM city as t1 join farm_competition AS t2 ON t1.city_id = t2.host_city_id",
"SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1"
] | Show the official names of the cities that have hosted more than one competition. | SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1 | farm |
[
"Show me the names of all cities",
"How many competitions did these cities host?",
"Which of these cities hosted the most competitions?",
"Can you only show me its status?"
] | [
"SELECT official_name FROM city",
"SELECT t1.official_name, count(*) FROM city as t1 join farm_competition AS t2 ON t1.city_id = t2.host_city_id GROUP BY city_id",
"SELECT T1.official_name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1",
"SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1"
] | Show the status of the city that has hosted the greatest number of competitions. | SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1 | farm |
[
"Show me the information for all of the cities.",
"Which of these cities have a population greater than 1000?",
"Show me all the years when a competition was held in these cities.",
"What about the themes of these competitions?"
] | [
"SELECT * FROM city",
"SELECT * FROM city WHERE population > 1000",
"SELECT t2.year FROM city AS t1 JOIN farm_competition AS t2 ON t1.city_id = t2.host_city_id WHERE population > 1000",
"SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000"
] | Please show the themes of competitions with host cities having populations larger than 1000. | SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000 | farm |
[
"List the official names of all the cities.",
"Show me all the status of these cities.",
"What is the number of cities with each status?",
"Can you show them in increasing order?"
] | [
"SELECT DISTINCT official_name FROM city",
"SELECT DISTINCT status FROM city",
"SELECT status, count(*) FROM city GROUP BY status",
"SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC"
] | Please show the different statuses, ordered by the number of cities that have each. | SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC | farm |
[
"Tell me the names of all the cities.",
"Tell me the city status of \"Grand Falls/Grand-Sault\".",
"Which of the cities are not towns?",
"Which city status is the most common?"
] | [
"SELECT official_name FROM city",
"SELECT status FROM city WHERE official_name = \"Grand Falls/Grand-Sault\"",
"SELECT official_name FROM city WHERE status != \"Town\"",
"SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1"
] | List the most common type of Status across cities. | SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1 | farm |
[
"Show me all the cities.",
"Show me the official names of all the cities.",
"Which of these cities have hosted competitions before?",
"Which of them have not?"
] | [
"SELECT * FROM city",
"SELECT official_name FROM city",
"SELECT DISTINCT official_name FROM city AS t1 JOIN farm_competition AS t2 ON t1.city_id = t2.host_city_id",
"SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition)"
] | List the official names of cities that have not held any competition. | SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition) | farm |
[
"List the names of all the cities.",
"Which of these cities have a population bigger than 1500?",
"Which cities have a population smaller than 500?",
"Show all statuses that are common between these two types of cities."
] | [
"SELECT official_name FROM city",
"SELECT official_name FROM city WHERE population > 1500",
"SELECT official_name FROM city WHERE population < 500",
"SELECT Status FROM city WHERE Population > 1500 INTERSECT SELECT Status FROM city WHERE Population < 500"
] | Show the status shared by cities with population bigger than 1500 and smaller than 500. | SELECT Status FROM city WHERE Population > 1500 INTERSECT SELECT Status FROM city WHERE Population < 500 | farm |
[
"Can I see the names of the gymnasts?",
"How old is the gymnast from Bonao?",
"Who is from Miami?",
"How about gymnasts not from \"Santo Domingo\"?"
] | [
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID",
"SELECT T2.age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE Hometown = \"Bonao\"",
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE Hometown = \"Miami\"",
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != \"Santo Domingo\""
] | What are the names of gymnasts whose hometown is not "Santo Domingo"? | SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != "Santo Domingo" | gymnast |
[
"What is the average height of all people?",
"How about the average height of gymnasts?",
"How old is the tallest among all people?"
] | [
"SELECT AVG(Height) FROM people",
"SELECT AVG(T2.Height) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID",
"SELECT Age FROM people ORDER BY Height DESC LIMIT 1"
] | What is the age of the tallest person? | SELECT Age FROM people ORDER BY Height DESC LIMIT 1 | gymnast |
[
"Who is the tallest?",
"Who is the oldest gymnast?",
"Please show the top 5 oldest gymnasts.",
"How about the top 5 oldest people?"
] | [
"SELECT name FROM people ORDER BY Height DESC LIMIT 1",
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY Age DESC LIMIT 1",
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY Age DESC LIMIT 5",
"SELECT Name FROM People ORDER BY Age DESC LIMIT 5"
] | List the names of the top 5 oldest people. | SELECT Name FROM People ORDER BY Age DESC LIMIT 5 | gymnast |
[
"What is the average age of all people?",
"How about the average age of all gymnasts?",
"Who is the youngest gymnast?",
"How many total points does he have?"
] | [
"SELECT AVG(age) FROM people",
"SELECT AVG(age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID",
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1",
"SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1"
] | What is the total point count of the youngest gymnast? | SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1 | gymnast |
[
"What is the average total points of gymnasts?",
"How many gymnasts are there that have total points more than 50?",
"How about the number of gymnasts with total points more than 57.5?",
"What are the distinct hometowns of these gymnasts?"
] | [
"SELECT AVG(Total_Points) FROM gymnast",
"SELECT COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 50",
"SELECT COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5",
"SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5"
] | What are the distinct hometowns of gymnasts with total points more than 57.5? | SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5 | gymnast |
[
"How many gymnasts are there?",
"How many gymnasts are there in each age group?",
"How many gymnasts are there in each hometown?"
] | [
"SELECT COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID",
"SELECT T2.Age , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Age",
"SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown"
] | What are the hometowns of gymnasts and the corresponding number of gymnasts? | SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown | gymnast |
[
"How many distinct hometowns are there?",
"How many gymnasts are from each town?",
"What is the most common hometown?"
] | [
"SELECT COUNT(DISTINCT Hometown) FROM people",
"SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown",
"SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1"
] | What is the most common hometown of gymnasts? | SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1 | gymnast |
[
"How many distinct hometowns are there?",
"How many gymnasts are there in each hometown?",
"Which hometown has more than 1 gymnast?"
] | [
"SELECT COUNT(DISTINCT Hometown) FROM people",
"SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown",
"SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2"
] | What are the hometowns that are shared by at least two gymnasts? | SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2 | gymnast |
[
"Who is the tallest gymnast?",
"How about the shortest gymnast?",
"Please show the names of gymnasts in ascending order by their heights."
] | [
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1",
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC LIMIT 1",
"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC"
] | List the names of gymnasts in ascending order by their heights. | SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC | gymnast |
[
"What is the average Floor Exercise Points of gymnasts?",
"Please show the hometowns of the gymnasts.",
"Please show the hometowns of all people.",
"What are the distinct hometowns that do not have any gymnasts?"
] | [
"SELECT AVG(Floor_Exercise_Points) FROM gymnast",
"SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID",
"SELECT Hometown FROM people",
"SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID"
] | List the distinct hometowns that are not associated with any gymnast. | SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID | gymnast |
[
"How many people are older than 23?",
"How about the number of people younger than 20?",
"Please show their hometowns.",
"How about the hometowns shared by people older than 23 and younger than 20?"
] | [
"SELECT COUNT(*) FROM people WHERE Age > 23",
"SELECT COUNT(*) FROM people WHERE Age < 20",
"SELECT Hometown FROM people WHERE Age < 20",
"SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20"
] | Show the hometowns shared by people older than 23 and younger than 20. | SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20 | gymnast |
[
"What is the average price of phones?",
"What about their names?",
"Of those, only tell me the ones that are either \"Sprint\" or \"TMobile\" carriers."
] | [
"SELECT AVG(Price) FROM phone",
"SELECT Name FROM phone",
"SELECT Name FROM phone WHERE Carrier = \"Sprint\" OR Carrier = \"TMobile\""
] | Show the names of phones with carrier either "Sprint" or "TMobile". | SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile" | phone_market |
[
"What is the memory of the cheapest phone?",
"Include the name as well please.",
"What about for the most expensive phone?",
"Which company carries this?"
] | [
"SELECT Memory_in_G FROM phone ORDER BY Price ASC LIMIT 1",
"SELECT Name, Memory_in_G FROM phone ORDER BY Price ASC LIMIT 1",
"SELECT Name, Memory_in_G FROM phone ORDER BY Price DESC LIMIT 1",
"SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1"
] | What is the carrier of the most expensive phone? | SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1 | phone_market |
[
"What is the cheapest phone?",
"Which carrier has this?",
"Which one has the most phones instead?"
] | [
"SELECT * FROM phone ORDER BY Price ASC LIMIT 1",
"SELECT Carrier FROM phone ORDER BY Price ASC LIMIT 1",
"SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1"
] | Show the most frequently used carrier of the phones. | SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1 | phone_market |
[
"Show me all the phone carriers.",
"The ones with a phones having a price range of 700 to 900?",
"How about the ones that have phones both price less than 700 and price more than 900.",
"What about phones with memory less than 32 and memory greater than 64?"
] | [
"SELECT Carrier FROM phone",
"SELECT Carrier from phone WHERE Price > 700 AND Price < 900",
"SELECT Carrier FROM phone WHERE Price < 700 INTERSECT SELECT Carrier FROM phone WHERE Price > 900",
"SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64"
] | Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. | SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64 | phone_market |
[
"What are the names of the phones available?",
"What about those available in Alberta?",
"Show the district as well.",
"Remove the restriction of those in Alberta only, show all instead."
] | [
"SELECT Name FROM phone",
"SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.District = \"Alberta\"",
"SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.District = \"Alberta\"",
"SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID"
] | Show the names of phones and the districts of markets they are on. | SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID | phone_market |
[
"What are the names and districts of the phones I can find in Ontario?",
"What about for each of the market district?",
"Order those by increasing number of shops.",
"By ranking instead?"
] | [
"SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.District = \"Ontario\"",
"SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID",
"SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Num_of_shops",
"SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking"
] | Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market. | SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking | phone_market |
[
"What are the markets with at least 30 shops?",
"50 shops?",
"What are their phones?"
] | [
"SELECT * FROM market WHERE Num_of_shops > 30",
"SELECT * FROM market WHERE Num_of_shops > 50",
"SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50"
] | Show the names of phones that are on market with number of shops greater than 50. | SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50 | phone_market |
[
"What are the names of the phones?",
"Show me their memory as well.",
"Their total stocks?"
] | [
"SELECT Name FROM phone",
"SELECT Name, Memory_in_G FROM phone",
"SELECT T2.Name , sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name"
] | For each phone, show its names and total number of stocks. | SELECT T2.Name , sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name | phone_market |
[
"Show the names of phones and their stocks.",
"Of those, which have 64 GB memory?",
"How about the having total stocks at least 2000 instead?",
"Don't show their number of stocks.",
"Can you sort them in increasing order of total stocks?",
"Decreasing order instead."
] | [
"SELECT T2.Name, T1.Num_of_stock FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID",
"SELECT T2.Name, T1.Num_of_stock FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID WHERE T2.Memory_in_G = 64",
"SELECT T2.Name, T1.Num_of_stock FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000",
"SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000",
"SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000 ORDER BY sum(T1.Num_of_stock)",
"SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000 ORDER BY sum(T1.Num_of_stock) DESC"
] | Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks. | SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000 ORDER BY sum(T1.Num_of_stock) DESC | phone_market |
[
"Show me the vote percents of all the elections.",
"What are the minimum and maximum ones of them?"
] | [
"SELECT Vote_Percent FROM election",
"SELECT min(Vote_Percent) , max(Vote_Percent) FROM election"
] | What are the minimum and maximum vote percents of elections? | SELECT min(Vote_Percent) , max(Vote_Percent) FROM election | election_representative |
[
"Show me the the name of all the representatives.",
"Only show me those from New York or Indiana.",
"What about their life spans?"
] | [
"SELECT Name FROM representative",
"SELECT Name FROM representative WHERE State = \"New York\" OR State = \"Indiana\"",
"SELECT Lifespan FROM representative WHERE State = \"New York\" OR State = \"Indiana\""
] | What are the life spans of representatives from New York state or Indiana state? | SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana" | election_representative |
[
"Show me the name of all the representatives.",
"What about their votes in their elections?",
"Only show me the name of those with more than 10000 votes."
] | [
"SELECT Name FROM representative",
"SELECT T2.Name,T1.votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID",
"SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000"
] | What are the names of representatives with more than 10000 votes in election? | SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000 | election_representative |
[
"Show me the name of all the representatives.",
"What about their votes in their elections?",
"Show me their names in descending order of votes."
] | [
"SELECT Name FROM representative",
"SELECT T2.Name,T1.votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID",
"SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC"
] | What are the names of representatives in descending order of votes? | SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC | election_representative |
[
"Show me the names of all parties of the representative.",
"Show me the names of all the representatives.",
"What are their votes?",
"What is the party of the one with the smallest number of votes?"
] | [
"SELECT DISTINCT Party FROM representative",
"SELECT Name FROM representative",
"SELECT T2.Name,T1.votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID",
"SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1"
] | What is the party of the representative that has the smallest number of votes. | SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1 | election_representative |
[
"Show me the names of all the representatives.",
"What about their lifespans?",
"Please list them in descending order of their vote percentage."
] | [
"SELECT Name FROM representative",
"SELECT Name, lifespan FROM representative",
"SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC"
] | What are the lifespans of representatives in descending order of vote percent? | SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC | election_representative |
[
"Show me the name of representatives from Republican party.",
"What about their votes?",
"Show me the average of them."
] | [
"SELECT name FROM representative WHERE party = \"Republican\"",
"SELECT T2.name, T1.Votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = \"Republican\"",
"SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = \"Republican\""
] | What is the average number of votes of representatives from party "Republican"? | SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican" | election_representative |
[
"What are the name of parties of representatives?",
"Show me the number of representatives in each party.",
"Give me the party that has more."
] | [
"SELECT DISTINCT Party FROM representative",
"SELECT Party , COUNT(*) FROM representative GROUP BY Party",
"SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1"
] | What is the party that has the largest number of representatives? | SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1 | election_representative |
[
"What are the name of parties of representatives?",
"Show me the number of representatives in each party.",
"Give me the parties that have at least three of them."
] | [
"SELECT DISTINCT Party FROM representative",
"SELECT Party , COUNT(*) FROM representative GROUP BY Party",
"SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3"
] | What parties have at least three representatives? | SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3 | election_representative |
[
"Show me the name of the states of representative.",
"What about their number of representatives?",
"Show me the states that have at least of them."
] | [
"SELECT State FROM representative",
"SELECT State, COUNT(*) FROM representative GROUP BY State",
"SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2"
] | What states have at least two representatives? | SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2 | election_representative |
[
"Show me the names of all the representatives.",
"Who have not participated in elections listed here?"
] | [
"SELECT Name FROM representative",
"SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)"
] | List the names of representatives that have not participated in elections listed here. | SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election) | election_representative |
[
"What are all the races?",
"Show the name of the one held most recently."
] | [
"SELECT * FROM races",
"SELECT name FROM races ORDER BY date DESC LIMIT 1"
] | What is the name of the race held most recently? | SELECT name FROM races ORDER BY date DESC LIMIT 1 | formula_1 |
[
"What are all the races?",
"What is the most recent one?",
"Only show its name and date."
] | [
"SELECT * FROM races",
"SELECT * FROM races ORDER BY date DESC LIMIT 1",
"SELECT name , date FROM races ORDER BY date DESC LIMIT 1"
] | What is the name and date of the most recent race? | SELECT name , date FROM races ORDER BY date DESC LIMIT 1 | formula_1 |
[
"What are all the races held in 2017?",
"Only show their names."
] | [
"SELECT * FROM races WHERE YEAR = 2017",
"SELECT name FROM races WHERE YEAR = 2017"
] | Find the names of all races held in 2017. | SELECT name FROM races WHERE YEAR = 2017 | formula_1 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.