minktn/spider-data huggingface dataset:
Database: allergy_1
Question: What are the students ids of students who have more than one allergy?
SQL: SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*)  >=  2
Database: allergy_1
Question: What are the student ids of students who don't have any allergies?
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy
Database: allergy_1
Question: Which students are unaffected by allergies?
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy
Database: allergy_1
Question: How many female students have milk or egg allergies?
SQL: SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.sex  =  "F" AND T1.allergy  =  "Milk" OR T1.allergy  =  "Eggs"
Database: allergy_1
Question: How many students who are female are allergic to milk or eggs?
SQL: SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.sex  =  "F" AND T1.allergy  =  "Milk" OR T1.allergy  =  "Eggs"
Database: allergy_1
Question: How many students have a food allergy?
SQL: SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy WHERE T2.allergytype  =  "food"
Database: allergy_1
Question: How many students are affected by food related allergies?
SQL: SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy WHERE T2.allergytype  =  "food"
Database: allergy_1
Question: Which allergy has most number of students affected?
SQL: SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: Which allergy is the most common?
SQL: SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: Show all allergies with number of students affected.
SQL: SELECT Allergy ,  count(*) FROM Has_allergy GROUP BY Allergy
Database: allergy_1
Question: How many students have each different allergy?
SQL: SELECT Allergy ,  count(*) FROM Has_allergy GROUP BY Allergy
Database: allergy_1
Question: Show all allergy type with number of students affected.
SQL: SELECT T2.allergytype ,  count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy GROUP BY T2.allergytype
Database: allergy_1
Question: How many students are affected by each allergy type?
SQL: SELECT T2.allergytype ,  count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy GROUP BY T2.allergytype
Database: allergy_1
Question: Find the last name and age of the student who has allergy to both milk and cat.
SQL: SELECT lname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
Database: allergy_1
Question: What are the last names and ages of the students who are allergic to milk and cat?
SQL: SELECT lname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
Database: allergy_1
Question: What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.
SQL: SELECT T1.Allergy ,  T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy  =  T2.Allergy JOIN Student AS T3 ON T3.StuID  =  T2.StuID WHERE T3.Fname  =  "Lisa" ORDER BY T1.Allergy
Database: allergy_1
Question: What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names.
SQL: SELECT T1.Allergy ,  T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy  =  T2.Allergy JOIN Student AS T3 ON T3.StuID  =  T2.StuID WHERE T3.Fname  =  "Lisa" ORDER BY T1.Allergy
Database: allergy_1
Question: Find the first name and gender of the student who has allergy to milk but not cat.
SQL: SELECT fname ,  sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
Database: allergy_1
Question: What are the first name and gender of the students who have allergy to milk but can put up with cats?
SQL: SELECT fname ,  sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
Database: allergy_1
Question: Find the average age of the students who have allergies with food and animal types.
SQL: SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "animal")
Database: allergy_1
Question: How old are the students with allergies to food and animal types on average?
SQL: SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "animal")
Database: allergy_1
Question: List the first and last name of the students who do not have any food type allergy.
SQL: SELECT fname ,  lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food")
Database: allergy_1
Question: What is the full name of each student who is not allergic to any type of food.
SQL: SELECT fname ,  lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food")
Database: allergy_1
Question: Find the number of male (sex is 'M') students who have some food type allery.
SQL: SELECT count(*) FROM Student WHERE sex  =  "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food")
Database: allergy_1
Question: How many male students (sex is 'M') are allergic to any type of food?
SQL: SELECT count(*) FROM Student WHERE sex  =  "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food")
Database: allergy_1
Question: Find the different first names and cities of the students who have allergy to milk or cat.
SQL: SELECT DISTINCT T1.fname ,  T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid  =  T2.stuid WHERE T2.Allergy  =  "Milk" OR T2.Allergy  =  "Cat"
Database: allergy_1
Question: What are the distinct first names and cities of the students who have allergy either to milk or to cat?
SQL: SELECT DISTINCT T1.fname ,  T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid  =  T2.stuid WHERE T2.Allergy  =  "Milk" OR T2.Allergy  =  "Cat"
Database: allergy_1
Question: Find the number of students who are older than 18 and do not have allergy to either food or animal.
SQL: SELECT count(*) FROM Student WHERE age  >  18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food" OR T2.allergytype  =  "animal")
Database: allergy_1
Question: How many students are over 18 and do not have allergy to food type or animal type?
SQL: SELECT count(*) FROM Student WHERE age  >  18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food" OR T2.allergytype  =  "animal")
Database: allergy_1
Question: Find the first name and major of the students who are not allegry to soy.
SQL: SELECT fname ,  major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Soy")
Database: allergy_1
Question: What are the first name and major of the students who are able to consume soy?
SQL: SELECT fname ,  major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Soy")
Database: store_1
Question: List the name of albums that are released by aritist whose name has 'Led'
SQL: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%'
Database: store_1
Question: What is the title of the album that was released by the artist whose name has the phrase 'Led'?
SQL: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%'
Database: store_1
Question: Find the full name of employee who supported the most number of customers.
SQL: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
Database: store_1
Question: What is the full name of the employee who has the most customers?
SQL: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
Database: store_1
Question: Find the number of employees whose title is IT Staff from each city?
SQL: SELECT count(*) ,  city FROM employees WHERE title  =  'IT Staff' GROUP BY city
Database: store_1
Question: How many employees who are IT staff are from each city?
SQL: SELECT count(*) ,  city FROM employees WHERE title  =  'IT Staff' GROUP BY city
Database: store_1
Question: List the name of tracks belongs to genre Rock or genre Jazz.
SQL: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz"
Database: store_1
Question: What are the names of the tracks that are Rock or Jazz songs?
SQL: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz"
Database: store_1
Question: Find the name of tracks which are in Movies playlist but not in music playlist.
SQL: 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'
Database: store_1
Question: What are the names of all tracks that are on the Movies playlist but not in the music playlist?
SQL: 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'
Database: store_1
Question: Find the name of tracks which are in both Movies and music playlists.
SQL: 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' INTERSECT 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'
Database: store_1
Question: What are the names of all the tracks that are in both the Movies and music playlists?
SQL: 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' INTERSECT 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'
Database: journal_committee
Question: How many editors are there?
SQL: SELECT count(*) FROM editor
Database: journal_committee
Question: List the names of editors in ascending order of age.
SQL: SELECT Name FROM editor ORDER BY Age ASC
Database: journal_committee
Question: What are the names and ages of editors?
SQL: SELECT Name ,  Age FROM editor
Database: journal_committee
Question: List the names of editors who are older than 25.
SQL: SELECT Name FROM editor WHERE Age  >  25
Database: journal_committee
Question: Show the names of editors of age either 24 or 25.
SQL: SELECT Name FROM editor WHERE Age  =  24 OR Age  =  25
Database: journal_committee
Question: What is the name of the youngest editor?
SQL: SELECT Name FROM editor ORDER BY Age ASC LIMIT 1
Database: journal_committee
Question: What are the different ages of editors? Show each age along with the number of editors of that age.
SQL: SELECT Age ,  COUNT(*) FROM editor GROUP BY Age
Database: journal_committee
Question: Please show the most common age of editors.
SQL: SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1
Database: journal_committee
Question: Show the distinct themes of journals.
SQL: SELECT DISTINCT Theme FROM journal
Database: journal_committee
Question: Show the names of editors and the theme of journals for which they serve on committees.
SQL: SELECT T2.Name ,  T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID
Database: journal_committee
Question: For each journal_committee, find the editor name and the journal theme.
SQL: SELECT T2.Name ,  T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID
Database: journal_committee
Question: Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme.
SQL: SELECT T2.Name ,  T2.age ,  T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID ORDER BY T3.Theme ASC
Database: journal_committee
Question: Show the names of editors that are on the committee of journals with sales bigger than 3000.
SQL: SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID WHERE T3.Sales  >  3000
Database: journal_committee
Question: Show the id, name of each editor and the number of journal committees they are on.
SQL: SELECT T1.editor_id ,  T1.Name ,  COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID  =  T2.Editor_ID GROUP BY T1.editor_id
Database: journal_committee
Question: Show the names of editors that are on at least two journal committees.
SQL: SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID  =  T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*)  >=  2
Database: journal_committee
Question: List the names of editors that are not on any journal committee.
SQL: SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee)
Database: journal_committee
Question: List the date, theme and sales of the journal which did not have any of the listed editors serving on committee.
SQL: SELECT date ,  theme ,  sales FROM journal EXCEPT SELECT T1.date ,  T1.theme ,  T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID  =  T2.journal_ID
Database: journal_committee
Question: What is the average sales of the journals that have an editor whose work type is 'Photo'?
SQL: SELECT avg(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID  =  T2.journal_ID WHERE T2.work_type  =  'Photo'
Database: customers_card_transactions
Question: How many accounts do we have?
SQL: SELECT count(*) FROM Accounts
Database: customers_card_transactions
Question: Count the number of accounts.
SQL: SELECT count(*) FROM Accounts
Database: customers_card_transactions
Question: Show ids, customer ids, names for all accounts.
SQL: SELECT account_id ,  customer_id ,  account_name FROM Accounts
Database: customers_card_transactions
Question: What are the account ids, customer ids, and account names for all the accounts?
SQL: SELECT account_id ,  customer_id ,  account_name FROM Accounts
Database: customers_card_transactions
Question: Show other account details for account with name 338.
SQL: SELECT other_account_details FROM Accounts WHERE account_name  =  "338"
Database: customers_card_transactions
Question: What are the other account details for the account with the name 338?
SQL: SELECT other_account_details FROM Accounts WHERE account_name  =  "338"
Database: customers_card_transactions
Question: What is the first name, last name, and phone of the customer with account name 162?
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "162"
Database: customers_card_transactions
Question: Give the full name and phone of the customer who has the account name 162.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "162"
Database: customers_card_transactions
Question: How many accounts does the customer with first name Art and last name Turcotte have?
SQL: SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"
Database: customers_card_transactions
Question: Return the number of accounts that the customer with the first name Art and last name Turcotte has.
SQL: SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"
Database: customers_card_transactions
Question: Show all customer ids and the number of accounts for each customer.
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id
Database: customers_card_transactions
Question: How many accounts are there for each customer id?
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id
Database: customers_card_transactions
Question: Show the customer id and number of accounts with most accounts.
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_card_transactions
Question: What is the customer id of the customer with the most accounts, and how many accounts does this person have?
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_card_transactions
Question: What is the customer first, last name and id with least number of accounts.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
Database: customers_card_transactions
Question: Give the full name and customer id of the customer with the fewest accounts.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
Database: customers_card_transactions
Question: Show the number of all customers without an account.
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
Database: customers_card_transactions
Question: How many customers do not have an account?
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
Database: customers_card_transactions
Question: Show the first names and last names of customers without any account.
SQL: SELECT customer_first_name ,  customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
Database: customers_card_transactions
Question: What are the full names of customers who do not have any accounts?
SQL: SELECT customer_first_name ,  customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
Database: customers_card_transactions
Question: Show distinct first and last names for all customers with an account.
SQL: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
Database: customers_card_transactions
Question: What are the full names of customers who have accounts?
SQL: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
Database: customers_card_transactions
Question: How many customers have an account?
SQL: SELECT count(DISTINCT customer_id) FROM Accounts
Database: customers_card_transactions
Question: Count the number of customers who hold an account.
SQL: SELECT count(DISTINCT customer_id) FROM Accounts
Database: customers_card_transactions
Question: How many customers do we have?
SQL: SELECT count(*) FROM Customers
Database: customers_card_transactions
Question: Count the number of customers.
SQL: SELECT count(*) FROM Customers
Database: customers_card_transactions
Question: Show ids, first names, last names, and phones for all customers.
SQL: SELECT customer_id ,  customer_first_name ,  customer_last_name ,  customer_phone FROM Customers
Database: customers_card_transactions
Question: What are the ids, full names, and phones of each customer?
SQL: SELECT customer_id ,  customer_first_name ,  customer_last_name ,  customer_phone FROM Customers
Database: customers_card_transactions
Question: What is the phone and email for customer with first name Aniyah and last name Feest?
SQL: SELECT customer_phone ,  customer_email FROM Customers WHERE customer_first_name  =  "Aniyah" AND customer_last_name  =  "Feest"
Database: customers_card_transactions
Question: Return the phone and email of the customer with the first name Aniyah and last name Feest.
SQL: SELECT customer_phone ,  customer_email FROM Customers WHERE customer_first_name  =  "Aniyah" AND customer_last_name  =  "Feest"
Database: customers_card_transactions
Question: Show the number of customer cards.
SQL: SELECT count(*) FROM Customers_cards
Database: customers_card_transactions
Question: How many customer cards are there?
SQL: SELECT count(*) FROM Customers_cards
Database: customers_card_transactions
Question: Show ids, customer ids, card type codes, card numbers for all cards.
SQL: SELECT card_id ,  customer_id ,  card_type_code ,  card_number FROM Customers_cards
Database: customers_card_transactions
Question: What are card ids, customer ids, card types, and card numbers for each customer card?
SQL: SELECT card_id ,  customer_id ,  card_type_code ,  card_number FROM Customers_cards
Database: customers_card_transactions
Question: Show the date valid from and the date valid to for the card with card number '4560596484842'.
SQL: SELECT date_valid_from ,  date_valid_to FROM Customers_cards WHERE card_number  =  "4560596484842"
Database: customers_card_transactions
Question: What are the valid from and valid to dates for the card with the number 4560596484842?
SQL: SELECT date_valid_from ,  date_valid_to FROM Customers_cards WHERE card_number  =  "4560596484842"
Database: customers_card_transactions
Question: What is the first name, last name, and phone of the customer with card 4560596484842.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.card_number  =  "4560596484842"
Database: customers_card_transactions
Question: Return the full name and phone of the customer who has card number 4560596484842.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.card_number  =  "4560596484842"
Database: customers_card_transactions
Question: How many cards does customer Art Turcotte have?
SQL: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"
Database: customers_card_transactions
Question: Count the number of cards the customer with the first name Art and last name Turcotte has.
SQL: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"
Database: customers_card_transactions
Question: How many debit cards do we have?
SQL: SELECT count(*) FROM Customers_cards WHERE card_type_code  =  "Debit"
Database: customers_card_transactions
Question: Count the number of customer cards of the type Debit.
SQL: SELECT count(*) FROM Customers_cards WHERE card_type_code  =  "Debit"
Database: customers_card_transactions
Question: How many credit cards does customer Blanche Huels have?
SQL: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Blanche" AND T2.customer_last_name  =  "Huels" AND T1.card_type_code  =  "Credit"
Database: customers_card_transactions
Question: Count the number of credit cards that the customer with first name Blanche and last name Huels has.
SQL: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Blanche" AND T2.customer_last_name  =  "Huels" AND T1.card_type_code  =  "Credit"
Database: customers_card_transactions
Question: Show all customer ids and the number of cards owned by each customer.
SQL: SELECT customer_id ,  count(*) FROM Customers_cards GROUP BY customer_id
Database: customers_card_transactions
Question: What are the different customer ids, and how many cards does each one hold?
SQL: SELECT customer_id ,  count(*) FROM Customers_cards GROUP BY customer_id
Database: customers_card_transactions
Question: What is the customer id with most number of cards, and how many does he have?
SQL: SELECT customer_id ,  count(*) FROM Customers_cards GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_card_transactions
Question: Return the id of the customer who has the most cards, as well as the number of cards.
SQL: SELECT customer_id ,  count(*) FROM Customers_cards GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_card_transactions
Question: Show id, first and last names for all customers with at least two cards.
SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
Database: customers_card_transactions
Question: What are the ids and full names of customers who hold two or more cards?
SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
Database: customers_card_transactions
Question: What is the customer id, first and last name with least number of accounts.
SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
Database: customers_card_transactions
Question: Return the id and full name of the customer who has the fewest accounts.
SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
Database: customers_card_transactions
Question: Show all card type codes and the number of cards in each type.
SQL: SELECT card_type_code ,  count(*) FROM Customers_cards GROUP BY card_type_code
Database: customers_card_transactions
Question: What are the different card types, and how many cards are there of each?
SQL: SELECT card_type_code ,  count(*) FROM Customers_cards GROUP BY card_type_code
Database: customers_card_transactions
Question: What is the card type code with most number of cards?
SQL: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count(*) DESC LIMIT 1
Database: customers_card_transactions
Question: Return the code of the card type that is most common.
SQL: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count(*) DESC LIMIT 1
Database: customers_card_transactions
Question: Show card type codes with at least 5 cards.
SQL: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING count(*)  >=  5
Database: customers_card_transactions
Question: What are the codes of card types that have 5 or more cards?
SQL: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING count(*)  >=  5
Database: customers_card_transactions
Question: Show all card type codes and the number of customers holding cards in each type.
SQL: SELECT card_type_code ,  count(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code
Database: customers_card_transactions
Question: What are the different card type codes, and how many different customers hold each type?
SQL: SELECT card_type_code ,  count(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code
Database: customers_card_transactions
Question: Show the customer ids and firstname without a credit card.
SQL: SELECT customer_id ,  customer_first_name FROM Customers EXCEPT SELECT T1.customer_id ,  T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE card_type_code  =  "Credit"
Database: customers_card_transactions
Question: What are the ids and first names of customers who do not hold a credit card?
SQL: SELECT customer_id ,  customer_first_name FROM Customers EXCEPT SELECT T1.customer_id ,  T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE card_type_code  =  "Credit"
Database: customers_card_transactions
Question: Show all card type codes.
SQL: SELECT DISTINCT card_type_code FROM Customers_Cards
Database: customers_card_transactions
Question: What are the different card type codes?
SQL: SELECT DISTINCT card_type_code FROM Customers_Cards
Database: customers_card_transactions
Question: Show the number of card types.
SQL: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
Database: customers_card_transactions
Question: How many different card types are there?
SQL: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
Database: customers_card_transactions
Question: Show all transaction types.
SQL: SELECT DISTINCT transaction_type FROM Financial_Transactions
Database: customers_card_transactions
Question: What are the different types of transactions?
SQL: SELECT DISTINCT transaction_type FROM Financial_Transactions
Database: customers_card_transactions
Question: Show the number of transaction types.
SQL: SELECT count(DISTINCT transaction_type) FROM Financial_Transactions
Database: customers_card_transactions
Question: How many different types of transactions are there?
SQL: SELECT count(DISTINCT transaction_type) FROM Financial_Transactions
Database: customers_card_transactions
Question: What is the average and total transaction amount?
SQL: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
Database: customers_card_transactions
Question: Return the average transaction amount, as well as the total amount of all transactions.
SQL: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
Database: customers_card_transactions
Question: Show the card type codes and the number of transactions.
SQL: SELECT T2.card_type_code ,  count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id  =  T2.card_id GROUP BY T2.card_type_code
Database: customers_card_transactions
Question: What are the different card types, and how many transactions have been made with each?
SQL: SELECT T2.card_type_code ,  count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id  =  T2.card_id GROUP BY T2.card_type_code
Database: customers_card_transactions
Question: Show the transaction type and the number of transactions.
SQL: SELECT transaction_type ,  count(*) FROM Financial_transactions GROUP BY transaction_type
Database: customers_card_transactions
Question: What are the different transaction types, and how many transactions of each have taken place?
SQL: SELECT transaction_type ,  count(*) FROM Financial_transactions GROUP BY transaction_type
Database: customers_card_transactions
Question: What is the transaction type that has processed the greatest total amount in transactions?
SQL: SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY sum(transaction_amount) DESC LIMIT 1
Database: customers_card_transactions
Question: Return the type of transaction with the highest total amount.
SQL: SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY sum(transaction_amount) DESC LIMIT 1
Database: customers_card_transactions
Question: Show the account id and the number of transactions for each account
SQL: SELECT account_id ,  count(*) FROM Financial_transactions GROUP BY account_id
Database: customers_card_transactions
Question: What are the different account ids that have made financial transactions, as well as how many transactions correspond to each?
SQL: SELECT account_id ,  count(*) FROM Financial_transactions GROUP BY account_id
Database: race_track
Question: How many tracks do we have?
SQL: SELECT count(*) FROM track
Database: race_track
Question: Count the number of tracks.
SQL: SELECT count(*) FROM track
Database: race_track
Question: Show the name and location for all tracks.
SQL: SELECT name ,  LOCATION FROM track
Database: race_track
Question: What are the names and locations of all tracks?
SQL: SELECT name ,  LOCATION FROM track
Database: race_track
Question: Show names and seatings, ordered by seating for all tracks opened after 2000.
SQL: SELECT name ,  seating FROM track WHERE year_opened  >  2000 ORDER BY seating
Database: race_track
Question: What are the names and seatings for all tracks opened after 2000, ordered by seating?
SQL: SELECT name ,  seating FROM track WHERE year_opened  >  2000 ORDER BY seating
Database: race_track
Question: What is the name, location and seating for the most recently opened track?
SQL: SELECT name ,  LOCATION ,  seating FROM track ORDER BY year_opened DESC LIMIT 1
Database: race_track
Question: Return the name, location, and seating of the track that was opened in the most recent year.
SQL: SELECT name ,  LOCATION ,  seating FROM track ORDER BY year_opened DESC LIMIT 1
Database: race_track
Question: What is the minimum, maximum, and average seating for all tracks.
SQL: SELECT min(seating) ,  max(seating) ,  avg(seating) FROM track
Database: race_track
Question: Return the minimum, maximum, and average seating across all tracks.
SQL: SELECT min(seating) ,  max(seating) ,  avg(seating) FROM track
Database: race_track
Question: Show the name, location, open year for all tracks with a seating higher than the average.
SQL: SELECT name ,  LOCATION ,  year_opened FROM track WHERE seating  >  (SELECT avg(seating) FROM track)
Database: race_track
Question: What are the names, locations, and years of opening for tracks with seating higher than average?
SQL: SELECT name ,  LOCATION ,  year_opened FROM track WHERE seating  >  (SELECT avg(seating) FROM track)
Database: race_track
Question: What are distinct locations where tracks are located?
SQL: SELECT DISTINCT LOCATION FROM track
Database: race_track
Question: Give the different locations of tracks.
SQL: SELECT DISTINCT LOCATION FROM track
Database: race_track
Question: How many races are there?
SQL: SELECT count(*) FROM race
Database: race_track
Question: Count the number of races.
SQL: SELECT count(*) FROM race
Database: race_track
Question: What are the distinct classes that races can have?
SQL: SELECT DISTINCT CLASS FROM race
Database: race_track
Question: Return the different classes of races.
SQL: SELECT DISTINCT CLASS FROM race
Database: race_track
Question: Show name, class, and date for all races.
SQL: SELECT name ,  CLASS ,  date FROM race
Database: race_track
Question: What are the names, classes, and dates for all races?
SQL: SELECT name ,  CLASS ,  date FROM race
Database: race_track
Question: Show the race class and number of races in each class.
SQL: SELECT CLASS ,  count(*) FROM race GROUP BY CLASS
Database: race_track
Question: What are the different classes of races, and how many races correspond to each?
SQL: SELECT CLASS ,  count(*) FROM race GROUP BY CLASS
Database: race_track
Question: What is the race class with most number of races.
SQL: SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1
Database: race_track
Question: Give the class of races that is most common.
SQL: SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1
Database: race_track
Question: List the race class with at least two races.
SQL: SELECT CLASS FROM race GROUP BY CLASS HAVING count(*)  >=  2
Database: race_track
Question: What are the classes of races that have two or more corresponding races?
SQL: SELECT CLASS FROM race GROUP BY CLASS HAVING count(*)  >=  2
Database: race_track
Question: What are the names for tracks without a race in class 'GT'.
SQL: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
Database: race_track
Question: Give the names of tracks that do not have a race in the class 'GT'.
SQL: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
Database: race_track
Question: Show all track names that have had no races.
SQL: SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)
Database: race_track
Question: Return the names of tracks that have no had any races.
SQL: SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)
Database: race_track
Question: Show year where a track with a seating at least 5000 opened and a track with seating no more than 4000 opened.
SQL: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
Database: race_track
Question: What are the years of opening for tracks with seating between 4000 and 5000?
SQL: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
Database: race_track
Question: Show the name of track and the number of races in each track.
SQL: SELECT T2.name ,  count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id
Database: race_track
Question: What are the names of different tracks, and how many races has each had?
SQL: SELECT T2.name ,  count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id
Database: race_track
Question: Show the name of track with most number of races.
SQL: SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1
Database: race_track
Question: What is the name of the track that has had the greatest number of races?
SQL: SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1
Database: race_track
Question: Show the name and date for each race and its track name.
SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
Database: race_track
Question: What are the names and dates of races, and the names of the tracks where they are held?
SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
Database: race_track
Question: Show the name and location of track with 1 race.
SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
Database: race_track
Question: What are the names and locations of tracks that have had exactly 1 race?
SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
Database: race_track
Question: Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.
SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
Database: race_track
Question: What are the locations that have both tracks with more than 90000 seats, and tracks with fewer than 70000 seats?
SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
Database: coffee_shop
Question: How many members have the black membership card?
SQL: SELECT count(*) FROM member WHERE Membership_card  =  'Black'
Database: coffee_shop
Question: Find the number of members living in each address.
SQL: SELECT count(*) ,  address FROM member GROUP BY address
Database: coffee_shop
Question: Give me the names of members whose address is in Harford or Waterbury.
SQL: SELECT name FROM member WHERE address  =  'Harford' OR address  =  'Waterbury'
Database: coffee_shop
Question: Find the ids and names of members who are under age 30 or with black membership card.
SQL: SELECT name ,  member_id FROM member WHERE Membership_card  =  'Black' OR age  <  30
Database: coffee_shop
Question: Find the purchase time, age and address of each member, and show the results in the order of purchase time.
SQL: SELECT Time_of_purchase ,  age ,  address FROM member ORDER BY Time_of_purchase
Database: coffee_shop
Question: Which membership card has more than 5 members?
SQL: SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*)  >  5
Database: coffee_shop
Question: Which address has both members younger than 30 and members older than 40?
SQL: SELECT address FROM member WHERE age  <  30 INTERSECT SELECT address FROM member WHERE age  >  40
Database: coffee_shop
Question: What is the membership card held by both members living in Hartford and ones living in Waterbury address?
SQL: SELECT membership_card FROM member WHERE address  =  'Hartford' INTERSECT SELECT membership_card FROM member WHERE address  =  'Waterbury'
Database: coffee_shop
Question: How many members are not living in Hartford?
SQL: SELECT count(*) FROM member WHERE address != 'Hartford'
Database: coffee_shop
Question: Which address do not have any member with the black membership card?
SQL: SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card  =  'Black'
Database: coffee_shop
Question: Show the shop addresses ordered by their opening year.
SQL: SELECT address FROM shop ORDER BY open_year
Database: coffee_shop
Question: What are the average score and average staff number of all shops?
SQL: SELECT avg(num_of_staff) ,  avg(score) FROM shop
Database: coffee_shop
Question: Find the id and address of the shops whose score is below the average score.
SQL: SELECT shop_id ,  address FROM shop WHERE score  <  (SELECT avg(score) FROM shop)
Database: coffee_shop
Question: Find the address and staff number of the shops that do not have any happy hour.
SQL: SELECT address ,  num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)
Database: coffee_shop
Question: What are the id and address of the shops which have a happy hour in May?
SQL: SELECT t1.address ,  t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id  =  t2.shop_id WHERE MONTH  =  'May'
Database: coffee_shop
Question: which shop has happy hour most frequently? List its id and number of happy hours.
SQL: SELECT shop_id ,  count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1
Database: coffee_shop
Question: Which month has the most happy hours?
SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1
Database: coffee_shop
Question: Which months have more than 2 happy hours?
SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*)  >  2
Database: chinook_1
Question: How many albums are there?
SQL: SELECT count(*) FROM ALBUM
Database: chinook_1
Question: Find the number of albums.
SQL: SELECT count(*) FROM ALBUM
Database: chinook_1
Question: List the names of all music genres.
SQL: SELECT Name FROM GENRE
Database: chinook_1
Question: What are the names of different music genres?
SQL: SELECT Name FROM GENRE
Database: chinook_1
Question: Find all the customer information in state NY.
SQL: SELECT * FROM CUSTOMER WHERE State  =  "NY"
Database: chinook_1
Question: What is all the customer information for customers in NY state?
SQL: SELECT * FROM CUSTOMER WHERE State  =  "NY"
Database: chinook_1
Question: What are the first names and last names of the employees who live in Calgary city.
SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "Calgary"
Database: chinook_1
Question: Find the full names of employees living in the city of Calgary.
SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "Calgary"
Database: chinook_1
Question: What are the distinct billing countries of the invoices?
SQL: SELECT distinct(BillingCountry) FROM INVOICE
Database: chinook_1
Question: Find the different billing countries for all invoices.
SQL: SELECT distinct(BillingCountry) FROM INVOICE
Database: chinook_1
Question: Find the names of all artists that have "a" in their names.
SQL: SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
Database: chinook_1
Question: What are the names of artist who have the letter 'a' in their names?
SQL: SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
Database: chinook_1
Question: Find the title of all the albums of the artist "AC/DC".
SQL: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "AC/DC"
Database: chinook_1
Question: What are the titles of albums by the artist "AC/DC"?
SQL: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "AC/DC"
Database: chinook_1
Question: Hom many albums does the artist "Metallica" have?
SQL: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "Metallica"
Database: chinook_1
Question: Find the number of albums by the artist "Metallica".
SQL: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "Metallica"
Database: chinook_1
Question: Which artist does the album "Balls to the Wall" belong to?
SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T1.Title  =  "Balls to the Wall"
Database: chinook_1
Question: Find the name of the artist who made the album "Balls to the Wall".
SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T1.Title  =  "Balls to the Wall"
Database: chinook_1
Question: Which artist has the most albums?
SQL: 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
Database: chinook_1
Question: What is the name of the artist with the greatest number of albums?
SQL: 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
Database: chinook_1
Question: Find the names of all the tracks that contain the word "you".
SQL: SELECT Name FROM TRACK WHERE Name LIKE '%you%'
Database: chinook_1
Question: What are the names of tracks that contain the the word you in them?
SQL: SELECT Name FROM TRACK WHERE Name LIKE '%you%'
Database: chinook_1
Question: What is the average unit price of all the tracks?
SQL: SELECT AVG(UnitPrice) FROM TRACK
Database: chinook_1
Question: Find the average unit price for a track.
SQL: SELECT AVG(UnitPrice) FROM TRACK
Database: chinook_1
Question: What are the durations of the longest and the shortest tracks in milliseconds?
SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
Database: chinook_1
Question: Find the maximum and minimum durations of tracks in milliseconds.
SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
Database: chinook_1
Question: Show the album names, ids and the number of tracks for each album.
SQL: SELECT T1.Title ,  T2.AlbumID ,  COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId GROUP BY T2.AlbumID
Database: chinook_1
Question: What are the names and ids of the different albums, and how many tracks are on each?
SQL: SELECT T1.Title ,  T2.AlbumID ,  COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId GROUP BY T2.AlbumID