question,context,answer,input,output Show the names of players and names of their coaches.,"CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE coach (coach_name VARCHAR, Coach_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR)","SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE coach (coach_name VARCHAR, Coach_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR) ### question:Show the names of players and names of their coaches.","SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID" Show the names of players coached by the rank 1 coach.,"CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE coach (Coach_ID VARCHAR, Rank VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR)",SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE coach (Coach_ID VARCHAR, Rank VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR) ### question:Show the names of players coached by the rank 1 coach.",SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1 Show the names and genders of players with a coach starting after 2011.,"CREATE TABLE player (Player_name VARCHAR, gender VARCHAR, Player_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR, Starting_year INTEGER); CREATE TABLE coach (Coach_ID VARCHAR)","SELECT T3.Player_name, T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Player_name VARCHAR, gender VARCHAR, Player_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR, Starting_year INTEGER); CREATE TABLE coach (Coach_ID VARCHAR) ### question:Show the names and genders of players with a coach starting after 2011.","SELECT T3.Player_name, T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011" Show the names of players and names of their coaches in descending order of the votes of players.,"CREATE TABLE coach (coach_name VARCHAR, Coach_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR); CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR, Votes VARCHAR)","SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE coach (coach_name VARCHAR, Coach_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR); CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR, Votes VARCHAR) ### question:Show the names of players and names of their coaches in descending order of the votes of players.","SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC" List the names of players that do not have coaches.,"CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE player_coach (Player_name VARCHAR, Player_ID VARCHAR)",SELECT Player_name FROM player WHERE NOT Player_ID IN (SELECT Player_ID FROM player_coach),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE player_coach (Player_name VARCHAR, Player_ID VARCHAR) ### question:List the names of players that do not have coaches.",SELECT Player_name FROM player WHERE NOT Player_ID IN (SELECT Player_ID FROM player_coach) "Show the residences that have both a player of gender ""M"" and a player of gender ""F"".","CREATE TABLE player (Residence VARCHAR, gender VARCHAR)","SELECT Residence FROM player WHERE gender = ""M"" INTERSECT SELECT Residence FROM player WHERE gender = ""F""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Residence VARCHAR, gender VARCHAR) ### question:Show the residences that have both a player of gender ""M"" and a player of gender ""F"".","SELECT Residence FROM player WHERE gender = ""M"" INTERSECT SELECT Residence FROM player WHERE gender = ""F""" "How many coaches does each club has? List the club id, name and the number of coaches.","CREATE TABLE club (club_id VARCHAR, club_name VARCHAR); CREATE TABLE coach (club_id VARCHAR)","SELECT T1.club_id, T1.club_name, COUNT(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (club_id VARCHAR, club_name VARCHAR); CREATE TABLE coach (club_id VARCHAR) ### question:How many coaches does each club has? List the club id, name and the number of coaches.","SELECT T1.club_id, T1.club_name, COUNT(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id" How many gold medals has the club with the most coaches won?,"CREATE TABLE match_result (club_id VARCHAR, gold VARCHAR); CREATE TABLE coach (club_id VARCHAR)","SELECT T1.club_id, T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE match_result (club_id VARCHAR, gold VARCHAR); CREATE TABLE coach (club_id VARCHAR) ### question:How many gold medals has the club with the most coaches won?","SELECT T1.club_id, T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY COUNT(*) DESC LIMIT 1" How many gymnasts are there?,CREATE TABLE gymnast (Id VARCHAR),SELECT COUNT(*) FROM gymnast,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Id VARCHAR) ### question:How many gymnasts are there?",SELECT COUNT(*) FROM gymnast List the total points of gymnasts in descending order.,CREATE TABLE gymnast (Total_Points VARCHAR),SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Total_Points VARCHAR) ### question:List the total points of gymnasts in descending order.",SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC List the total points of gymnasts in descending order of floor exercise points.,"CREATE TABLE gymnast (Total_Points VARCHAR, Floor_Exercise_Points VARCHAR)",SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Total_Points VARCHAR, Floor_Exercise_Points VARCHAR) ### question:List the total points of gymnasts in descending order of floor exercise points.",SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC What is the average horizontal bar points for all gymnasts?,CREATE TABLE gymnast (Horizontal_Bar_Points INTEGER),SELECT AVG(Horizontal_Bar_Points) FROM gymnast,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Horizontal_Bar_Points INTEGER) ### question:What is the average horizontal bar points for all gymnasts?",SELECT AVG(Horizontal_Bar_Points) FROM gymnast What are the names of people in ascending alphabetical order?,CREATE TABLE People (Name VARCHAR),SELECT Name FROM People ORDER BY Name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE People (Name VARCHAR) ### question:What are the names of people in ascending alphabetical order?",SELECT Name FROM People ORDER BY Name What are the names of gymnasts?,"CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)",SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of gymnasts?",SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID "What are the names of gymnasts whose hometown is not ""Santo Domingo""?","CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Hometown VARCHAR)","SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown <> ""Santo Domingo""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Hometown VARCHAR) ### question: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""" What is the age of the tallest person?,"CREATE TABLE people (Age VARCHAR, Height VARCHAR)",SELECT Age FROM people ORDER BY Height DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Age VARCHAR, Height VARCHAR) ### question:What is the age of the tallest person?",SELECT Age FROM people ORDER BY Height DESC LIMIT 1 List the names of the top 5 oldest people.,"CREATE TABLE People (Name VARCHAR, Age VARCHAR)",SELECT Name FROM People ORDER BY Age DESC LIMIT 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE People (Name VARCHAR, Age VARCHAR) ### question:List the names of the top 5 oldest people.",SELECT Name FROM People ORDER BY Age DESC LIMIT 5 What is the total point count of the youngest gymnast?,"CREATE TABLE people (People_ID VARCHAR, Age VARCHAR); CREATE TABLE gymnast (Total_Points VARCHAR, Gymnast_ID VARCHAR)",SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (People_ID VARCHAR, Age VARCHAR); CREATE TABLE gymnast (Total_Points VARCHAR, Gymnast_ID VARCHAR) ### question: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 LIMIT 1 What is the average age of all gymnasts?,"CREATE TABLE people (Age INTEGER, People_ID VARCHAR); CREATE TABLE gymnast (Gymnast_ID VARCHAR)",SELECT AVG(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Age INTEGER, People_ID VARCHAR); CREATE TABLE gymnast (Gymnast_ID VARCHAR) ### question:What is the average age of all gymnasts?",SELECT AVG(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID What are the distinct hometowns of gymnasts with total points more than 57.5?,"CREATE TABLE gymnast (Gymnast_ID VARCHAR, Total_Points INTEGER); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR, Total_Points INTEGER); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR) ### question: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 What are the hometowns of gymnasts and the corresponding number of gymnasts?,"CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)","SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR) ### question: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" What is the most common hometown of gymnasts?,"CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR) ### question: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 What are the hometowns that are shared by at least two gymnasts?,"CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR) ### question: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 List the names of gymnasts in ascending order by their heights.,"CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Height VARCHAR)",SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Height VARCHAR) ### question: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 List the distinct hometowns that are not associated with any gymnast.,"CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR) ### question: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 Show the hometowns shared by people older than 23 and younger than 20.,"CREATE TABLE people (Hometown VARCHAR, Age INTEGER)",SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Hometown VARCHAR, Age INTEGER) ### question: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 How many distinct hometowns did these people have?,CREATE TABLE people (Hometown VARCHAR),SELECT COUNT(DISTINCT Hometown) FROM people,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Hometown VARCHAR) ### question:How many distinct hometowns did these people have?",SELECT COUNT(DISTINCT Hometown) FROM people Show the ages of gymnasts in descending order of total points.,"CREATE TABLE people (Age VARCHAR, People_ID VARCHAR); CREATE TABLE gymnast (Gymnast_ID VARCHAR, Total_Points VARCHAR)",SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Age VARCHAR, People_ID VARCHAR); CREATE TABLE gymnast (Gymnast_ID VARCHAR, Total_Points VARCHAR) ### question:Show the ages of gymnasts in descending order of total points.",SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC Find the total savings balance of all accounts except the account with name ‘Brown’.,"CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR)",SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR) ### question:Find the total savings balance of all accounts except the account with name ‘Brown’.",SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown' How many accounts are there in total?,CREATE TABLE accounts (Id VARCHAR),SELECT COUNT(*) FROM accounts,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accounts (Id VARCHAR) ### question:How many accounts are there in total?",SELECT COUNT(*) FROM accounts What is the total checking balance in all accounts?,CREATE TABLE checking (balance INTEGER),SELECT SUM(balance) FROM checking,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance INTEGER) ### question:What is the total checking balance in all accounts?",SELECT SUM(balance) FROM checking Find the average checking balance.,CREATE TABLE checking (balance INTEGER),SELECT AVG(balance) FROM checking,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance INTEGER) ### question:Find the average checking balance.",SELECT AVG(balance) FROM checking How many accounts have a savings balance above the average savings balance?,CREATE TABLE savings (balance INTEGER),SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE savings (balance INTEGER) ### question:How many accounts have a savings balance above the average savings balance?",SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings) Find the name and id of accounts whose checking balance is below the maximum checking balance.,"CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER)","SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT MAX(balance) FROM checking)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER) ### question:Find the name and id of accounts whose checking balance is below the maximum checking balance.","SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT MAX(balance) FROM checking)" What is the checking balance of the account whose owner’s name contains the substring ‘ee’?,"CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (custid VARCHAR, name VARCHAR)",SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (custid VARCHAR, name VARCHAR) ### question: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%' Find the checking balance and saving balance in the Brown’s account.,"CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR)","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'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR) ### question: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'" "Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance.","CREATE TABLE checking (custid VARCHAR, balance INTEGER); CREATE TABLE savings (custid VARCHAR, balance INTEGER); CREATE TABLE savings (balance INTEGER); CREATE TABLE checking (balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)",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),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (custid VARCHAR, balance INTEGER); CREATE TABLE savings (custid VARCHAR, balance INTEGER); CREATE TABLE savings (balance INTEGER); CREATE TABLE checking (balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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) Find the checking balance of the accounts whose savings balance is higher than the average savings balance.,"CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER)",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)),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER) ### question: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)) List all customers’ names in the alphabetical order.,CREATE TABLE accounts (name VARCHAR),SELECT name FROM accounts ORDER BY name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accounts (name VARCHAR) ### question:List all customers’ names in the alphabetical order.",SELECT name FROM accounts ORDER BY name Find the name of account that has the lowest total checking and saving balance.,"CREATE TABLE checking (custid VARCHAR, balance VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (custid VARCHAR, balance VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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 Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance.,"CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","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)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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)" Find the name and checking balance of the account with the lowest savings balance.,"CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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" Find the number of checking accounts for each account name.,"CREATE TABLE checking (custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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" Find the total saving balance for each account name.,"CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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" Find the name of accounts whose checking balance is below the average checking balance.,"CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER)",SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER) ### question: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) Find the saving balance of the account with the highest checking balance.,"CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE checking (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (custid VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE checking (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (custid VARCHAR) ### question: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 Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.,"CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR)",SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR) ### question: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 Find the name and checking balance of the account with the lowest saving balance.,"CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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" "Find the name, checking balance and saving balance of all accounts in the bank.","CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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" "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.","CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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" Find the name of accounts whose checking balance is higher than corresponding saving balance.,"CREATE TABLE savings (custid VARCHAR, balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (custid VARCHAR, balance INTEGER)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE savings (custid VARCHAR, balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (custid VARCHAR, balance INTEGER) ### question: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 Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.,"CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question: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" Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.,"CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)","SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR) ### question:Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.","SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC LIMIT 3" How many main stream browsers whose market share is at least 5 exist?,CREATE TABLE browser (market_share VARCHAR),SELECT COUNT(*) FROM browser WHERE market_share >= 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE browser (market_share VARCHAR) ### question:How many main stream browsers whose market share is at least 5 exist?",SELECT COUNT(*) FROM browser WHERE market_share >= 5 List the name of browsers in descending order by market share.,"CREATE TABLE browser (name VARCHAR, market_share VARCHAR)",SELECT name FROM browser ORDER BY market_share DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE browser (name VARCHAR, market_share VARCHAR) ### question:List the name of browsers in descending order by market share.",SELECT name FROM browser ORDER BY market_share DESC "List the ids, names and market shares of all browsers.","CREATE TABLE browser (id VARCHAR, name VARCHAR, market_share VARCHAR)","SELECT id, name, market_share FROM browser","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE browser (id VARCHAR, name VARCHAR, market_share VARCHAR) ### question:List the ids, names and market shares of all browsers.","SELECT id, name, market_share FROM browser" "What is the maximum, minimum and average market share of the listed browsers?",CREATE TABLE browser (market_share INTEGER),"SELECT MAX(market_share), MIN(market_share), AVG(market_share) FROM browser","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE browser (market_share INTEGER) ### question:What is the maximum, minimum and average market share of the listed browsers?","SELECT MAX(market_share), MIN(market_share), AVG(market_share) FROM browser" What is the id and market share of the browser Safari?,"CREATE TABLE browser (id VARCHAR, market_share VARCHAR, name VARCHAR)","SELECT id, market_share FROM browser WHERE name = 'Safari'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE browser (id VARCHAR, market_share VARCHAR, name VARCHAR) ### question:What is the id and market share of the browser Safari?","SELECT id, market_share FROM browser WHERE name = 'Safari'" What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?,"CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR, CONNECTION VARCHAR)","SELECT name, operating_system FROM web_client_accelerator WHERE CONNECTION <> 'Broadband'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR, CONNECTION VARCHAR) ### question:What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?","SELECT name, operating_system FROM web_client_accelerator WHERE CONNECTION <> 'Broadband'" What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?,"CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR, accelerator_id VARCHAR, compatible_since_year VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR)",SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR, accelerator_id VARCHAR, compatible_since_year VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR) ### question:What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?",SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998 What are the ids and names of the web accelerators that are compatible with two or more browsers?,"CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, Name VARCHAR)","SELECT T1.id, T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, Name VARCHAR) ### question:What are the ids and names of the web accelerators that are compatible with two or more browsers?","SELECT T1.id, T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2" What is the id and name of the browser that is compatible with the most web accelerators?,"CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR)","SELECT T1.id, T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR) ### question:What is the id and name of the browser that is compatible with the most web accelerators?","SELECT T1.id, T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1" When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?,"CREATE TABLE accelerator_compatible_browser (compatible_since_year VARCHAR, browser_id VARCHAR, accelerator_id VARCHAR); CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR)",SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accelerator_compatible_browser (compatible_since_year VARCHAR, browser_id VARCHAR, accelerator_id VARCHAR); CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR) ### question:When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?",SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer' How many different kinds of clients are supported by the web clients accelerators?,CREATE TABLE web_client_accelerator (client VARCHAR),SELECT COUNT(DISTINCT client) FROM web_client_accelerator,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE web_client_accelerator (client VARCHAR) ### question:How many different kinds of clients are supported by the web clients accelerators?",SELECT COUNT(DISTINCT client) FROM web_client_accelerator How many accelerators are not compatible with the browsers listed ?,"CREATE TABLE accelerator_compatible_browser (id VARCHAR, accelerator_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, accelerator_id VARCHAR)",SELECT COUNT(*) FROM web_client_accelerator WHERE NOT id IN (SELECT accelerator_id FROM accelerator_compatible_browser),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accelerator_compatible_browser (id VARCHAR, accelerator_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, accelerator_id VARCHAR) ### question:How many accelerators are not compatible with the browsers listed ?",SELECT COUNT(*) FROM web_client_accelerator WHERE NOT id IN (SELECT accelerator_id FROM accelerator_compatible_browser) What distinct accelerator names are compatible with the browswers that have market share higher than 15?,"CREATE TABLE web_client_accelerator (name VARCHAR, id VARCHAR); CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE browser (id VARCHAR, market_share INTEGER)",SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE web_client_accelerator (name VARCHAR, id VARCHAR); CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE browser (id VARCHAR, market_share INTEGER) ### question:What distinct accelerator names are compatible with the browswers that have market share higher than 15?",SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15 List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.,"CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR)",SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR) ### question:List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.",SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox' Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.,"CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR); CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR, id VARCHAR)","SELECT name, operating_system FROM web_client_accelerator EXCEPT SELECT T1.name, T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR); CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR, id VARCHAR) ### question:Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.","SELECT name, operating_system FROM web_client_accelerator EXCEPT SELECT T1.name, T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'" "Which accelerator name contains substring ""Opera""?",CREATE TABLE web_client_accelerator (name VARCHAR),"SELECT name FROM web_client_accelerator WHERE name LIKE ""%Opera%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE web_client_accelerator (name VARCHAR) ### question:Which accelerator name contains substring ""Opera""?","SELECT name FROM web_client_accelerator WHERE name LIKE ""%Opera%""" Find the number of web accelerators used for each Operating system.,CREATE TABLE web_client_accelerator (Operating_system VARCHAR),"SELECT Operating_system, COUNT(*) FROM web_client_accelerator GROUP BY Operating_system","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE web_client_accelerator (Operating_system VARCHAR) ### question:Find the number of web accelerators used for each Operating system.","SELECT Operating_system, COUNT(*) FROM web_client_accelerator GROUP BY Operating_system" give me names of all compatible browsers and accelerators in the descending order of compatible year,"CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR, accelerator_id VARCHAR, compatible_since_year VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, id VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR)","SELECT T2.name, T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id ORDER BY T1.compatible_since_year DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR, accelerator_id VARCHAR, compatible_since_year VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, id VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR) ### question:give me names of all compatible browsers and accelerators in the descending order of compatible year","SELECT T2.name, T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id ORDER BY T1.compatible_since_year DESC" How many wrestlers are there?,CREATE TABLE wrestler (Id VARCHAR),SELECT COUNT(*) FROM wrestler,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Id VARCHAR) ### question:How many wrestlers are there?",SELECT COUNT(*) FROM wrestler List the names of wrestlers in descending order of days held.,"CREATE TABLE wrestler (Name VARCHAR, Days_held VARCHAR)",SELECT Name FROM wrestler ORDER BY Days_held DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Name VARCHAR, Days_held VARCHAR) ### question:List the names of wrestlers in descending order of days held.",SELECT Name FROM wrestler ORDER BY Days_held DESC What is the name of the wrestler with the fewest days held?,"CREATE TABLE wrestler (Name VARCHAR, Days_held VARCHAR)",SELECT Name FROM wrestler ORDER BY Days_held LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Name VARCHAR, Days_held VARCHAR) ### question:What is the name of the wrestler with the fewest days held?",SELECT Name FROM wrestler ORDER BY Days_held LIMIT 1 "What are the distinct reigns of wrestlers whose location is not ""Tokyo,Japan"" ?","CREATE TABLE wrestler (Reign VARCHAR, LOCATION VARCHAR)","SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> ""Tokyo , Japan""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Reign VARCHAR, LOCATION VARCHAR) ### question:What are the distinct reigns of wrestlers whose location is not ""Tokyo,Japan"" ?","SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> ""Tokyo , Japan""" What are the names and location of the wrestlers?,"CREATE TABLE wrestler (Name VARCHAR, LOCATION VARCHAR)","SELECT Name, LOCATION FROM wrestler","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Name VARCHAR, LOCATION VARCHAR) ### question:What are the names and location of the wrestlers?","SELECT Name, LOCATION FROM wrestler" "What are the elimination moves of wrestlers whose team is ""Team Orton""?","CREATE TABLE Elimination (Elimination_Move VARCHAR, Team VARCHAR)","SELECT Elimination_Move FROM Elimination WHERE Team = ""Team Orton""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Elimination (Elimination_Move VARCHAR, Team VARCHAR) ### question:What are the elimination moves of wrestlers whose team is ""Team Orton""?","SELECT Elimination_Move FROM Elimination WHERE Team = ""Team Orton""" What are the names of wrestlers and the elimination moves?,"CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE elimination (Elimination_Move VARCHAR, Wrestler_ID VARCHAR)","SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE elimination (Elimination_Move VARCHAR, Wrestler_ID VARCHAR) ### question:What are the names of wrestlers and the elimination moves?","SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID" List the names of wrestlers and the teams in elimination in descending order of days held.,"CREATE TABLE elimination (Team VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR, Days_held VARCHAR)","SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE elimination (Team VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR, Days_held VARCHAR) ### question:List the names of wrestlers and the teams in elimination in descending order of days held.","SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC" List the time of elimination of the wrestlers with largest days held.,"CREATE TABLE wrestler (Wrestler_ID VARCHAR, Days_held VARCHAR); CREATE TABLE elimination (Time VARCHAR, Wrestler_ID VARCHAR)",SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Wrestler_ID VARCHAR, Days_held VARCHAR); CREATE TABLE elimination (Time VARCHAR, Wrestler_ID VARCHAR) ### question:List the time of elimination of the wrestlers with largest days held.",SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1 Show times of elimination of wrestlers with days held more than 50.,"CREATE TABLE wrestler (Wrestler_ID VARCHAR, Days_held INTEGER); CREATE TABLE elimination (Time VARCHAR, Wrestler_ID VARCHAR)",SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Wrestler_ID VARCHAR, Days_held INTEGER); CREATE TABLE elimination (Time VARCHAR, Wrestler_ID VARCHAR) ### question:Show times of elimination of wrestlers with days held more than 50.",SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50 Show different teams in eliminations and the number of eliminations from each team.,CREATE TABLE elimination (Team VARCHAR),"SELECT Team, COUNT(*) FROM elimination GROUP BY Team","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE elimination (Team VARCHAR) ### question:Show different teams in eliminations and the number of eliminations from each team.","SELECT Team, COUNT(*) FROM elimination GROUP BY Team" Show teams that have suffered more than three eliminations.,CREATE TABLE elimination (Team VARCHAR),SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE elimination (Team VARCHAR) ### question:Show teams that have suffered more than three eliminations.",SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3 Show the reign and days held of wrestlers.,"CREATE TABLE wrestler (Reign VARCHAR, Days_held VARCHAR)","SELECT Reign, Days_held FROM wrestler","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Reign VARCHAR, Days_held VARCHAR) ### question:Show the reign and days held of wrestlers.","SELECT Reign, Days_held FROM wrestler" What are the names of wrestlers days held less than 100?,"CREATE TABLE wrestler (Name VARCHAR, Days_held INTEGER)",SELECT Name FROM wrestler WHERE Days_held < 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Name VARCHAR, Days_held INTEGER) ### question:What are the names of wrestlers days held less than 100?",SELECT Name FROM wrestler WHERE Days_held < 100 Please show the most common reigns of wrestlers.,CREATE TABLE wrestler (Reign VARCHAR),SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (Reign VARCHAR) ### question:Please show the most common reigns of wrestlers.",SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1 List the locations that are shared by more than two wrestlers.,CREATE TABLE wrestler (LOCATION VARCHAR),SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wrestler (LOCATION VARCHAR) ### question:List the locations that are shared by more than two wrestlers.",SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2 List the names of wrestlers that have not been eliminated.,"CREATE TABLE elimination (Name VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR)",SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE elimination (Name VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR) ### question:List the names of wrestlers that have not been eliminated.",SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination) "Show the teams that have both wrestlers eliminated by ""Orton"" and wrestlers eliminated by ""Benjamin"".","CREATE TABLE Elimination (Team VARCHAR, Eliminated_By VARCHAR)","SELECT Team FROM Elimination WHERE Eliminated_By = ""Orton"" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = ""Benjamin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Elimination (Team VARCHAR, Eliminated_By VARCHAR) ### question:Show the teams that have both wrestlers eliminated by ""Orton"" and wrestlers eliminated by ""Benjamin"".","SELECT Team FROM Elimination WHERE Eliminated_By = ""Orton"" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = ""Benjamin""" What is the number of distinct teams that suffer elimination?,CREATE TABLE elimination (team VARCHAR),SELECT COUNT(DISTINCT team) FROM elimination,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE elimination (team VARCHAR) ### question:What is the number of distinct teams that suffer elimination?",SELECT COUNT(DISTINCT team) FROM elimination "Show the times of elimination by ""Punk"" or ""Orton"".","CREATE TABLE elimination (TIME VARCHAR, Eliminated_By VARCHAR)","SELECT TIME FROM elimination WHERE Eliminated_By = ""Punk"" OR Eliminated_By = ""Orton""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE elimination (TIME VARCHAR, Eliminated_By VARCHAR) ### question:Show the times of elimination by ""Punk"" or ""Orton"".","SELECT TIME FROM elimination WHERE Eliminated_By = ""Punk"" OR Eliminated_By = ""Orton""" How many schools are there?,CREATE TABLE school (Id VARCHAR),SELECT COUNT(*) FROM school,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Id VARCHAR) ### question:How many schools are there?",SELECT COUNT(*) FROM school Show all school names in alphabetical order.,CREATE TABLE school (school_name VARCHAR),SELECT school_name FROM school ORDER BY school_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (school_name VARCHAR) ### question:Show all school names in alphabetical order.",SELECT school_name FROM school ORDER BY school_name "List the name, location, mascot for all schools.","CREATE TABLE school (school_name VARCHAR, LOCATION VARCHAR, mascot VARCHAR)","SELECT school_name, LOCATION, mascot FROM school","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (school_name VARCHAR, LOCATION VARCHAR, mascot VARCHAR) ### question:List the name, location, mascot for all schools.","SELECT school_name, LOCATION, mascot FROM school" What are the total and average enrollment of all schools?,CREATE TABLE school (enrollment INTEGER),"SELECT SUM(enrollment), AVG(enrollment) FROM school","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (enrollment INTEGER) ### question:What are the total and average enrollment of all schools?","SELECT SUM(enrollment), AVG(enrollment) FROM school" What are the mascots for schools with enrollments above the average?,"CREATE TABLE school (mascot VARCHAR, enrollment INTEGER)",SELECT mascot FROM school WHERE enrollment > (SELECT AVG(enrollment) FROM school),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (mascot VARCHAR, enrollment INTEGER) ### question:What are the mascots for schools with enrollments above the average?",SELECT mascot FROM school WHERE enrollment > (SELECT AVG(enrollment) FROM school) List the name of the school with the smallest enrollment.,"CREATE TABLE school (school_name VARCHAR, enrollment VARCHAR)",SELECT school_name FROM school ORDER BY enrollment LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (school_name VARCHAR, enrollment VARCHAR) ### question:List the name of the school with the smallest enrollment.",SELECT school_name FROM school ORDER BY enrollment LIMIT 1 "Show the average, maximum, minimum enrollment of all schools.",CREATE TABLE school (enrollment INTEGER),"SELECT AVG(enrollment), MAX(enrollment), MIN(enrollment) FROM school","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (enrollment INTEGER) ### question:Show the average, maximum, minimum enrollment of all schools.","SELECT AVG(enrollment), MAX(enrollment), MIN(enrollment) FROM school" Show each county along with the number of schools and total enrollment in each county.,"CREATE TABLE school (county VARCHAR, enrollment INTEGER)","SELECT county, COUNT(*), SUM(enrollment) FROM school GROUP BY county","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (county VARCHAR, enrollment INTEGER) ### question:Show each county along with the number of schools and total enrollment in each county.","SELECT county, COUNT(*), SUM(enrollment) FROM school GROUP BY county" "How many donors have endowment for school named ""Glenn""?","CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR)","SELECT COUNT(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = ""Glenn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR) ### question:How many donors have endowment for school named ""Glenn""?","SELECT COUNT(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = ""Glenn""" List each donator name and the amount of endowment in descending order of the amount of endowment.,"CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER)","SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER) ### question:List each donator name and the amount of endowment in descending order of the amount of endowment.","SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC" List the names of the schools without any endowment.,"CREATE TABLE endowment (school_name VARCHAR, school_id VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR)",SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE endowment (school_name VARCHAR, school_id VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) ### question:List the names of the schools without any endowment.",SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment) List all the names of schools with an endowment amount smaller than or equal to 10.,"CREATE TABLE school (school_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER)",SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (school_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) ### question:List all the names of schools with an endowment amount smaller than or equal to 10.",SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10 "Show the names of donors who donated to both school ""Glenn"" and ""Triton.""","CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR)",SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR) ### question:Show the names of donors who donated to both school ""Glenn"" and ""Triton.""",SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton' Show the names of all the donors except those whose donation amount less than 9.,"CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER)",SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER) ### question:Show the names of all the donors except those whose donation amount less than 9.",SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9 List the amount and donor name for the largest amount of donation.,"CREATE TABLE endowment (amount VARCHAR, donator_name VARCHAR)","SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE endowment (amount VARCHAR, donator_name VARCHAR) ### question:List the amount and donor name for the largest amount of donation.","SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1" How many budgets are above 3000 in year 2001 or before?,"CREATE TABLE budget (budgeted VARCHAR, YEAR VARCHAR)",SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE budget (budgeted VARCHAR, YEAR VARCHAR) ### question:How many budgets are above 3000 in year 2001 or before?",SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001 "Show each school name, its budgeted amount, and invested amount in year 2002 or after.","CREATE TABLE budget (budgeted VARCHAR, invested VARCHAR, school_id VARCHAR, year VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR)","SELECT T2.school_name, T1.budgeted, T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE budget (budgeted VARCHAR, invested VARCHAR, school_id VARCHAR, year VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) ### question:Show each school name, its budgeted amount, and invested amount in year 2002 or after.","SELECT T2.school_name, T1.budgeted, T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002" Show all donor names.,CREATE TABLE endowment (donator_name VARCHAR),SELECT DISTINCT donator_name FROM endowment,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE endowment (donator_name VARCHAR) ### question:Show all donor names.",SELECT DISTINCT donator_name FROM endowment How many budget record has a budget amount smaller than the invested amount?,"CREATE TABLE budget (budgeted INTEGER, invested VARCHAR)",SELECT COUNT(*) FROM budget WHERE budgeted < invested,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE budget (budgeted INTEGER, invested VARCHAR) ### question:How many budget record has a budget amount smaller than the invested amount?",SELECT COUNT(*) FROM budget WHERE budgeted < invested "What is the total budget amount for school ""Glenn"" in all years?","CREATE TABLE budget (budgeted INTEGER, school_id VARCHAR); CREATE TABLE school (school_id VARCHAR, school_name VARCHAR)",SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE budget (budgeted INTEGER, school_id VARCHAR); CREATE TABLE school (school_id VARCHAR, school_name VARCHAR) ### question:What is the total budget amount for school ""Glenn"" in all years?",SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.,"CREATE TABLE endowment (school_id VARCHAR, amount INTEGER); CREATE TABLE budget (school_id VARCHAR, budgeted INTEGER); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR)",SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING SUM(T1.budgeted) > 100 OR SUM(T3.amount) > 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE endowment (school_id VARCHAR, amount INTEGER); CREATE TABLE budget (school_id VARCHAR, budgeted INTEGER); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) ### question:Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.",SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING SUM(T1.budgeted) > 100 OR SUM(T3.amount) > 10 Find the names of schools that have more than one donator with donation amount above 8.5.,"CREATE TABLE school (School_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER)",SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (School_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) ### question:Find the names of schools that have more than one donator with donation amount above 8.5.",SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1 Find the number of schools that have more than one donator whose donation amount is less than 8.5.,"CREATE TABLE endowment (school_id VARCHAR, amount INTEGER)",SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) ### question:Find the number of schools that have more than one donator whose donation amount is less than 8.5.",SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1) "List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.","CREATE TABLE school (School_name VARCHAR, Mascot VARCHAR, IHSAA_Football_Class VARCHAR, school_id VARCHAR); CREATE TABLE budget (school_id VARCHAR, total_budget_percent_invested VARCHAR, total_budget_percent_budgeted VARCHAR)","SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested, T2.total_budget_percent_budgeted","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (School_name VARCHAR, Mascot VARCHAR, IHSAA_Football_Class VARCHAR, school_id VARCHAR); CREATE TABLE budget (school_id VARCHAR, total_budget_percent_invested VARCHAR, total_budget_percent_budgeted VARCHAR) ### question:List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.","SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested, T2.total_budget_percent_budgeted" How many buildings are there?,CREATE TABLE building (Id VARCHAR),SELECT COUNT(*) FROM building,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (Id VARCHAR) ### question:How many buildings are there?",SELECT COUNT(*) FROM building "Show the name, street address, and number of floors for all buildings ordered by the number of floors.","CREATE TABLE building (name VARCHAR, street_address VARCHAR, floors VARCHAR)","SELECT name, street_address, floors FROM building ORDER BY floors","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (name VARCHAR, street_address VARCHAR, floors VARCHAR) ### question:Show the name, street address, and number of floors for all buildings ordered by the number of floors.","SELECT name, street_address, floors FROM building ORDER BY floors" What is the name of the tallest building?,"CREATE TABLE building (name VARCHAR, height_feet VARCHAR)",SELECT name FROM building ORDER BY height_feet DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (name VARCHAR, height_feet VARCHAR) ### question:What is the name of the tallest building?",SELECT name FROM building ORDER BY height_feet DESC LIMIT 1 "What are the average, maximum, and minimum number of floors for all buildings?",CREATE TABLE building (floors INTEGER),"SELECT AVG(floors), MAX(floors), MIN(floors) FROM building","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (floors INTEGER) ### question:What are the average, maximum, and minimum number of floors for all buildings?","SELECT AVG(floors), MAX(floors), MIN(floors) FROM building" Show the number of buildings with a height above the average or a number of floors above the average.,"CREATE TABLE building (height_feet INTEGER, floors INTEGER)",SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (height_feet INTEGER, floors INTEGER) ### question:Show the number of buildings with a height above the average or a number of floors above the average.",SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building) List the names of buildings with at least 200 feet of height and with at least 20 floors.,"CREATE TABLE building (name VARCHAR, height_feet VARCHAR, floors VARCHAR)",SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (name VARCHAR, height_feet VARCHAR, floors VARCHAR) ### question:List the names of buildings with at least 200 feet of height and with at least 20 floors.",SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20 "Show the names and locations of institutions that are founded after 1990 and have the type ""Private"".","CREATE TABLE institution (institution VARCHAR, LOCATION VARCHAR, founded VARCHAR, TYPE VARCHAR)","SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (institution VARCHAR, LOCATION VARCHAR, founded VARCHAR, TYPE VARCHAR) ### question:Show the names and locations of institutions that are founded after 1990 and have the type ""Private"".","SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'" "Show institution types, along with the number of institutions and total enrollment for each type.","CREATE TABLE institution (TYPE VARCHAR, enrollment INTEGER)","SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (TYPE VARCHAR, enrollment INTEGER) ### question:Show institution types, along with the number of institutions and total enrollment for each type.","SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE" Show the institution type with the largest number of institutions.,CREATE TABLE institution (TYPE VARCHAR),SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (TYPE VARCHAR) ### question:Show the institution type with the largest number of institutions.",SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.,"CREATE TABLE institution (TYPE VARCHAR, founded VARCHAR, enrollment VARCHAR)",SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (TYPE VARCHAR, founded VARCHAR, enrollment VARCHAR) ### question:Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.",SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000 Show the name of buildings that do not have any institution.,"CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (name VARCHAR, building_id VARCHAR)",SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (name VARCHAR, building_id VARCHAR) ### question:Show the name of buildings that do not have any institution.",SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution) Show the names of buildings except for those having an institution founded in 2003.,"CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE building (name VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded VARCHAR)",SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE building (name VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded VARCHAR) ### question:Show the names of buildings except for those having an institution founded in 2003.",SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003 "For each building, show the name of the building and the number of institutions in it.","CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR)","SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR) ### question:For each building, show the name of the building and the number of institutions in it.","SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id" Show the names and heights of buildings with at least two institutions founded after 1880.,"CREATE TABLE building (name VARCHAR, height_feet VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded INTEGER)","SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE building (name VARCHAR, height_feet VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded INTEGER) ### question:Show the names and heights of buildings with at least two institutions founded after 1880.","SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2" Show all the distinct institution types.,CREATE TABLE institution (TYPE VARCHAR),SELECT DISTINCT TYPE FROM institution,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (TYPE VARCHAR) ### question:Show all the distinct institution types.",SELECT DISTINCT TYPE FROM institution Show institution names along with the number of proteins for each institution.,"CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (institution_id VARCHAR)","SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (institution_id VARCHAR) ### question:Show institution names along with the number of proteins for each institution.","SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id" "How many proteins are associated with an institution founded after 1880 or an institution with type ""Private""?","CREATE TABLE institution (institution_id VARCHAR, founded VARCHAR, type VARCHAR); CREATE TABLE protein (institution_id VARCHAR)",SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (institution_id VARCHAR, founded VARCHAR, type VARCHAR); CREATE TABLE protein (institution_id VARCHAR) ### question:How many proteins are associated with an institution founded after 1880 or an institution with type ""Private""?",SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private' Show the protein name and the institution name.,"CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (protein_name VARCHAR, institution_id VARCHAR)","SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (protein_name VARCHAR, institution_id VARCHAR) ### question:Show the protein name and the institution name.","SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id" How many proteins are associated with an institution in a building with at least 20 floors?,"CREATE TABLE institution (institution_id VARCHAR, building_id VARCHAR); CREATE TABLE building (building_id VARCHAR, floors VARCHAR); CREATE TABLE protein (institution_id VARCHAR)",SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE institution (institution_id VARCHAR, building_id VARCHAR); CREATE TABLE building (building_id VARCHAR, floors VARCHAR); CREATE TABLE protein (institution_id VARCHAR) ### question:How many proteins are associated with an institution in a building with at least 20 floors?",SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20 How many institutions do not have an associated protein in our record?,CREATE TABLE protein (institution_id VARCHAR); CREATE TABLE institution (institution_id VARCHAR),SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE protein (institution_id VARCHAR); CREATE TABLE institution (institution_id VARCHAR) ### question:How many institutions do not have an associated protein in our record?",SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein) Show all the locations where no cinema has capacity over 800.,"CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER)",SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) ### question:Show all the locations where no cinema has capacity over 800.",SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800 Show all the locations where some cinemas were opened in both year 2010 and year 2011.,"CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR)",SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR) ### question:Show all the locations where some cinemas were opened in both year 2010 and year 2011.",SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011 How many cinema do we have?,CREATE TABLE cinema (Id VARCHAR),SELECT COUNT(*) FROM cinema,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (Id VARCHAR) ### question:How many cinema do we have?",SELECT COUNT(*) FROM cinema "Show name, opening year, and capacity for each cinema.","CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR, capacity VARCHAR)","SELECT name, openning_year, capacity FROM cinema","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR, capacity VARCHAR) ### question:Show name, opening year, and capacity for each cinema.","SELECT name, openning_year, capacity FROM cinema" Show the cinema name and location for cinemas with capacity above average.,"CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity INTEGER)","SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity INTEGER) ### question:Show the cinema name and location for cinemas with capacity above average.","SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema)" What are all the locations with a cinema?,CREATE TABLE cinema (LOCATION VARCHAR),SELECT DISTINCT LOCATION FROM cinema,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (LOCATION VARCHAR) ### question:What are all the locations with a cinema?",SELECT DISTINCT LOCATION FROM cinema Show all the cinema names and opening years in descending order of opening year.,"CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR)","SELECT name, openning_year FROM cinema ORDER BY openning_year DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR) ### question:Show all the cinema names and opening years in descending order of opening year.","SELECT name, openning_year FROM cinema ORDER BY openning_year DESC" What are the name and location of the cinema with the largest capacity?,"CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity VARCHAR)","SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity VARCHAR) ### question:What are the name and location of the cinema with the largest capacity?","SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1" "Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.","CREATE TABLE cinema (capacity INTEGER, openning_year VARCHAR)","SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (capacity INTEGER, openning_year VARCHAR) ### question:Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.","SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011" Show each location and the number of cinemas there.,CREATE TABLE cinema (LOCATION VARCHAR),"SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (LOCATION VARCHAR) ### question:Show each location and the number of cinemas there.","SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION" What is the location with the most cinemas opened in year 2010 or later?,"CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR)",SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR) ### question:What is the location with the most cinemas opened in year 2010 or later?",SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 Show all the locations with at least two cinemas with capacity above 300.,"CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER)",SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) ### question:Show all the locations with at least two cinemas with capacity above 300.",SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2 Show the title and director for all films.,"CREATE TABLE film (title VARCHAR, directed_by VARCHAR)","SELECT title, directed_by FROM film","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, directed_by VARCHAR) ### question:Show the title and director for all films.","SELECT title, directed_by FROM film" Show all directors.,CREATE TABLE film (directed_by VARCHAR),SELECT DISTINCT directed_by FROM film,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (directed_by VARCHAR) ### question:Show all directors.",SELECT DISTINCT directed_by FROM film List all directors along with the number of films directed by each director.,CREATE TABLE film (directed_by VARCHAR),"SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (directed_by VARCHAR) ### question:List all directors along with the number of films directed by each director.","SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by" What is total number of show times per dat for each cinema?,"CREATE TABLE schedule (show_times_per_day INTEGER, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR)","SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE schedule (show_times_per_day INTEGER, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR) ### question:What is total number of show times per dat for each cinema?","SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id" What are the title and maximum price of each film?,"CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE schedule (price INTEGER, film_id VARCHAR)","SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE schedule (price INTEGER, film_id VARCHAR) ### question:What are the title and maximum price of each film?","SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id" "Show cinema name, film title, date, and price for each record in schedule.","CREATE TABLE schedule (date VARCHAR, price VARCHAR, film_id VARCHAR, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR)","SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE schedule (date VARCHAR, price VARCHAR, film_id VARCHAR, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR) ### question:Show cinema name, film title, date, and price for each record in schedule.","SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id" What are the title and director of the films without any schedule?,"CREATE TABLE schedule (title VARCHAR, directed_by VARCHAR, film_id VARCHAR); CREATE TABLE film (title VARCHAR, directed_by VARCHAR, film_id VARCHAR)","SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE schedule (title VARCHAR, directed_by VARCHAR, film_id VARCHAR); CREATE TABLE film (title VARCHAR, directed_by VARCHAR, film_id VARCHAR) ### question:What are the title and director of the films without any schedule?","SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule)" Show director with the largest number of show times in total.,"CREATE TABLE schedule (film_id VARCHAR, show_times_per_day INTEGER); CREATE TABLE film (directed_by VARCHAR, film_id VARCHAR)",SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE schedule (film_id VARCHAR, show_times_per_day INTEGER); CREATE TABLE film (directed_by VARCHAR, film_id VARCHAR) ### question:Show director with the largest number of show times in total.",SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1 Find the locations that have more than one movie theater with capacity above 300.,"CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER)",SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) ### question:Find the locations that have more than one movie theater with capacity above 300.",SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1 How many films have the word 'Dummy' in their titles?,CREATE TABLE film (title VARCHAR),"SELECT COUNT(*) FROM film WHERE title LIKE ""%Dummy%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR) ### question:How many films have the word 'Dummy' in their titles?","SELECT COUNT(*) FROM film WHERE title LIKE ""%Dummy%""" Are the customers holding coupons with amount 500 bad or good?,"CREATE TABLE discount_coupons (coupon_id VARCHAR, coupon_amount VARCHAR); CREATE TABLE customers (good_or_bad_customer VARCHAR, coupon_id VARCHAR)",SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE discount_coupons (coupon_id VARCHAR, coupon_amount VARCHAR); CREATE TABLE customers (good_or_bad_customer VARCHAR, coupon_id VARCHAR) ### question:Are the customers holding coupons with amount 500 bad or good?",SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500 "How many bookings did each customer make? List the customer id, first name, and the count.","CREATE TABLE bookings (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR)","SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bookings (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR) ### question:How many bookings did each customer make? List the customer id, first name, and the count.","SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id" What is the maximum total amount paid by a customer? List the customer id and amount.,"CREATE TABLE Payments (customer_id VARCHAR, amount_paid INTEGER)","SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Payments (customer_id VARCHAR, amount_paid INTEGER) ### question:What is the maximum total amount paid by a customer? List the customer id and amount.","SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1" What are the id and the amount of refund of the booking that incurred the most times of payments?,"CREATE TABLE Payments (booking_id VARCHAR); CREATE TABLE Bookings (booking_id VARCHAR, amount_of_refund VARCHAR)","SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Payments (booking_id VARCHAR); CREATE TABLE Bookings (booking_id VARCHAR, amount_of_refund VARCHAR) ### question:What are the id and the amount of refund of the booking that incurred the most times of payments?","SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY COUNT(*) DESC LIMIT 1" What is the id of the product that is booked for 3 times?,CREATE TABLE products_booked (product_id VARCHAR),SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products_booked (product_id VARCHAR) ### question:What is the id of the product that is booked for 3 times?",SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3 What is the product description of the product booked with an amount of 102.76?,"CREATE TABLE products_for_hire (product_description VARCHAR, product_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booked_amount VARCHAR)",SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products_for_hire (product_description VARCHAR, product_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booked_amount VARCHAR) ### question:What is the product description of the product booked with an amount of 102.76?",SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76 What are the start date and end date of the booking that has booked the product named 'Book collection A'?,"CREATE TABLE bookings (booking_start_date VARCHAR, booking_end_date VARCHAR, booking_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booking_id VARCHAR); CREATE TABLE Products_for_hire (product_id VARCHAR, product_name VARCHAR)","SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bookings (booking_start_date VARCHAR, booking_end_date VARCHAR, booking_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booking_id VARCHAR); CREATE TABLE Products_for_hire (product_id VARCHAR, product_name VARCHAR) ### question:What are the start date and end date of the booking that has booked the product named 'Book collection A'?","SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'" What are the names of products whose availability equals to 1?,"CREATE TABLE view_product_availability (product_id VARCHAR, available_yn VARCHAR); CREATE TABLE products_for_hire (product_name VARCHAR, product_id VARCHAR)",SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE view_product_availability (product_id VARCHAR, available_yn VARCHAR); CREATE TABLE products_for_hire (product_name VARCHAR, product_id VARCHAR) ### question:What are the names of products whose availability equals to 1?",SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1 How many different product types are there?,CREATE TABLE products_for_hire (product_type_code VARCHAR),SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products_for_hire (product_type_code VARCHAR) ### question:How many different product types are there?",SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire "What are the first name, last name, and gender of all the good customers? Order by their last name.","CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, gender_mf VARCHAR, good_or_bad_customer VARCHAR)","SELECT first_name, last_name, gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, gender_mf VARCHAR, good_or_bad_customer VARCHAR) ### question:What are the first name, last name, and gender of all the good customers? Order by their last name.","SELECT first_name, last_name, gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name" What is the average amount due for all the payments?,CREATE TABLE payments (amount_due INTEGER),SELECT AVG(amount_due) FROM payments,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payments (amount_due INTEGER) ### question:What is the average amount due for all the payments?",SELECT AVG(amount_due) FROM payments "What are the maximum, minimum, and average booked count for the products booked?",CREATE TABLE products_booked (booked_count INTEGER),"SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products_booked (booked_count INTEGER) ### question:What are the maximum, minimum, and average booked count for the products booked?","SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked" What are all the distinct payment types?,CREATE TABLE payments (payment_type_code VARCHAR),SELECT DISTINCT payment_type_code FROM payments,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payments (payment_type_code VARCHAR) ### question:What are all the distinct payment types?",SELECT DISTINCT payment_type_code FROM payments What are the daily hire costs for the products with substring 'Book' in its name?,"CREATE TABLE Products_for_hire (daily_hire_cost VARCHAR, product_name VARCHAR)",SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products_for_hire (daily_hire_cost VARCHAR, product_name VARCHAR) ### question:What are the daily hire costs for the products with substring 'Book' in its name?",SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%' How many products are never booked with amount higher than 200?,"CREATE TABLE products_booked (product_id VARCHAR, booked_amount INTEGER); CREATE TABLE Products_for_hire (product_id VARCHAR, booked_amount INTEGER)",SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products_booked (product_id VARCHAR, booked_amount INTEGER); CREATE TABLE Products_for_hire (product_id VARCHAR, booked_amount INTEGER) ### question:How many products are never booked with amount higher than 200?",SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200) What are the coupon amount of the coupons owned by both good and bad customers?,"CREATE TABLE Discount_Coupons (coupon_amount VARCHAR, coupon_id VARCHAR); CREATE TABLE customers (coupon_id VARCHAR, good_or_bad_customer VARCHAR)",SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Discount_Coupons (coupon_amount VARCHAR, coupon_id VARCHAR); CREATE TABLE customers (coupon_id VARCHAR, good_or_bad_customer VARCHAR) ### question:What are the coupon amount of the coupons owned by both good and bad customers?",SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad' What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check',"CREATE TABLE payments (payment_date VARCHAR, amount_paid VARCHAR, payment_type_code VARCHAR)",SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payments (payment_date VARCHAR, amount_paid VARCHAR, payment_type_code VARCHAR) ### question:What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check'",SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check' What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?,"CREATE TABLE products_for_hire (product_name VARCHAR, product_description VARCHAR, product_type_code VARCHAR, daily_hire_cost VARCHAR)","SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products_for_hire (product_name VARCHAR, product_description VARCHAR, product_type_code VARCHAR, daily_hire_cost VARCHAR) ### question:What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?","SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20" How many phones are there?,CREATE TABLE phone (Id VARCHAR),SELECT COUNT(*) FROM phone,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Id VARCHAR) ### question:How many phones are there?",SELECT COUNT(*) FROM phone List the names of phones in ascending order of price.,"CREATE TABLE phone (Name VARCHAR, Price VARCHAR)",SELECT Name FROM phone ORDER BY Price,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Name VARCHAR, Price VARCHAR) ### question:List the names of phones in ascending order of price.",SELECT Name FROM phone ORDER BY Price What are the memories and carriers of phones?,"CREATE TABLE phone (Memory_in_G VARCHAR, Carrier VARCHAR)","SELECT Memory_in_G, Carrier FROM phone","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Memory_in_G VARCHAR, Carrier VARCHAR) ### question:What are the memories and carriers of phones?","SELECT Memory_in_G, Carrier FROM phone" List the distinct carriers of phones with memories bigger than 32.,"CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER)",SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER) ### question:List the distinct carriers of phones with memories bigger than 32.",SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32 "Show the names of phones with carrier either ""Sprint"" or ""TMobile"".","CREATE TABLE phone (Name VARCHAR, Carrier VARCHAR)","SELECT Name FROM phone WHERE Carrier = ""Sprint"" OR Carrier = ""TMobile""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Name VARCHAR, Carrier VARCHAR) ### question:Show the names of phones with carrier either ""Sprint"" or ""TMobile"".","SELECT Name FROM phone WHERE Carrier = ""Sprint"" OR Carrier = ""TMobile""" What is the carrier of the most expensive phone?,"CREATE TABLE phone (Carrier VARCHAR, Price VARCHAR)",SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Carrier VARCHAR, Price VARCHAR) ### question:What is the carrier of the most expensive phone?",SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1 Show different carriers of phones together with the number of phones with each carrier.,CREATE TABLE phone (Carrier VARCHAR),"SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Carrier VARCHAR) ### question:Show different carriers of phones together with the number of phones with each carrier.","SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier" Show the most frequently used carrier of the phones.,CREATE TABLE phone (Carrier VARCHAR),SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Carrier VARCHAR) ### question:Show the most frequently used carrier of the phones.",SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1 Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.,"CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER)",SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER) ### question: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 Show the names of phones and the districts of markets they are on.,"CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE market (District VARCHAR, Market_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE market (District VARCHAR, Market_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) ### question: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" "Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.","CREATE TABLE market (District VARCHAR, Market_ID VARCHAR, Ranking VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE market (District VARCHAR, Market_ID VARCHAR, Ranking VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) ### question: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" Show the names of phones that are on market with number of shops greater than 50.,"CREATE TABLE market (Market_ID VARCHAR, Num_of_shops INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE market (Market_ID VARCHAR, Num_of_shops INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) ### question: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 "For each phone, show its names and total number of stocks.","CREATE TABLE phone_market (Num_of_stock INTEGER, Phone_ID VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone_market (Num_of_stock INTEGER, Phone_ID VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR) ### question: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" "Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.","CREATE TABLE phone_market (Phone_ID VARCHAR, Num_of_stock INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone_market (Phone_ID VARCHAR, Num_of_stock INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR) ### question: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 List the names of phones that are not on any market.,"CREATE TABLE phone (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR)",SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_market),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE phone (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR) ### question:List the names of phones that are not on any market.",SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_market) How many gas companies are there?,CREATE TABLE company (Id VARCHAR),SELECT COUNT(*) FROM company,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Id VARCHAR) ### question:How many gas companies are there?",SELECT COUNT(*) FROM company List the company name and rank for all companies in the decreasing order of their sales.,"CREATE TABLE company (company VARCHAR, rank VARCHAR, Sales_billion VARCHAR)","SELECT company, rank FROM company ORDER BY Sales_billion DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (company VARCHAR, rank VARCHAR, Sales_billion VARCHAR) ### question:List the company name and rank for all companies in the decreasing order of their sales.","SELECT company, rank FROM company ORDER BY Sales_billion DESC" Show the company name and the main industry for all companies whose headquarters are not from USA.,"CREATE TABLE company (company VARCHAR, main_industry VARCHAR, headquarters VARCHAR)","SELECT company, main_industry FROM company WHERE headquarters <> 'USA'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (company VARCHAR, main_industry VARCHAR, headquarters VARCHAR) ### question:Show the company name and the main industry for all companies whose headquarters are not from USA.","SELECT company, main_industry FROM company WHERE headquarters <> 'USA'" Show all company names and headquarters in the descending order of market value.,"CREATE TABLE company (company VARCHAR, headquarters VARCHAR, market_value VARCHAR)","SELECT company, headquarters FROM company ORDER BY market_value DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (company VARCHAR, headquarters VARCHAR, market_value VARCHAR) ### question:Show all company names and headquarters in the descending order of market value.","SELECT company, headquarters FROM company ORDER BY market_value DESC" "Show minimum, maximum, and average market value for all companies.",CREATE TABLE company (market_value INTEGER),"SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (market_value INTEGER) ### question:Show minimum, maximum, and average market value for all companies.","SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company" Show all main industry for all companies.,CREATE TABLE company (main_industry VARCHAR),SELECT DISTINCT main_industry FROM company,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (main_industry VARCHAR) ### question:Show all main industry for all companies.",SELECT DISTINCT main_industry FROM company List all headquarters and the number of companies in each headquarter.,CREATE TABLE company (headquarters VARCHAR),"SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (headquarters VARCHAR) ### question:List all headquarters and the number of companies in each headquarter.","SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters" Show all main industry and total market value in each industry.,"CREATE TABLE company (main_industry VARCHAR, market_value INTEGER)","SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (main_industry VARCHAR, market_value INTEGER) ### question:Show all main industry and total market value in each industry.","SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry" List the main industry with highest total market value and its number of companies.,"CREATE TABLE company (main_industry VARCHAR, market_value INTEGER)","SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (main_industry VARCHAR, market_value INTEGER) ### question:List the main industry with highest total market value and its number of companies.","SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1" Show headquarters with at least two companies in the banking industry.,"CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)",SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR) ### question:Show headquarters with at least two companies in the banking industry.",SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2 "Show gas station id, location, and manager_name for all gas stations ordered by open year.","CREATE TABLE gas_station (station_id VARCHAR, LOCATION VARCHAR, manager_name VARCHAR, open_year VARCHAR)","SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (station_id VARCHAR, LOCATION VARCHAR, manager_name VARCHAR, open_year VARCHAR) ### question:Show gas station id, location, and manager_name for all gas stations ordered by open year.","SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year" How many gas station are opened between 2000 and 2005?,CREATE TABLE gas_station (open_year INTEGER),SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (open_year INTEGER) ### question:How many gas station are opened between 2000 and 2005?",SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005 Show all locations and the number of gas stations in each location ordered by the count.,CREATE TABLE gas_station (LOCATION VARCHAR),"SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (LOCATION VARCHAR) ### question:Show all locations and the number of gas stations in each location ordered by the count.","SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*)" Show all headquarters with both a company in banking industry and a company in Oil and gas.,"CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)",SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR) ### question:Show all headquarters with both a company in banking industry and a company in Oil and gas.",SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas' Show all headquarters without a company in banking industry.,"CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)",SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR) ### question:Show all headquarters without a company in banking industry.",SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking' Show the company name with the number of gas station.,"CREATE TABLE station_company (company_id VARCHAR); CREATE TABLE company (company VARCHAR, company_id VARCHAR)","SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station_company (company_id VARCHAR); CREATE TABLE company (company VARCHAR, company_id VARCHAR) ### question:Show the company name with the number of gas station.","SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id" Show company name and main industry without a gas station.,"CREATE TABLE station_company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR); CREATE TABLE company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR)","SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station_company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR); CREATE TABLE company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR) ### question:Show company name and main industry without a gas station.","SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)" Show the manager name for gas stations belonging to the ExxonMobil company.,"CREATE TABLE gas_station (manager_name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, company VARCHAR)",SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (manager_name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, company VARCHAR) ### question:Show the manager name for gas stations belonging to the ExxonMobil company.",SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil' Show all locations where a gas station for company with market value greater than 100 is located.,"CREATE TABLE gas_station (location VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, market_value INTEGER); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR)",SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (location VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, market_value INTEGER); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR) ### question:Show all locations where a gas station for company with market value greater than 100 is located.",SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100 Show the manager name with most number of gas stations opened after 2000.,"CREATE TABLE gas_station (manager_name VARCHAR, open_year INTEGER)",SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (manager_name VARCHAR, open_year INTEGER) ### question:Show the manager name with most number of gas stations opened after 2000.",SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1 order all gas station locations by the opening year.,"CREATE TABLE gas_station (LOCATION VARCHAR, open_year VARCHAR)",SELECT LOCATION FROM gas_station ORDER BY open_year,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (LOCATION VARCHAR, open_year VARCHAR) ### question:order all gas station locations by the opening year.",SELECT LOCATION FROM gas_station ORDER BY open_year "find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.","CREATE TABLE company (rank VARCHAR, company VARCHAR, market_value VARCHAR, main_industry VARCHAR, sales_billion VARCHAR, profits_billion VARCHAR)","SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (rank VARCHAR, company VARCHAR, market_value VARCHAR, main_industry VARCHAR, sales_billion VARCHAR, profits_billion VARCHAR) ### question:find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.","SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion" find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.,"CREATE TABLE gas_station (location VARCHAR, Representative_Name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, Assets_billion VARCHAR)","SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE gas_station (location VARCHAR, Representative_Name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, Assets_billion VARCHAR) ### question:find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.","SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3" How many regions do we have?,CREATE TABLE region (Id VARCHAR),SELECT COUNT(*) FROM region,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (Id VARCHAR) ### question:How many regions do we have?",SELECT COUNT(*) FROM region Show all distinct region names ordered by their labels.,"CREATE TABLE region (region_name VARCHAR, Label VARCHAR)",SELECT DISTINCT region_name FROM region ORDER BY Label,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR, Label VARCHAR) ### question:Show all distinct region names ordered by their labels.",SELECT DISTINCT region_name FROM region ORDER BY Label How many parties do we have?,CREATE TABLE party (party_name VARCHAR),SELECT COUNT(DISTINCT party_name) FROM party,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_name VARCHAR) ### question:How many parties do we have?",SELECT COUNT(DISTINCT party_name) FROM party "Show the ministers and the time they took and left office, listed by the time they left office.","CREATE TABLE party (minister VARCHAR, took_office VARCHAR, left_office VARCHAR)","SELECT minister, took_office, left_office FROM party ORDER BY left_office","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (minister VARCHAR, took_office VARCHAR, left_office VARCHAR) ### question:Show the ministers and the time they took and left office, listed by the time they left office.","SELECT minister, took_office, left_office FROM party ORDER BY left_office" Show the minister who took office after 1961 or before 1959.,"CREATE TABLE party (minister VARCHAR, took_office VARCHAR)",SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (minister VARCHAR, took_office VARCHAR) ### question:Show the minister who took office after 1961 or before 1959.",SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959 Show all ministers who do not belong to Progress Party.,"CREATE TABLE party (minister VARCHAR, party_name VARCHAR)",SELECT minister FROM party WHERE party_name <> 'Progress Party',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (minister VARCHAR, party_name VARCHAR) ### question:Show all ministers who do not belong to Progress Party.",SELECT minister FROM party WHERE party_name <> 'Progress Party' Show all ministers and parties they belong to in descending order of the time they took office.,"CREATE TABLE party (minister VARCHAR, party_name VARCHAR, took_office VARCHAR)","SELECT minister, party_name FROM party ORDER BY took_office DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (minister VARCHAR, party_name VARCHAR, took_office VARCHAR) ### question:Show all ministers and parties they belong to in descending order of the time they took office.","SELECT minister, party_name FROM party ORDER BY took_office DESC" Return the minister who left office at the latest time.,"CREATE TABLE party (minister VARCHAR, left_office VARCHAR)",SELECT minister FROM party ORDER BY left_office DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (minister VARCHAR, left_office VARCHAR) ### question:Return the minister who left office at the latest time.",SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 List member names and their party names.,"CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)","SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR) ### question:List member names and their party names.","SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id" Show all party names and the number of members in each party.,"CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)","SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR) ### question:Show all party names and the number of members in each party.","SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id" What is the name of party with most number of members?,"CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)",SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR) ### question:What is the name of party with most number of members?",SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1 Show all party names and their region names.,"CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE party (party_name VARCHAR, region_id VARCHAR)","SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE party (party_name VARCHAR, region_id VARCHAR) ### question:Show all party names and their region names.","SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id" Show names of parties that does not have any members.,"CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_name VARCHAR, party_id VARCHAR)",SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_name VARCHAR, party_id VARCHAR) ### question:Show names of parties that does not have any members.",SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member) Show the member names which are in both the party with id 3 and the party with id 1.,"CREATE TABLE member (member_name VARCHAR, party_id VARCHAR)",SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (member_name VARCHAR, party_id VARCHAR) ### question:Show the member names which are in both the party with id 3 and the party with id 1.",SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1 Show member names that are not in the Progress Party.,"CREATE TABLE party (party_id VARCHAR, Party_name VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)","SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> ""Progress Party""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_id VARCHAR, Party_name VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR) ### question:Show member names that are not in the Progress Party.","SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> ""Progress Party""" How many party events do we have?,CREATE TABLE party_events (Id VARCHAR),SELECT COUNT(*) FROM party_events,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party_events (Id VARCHAR) ### question:How many party events do we have?",SELECT COUNT(*) FROM party_events Show party names and the number of events for each party.,"CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)","SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR) ### question:Show party names and the number of events for each party.","SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id" Show all member names who are not in charge of any event.,"CREATE TABLE member (member_name VARCHAR); CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR)",SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (member_name VARCHAR); CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR) ### question:Show all member names who are not in charge of any event.",SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id What are the names of parties with at least 2 events?,"CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)",SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR) ### question:What are the names of parties with at least 2 events?",SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2 What is the name of member in charge of greatest number of events?,"CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR)",SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR) ### question:What is the name of member in charge of greatest number of events?",SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1 find the event names that have more than 2 records.,CREATE TABLE party_events (event_name VARCHAR),SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party_events (event_name VARCHAR) ### question:find the event names that have more than 2 records.",SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2 How many Annual Meeting events happened in the United Kingdom region?,"CREATE TABLE party_events (party_id VARCHAR, Event_Name VARCHAR); CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE party (region_id VARCHAR, party_id VARCHAR)","SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = ""United Kingdom"" AND t3.Event_Name = ""Annaual Meeting""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party_events (party_id VARCHAR, Event_Name VARCHAR); CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE party (region_id VARCHAR, party_id VARCHAR) ### question:How many Annual Meeting events happened in the United Kingdom region?","SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = ""United Kingdom"" AND t3.Event_Name = ""Annaual Meeting""" How many pilots are there?,CREATE TABLE pilot (Id VARCHAR),SELECT COUNT(*) FROM pilot,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Id VARCHAR) ### question:How many pilots are there?",SELECT COUNT(*) FROM pilot List the names of pilots in ascending order of rank.,"CREATE TABLE pilot (Pilot_name VARCHAR, Rank VARCHAR)",SELECT Pilot_name FROM pilot ORDER BY Rank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Pilot_name VARCHAR, Rank VARCHAR) ### question:List the names of pilots in ascending order of rank.",SELECT Pilot_name FROM pilot ORDER BY Rank What are the positions and teams of pilots?,"CREATE TABLE pilot (POSITION VARCHAR, Team VARCHAR)","SELECT POSITION, Team FROM pilot","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (POSITION VARCHAR, Team VARCHAR) ### question:What are the positions and teams of pilots?","SELECT POSITION, Team FROM pilot" List the distinct positions of pilots older than 30.,"CREATE TABLE pilot (POSITION VARCHAR, Age INTEGER)",SELECT DISTINCT POSITION FROM pilot WHERE Age > 30,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (POSITION VARCHAR, Age INTEGER) ### question:List the distinct positions of pilots older than 30.",SELECT DISTINCT POSITION FROM pilot WHERE Age > 30 "Show the names of pilots from team ""Bradley"" or ""Fordham"".","CREATE TABLE pilot (Pilot_name VARCHAR, Team VARCHAR)","SELECT Pilot_name FROM pilot WHERE Team = ""Bradley"" OR Team = ""Fordham""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Pilot_name VARCHAR, Team VARCHAR) ### question:Show the names of pilots from team ""Bradley"" or ""Fordham"".","SELECT Pilot_name FROM pilot WHERE Team = ""Bradley"" OR Team = ""Fordham""" What is the joined year of the pilot of the highest rank?,"CREATE TABLE pilot (Join_Year VARCHAR, Rank VARCHAR)",SELECT Join_Year FROM pilot ORDER BY Rank LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Join_Year VARCHAR, Rank VARCHAR) ### question:What is the joined year of the pilot of the highest rank?",SELECT Join_Year FROM pilot ORDER BY Rank LIMIT 1 What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.,CREATE TABLE pilot (Nationality VARCHAR),"SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Nationality VARCHAR) ### question:What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.","SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality" Show the most common nationality of pilots.,CREATE TABLE pilot (Nationality VARCHAR),SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Nationality VARCHAR) ### question:Show the most common nationality of pilots.",SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.,"CREATE TABLE pilot (POSITION VARCHAR, Join_Year INTEGER)",SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (POSITION VARCHAR, Join_Year INTEGER) ### question:Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.",SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005 Show the names of pilots and models of aircrafts they have flied with.,"CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Model VARCHAR, Aircraft_ID VARCHAR)","SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Model VARCHAR, Aircraft_ID VARCHAR) ### question:Show the names of pilots and models of aircrafts they have flied with.","SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID" Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.,"CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR, Rank VARCHAR); CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR)","SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR, Rank VARCHAR); CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR) ### question:Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.","SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank" Show the fleet series of the aircrafts flied by pilots younger than 34,"CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_ID VARCHAR, Age INTEGER); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR)",SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_ID VARCHAR, Age INTEGER); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR) ### question:Show the fleet series of the aircrafts flied by pilots younger than 34",SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34 Show the names of pilots and the number of records they have.,"CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)","SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR) ### question:Show the names of pilots and the number of records they have.","SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name" Show names of pilots that have more than one record.,"CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)","SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR) ### question:Show names of pilots that have more than one record.","SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1" List the names of pilots that do not have any record.,"CREATE TABLE pilot_record (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR)",SELECT Pilot_name FROM pilot WHERE NOT Pilot_ID IN (SELECT Pilot_ID FROM pilot_record),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot_record (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR) ### question:List the names of pilots that do not have any record.",SELECT Pilot_name FROM pilot WHERE NOT Pilot_ID IN (SELECT Pilot_ID FROM pilot_record) What document status codes do we have?,CREATE TABLE Ref_Document_Status (document_status_code VARCHAR),SELECT document_status_code FROM Ref_Document_Status,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Document_Status (document_status_code VARCHAR) ### question:What document status codes do we have?",SELECT document_status_code FROM Ref_Document_Status What is the description of document status code 'working'?,"CREATE TABLE Ref_Document_Status (document_status_description VARCHAR, document_status_code VARCHAR)","SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = ""working""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Document_Status (document_status_description VARCHAR, document_status_code VARCHAR) ### question:What is the description of document status code 'working'?","SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = ""working""" What document type codes do we have?,CREATE TABLE Ref_Document_Types (document_type_code VARCHAR),SELECT document_type_code FROM Ref_Document_Types,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Document_Types (document_type_code VARCHAR) ### question:What document type codes do we have?",SELECT document_type_code FROM Ref_Document_Types What is the description of document type 'Paper'?,"CREATE TABLE Ref_Document_Types (document_type_description VARCHAR, document_type_code VARCHAR)","SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = ""Paper""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Document_Types (document_type_description VARCHAR, document_type_code VARCHAR) ### question:What is the description of document type 'Paper'?","SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = ""Paper""" What are the shipping agent names?,CREATE TABLE Ref_Shipping_Agents (shipping_agent_name VARCHAR),SELECT shipping_agent_name FROM Ref_Shipping_Agents,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Shipping_Agents (shipping_agent_name VARCHAR) ### question:What are the shipping agent names?",SELECT shipping_agent_name FROM Ref_Shipping_Agents What is the shipping agent code of shipping agent UPS?,"CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR, shipping_agent_name VARCHAR)","SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = ""UPS""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR, shipping_agent_name VARCHAR) ### question:What is the shipping agent code of shipping agent UPS?","SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = ""UPS""" What are all role codes?,CREATE TABLE ROLES (role_code VARCHAR),SELECT role_code FROM ROLES,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_code VARCHAR) ### question:What are all role codes?",SELECT role_code FROM ROLES What is the description of role code ED?,"CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR)","SELECT role_description FROM ROLES WHERE role_code = ""ED""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR) ### question:What is the description of role code ED?","SELECT role_description FROM ROLES WHERE role_code = ""ED""" How many employees do we have?,CREATE TABLE Employees (Id VARCHAR),SELECT COUNT(*) FROM Employees,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (Id VARCHAR) ### question:How many employees do we have?",SELECT COUNT(*) FROM Employees What is the role of the employee named Koby?,"CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR)","SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = ""Koby""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR) ### question:What is the role of the employee named Koby?","SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = ""Koby""" List all document ids and receipt dates of documents.,"CREATE TABLE Documents (document_id VARCHAR, receipt_date VARCHAR)","SELECT document_id, receipt_date FROM Documents","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_id VARCHAR, receipt_date VARCHAR) ### question:List all document ids and receipt dates of documents.","SELECT document_id, receipt_date FROM Documents" "How many employees does each role have? List role description, id and number of employees.","CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR)","SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR) ### question:How many employees does each role have? List role description, id and number of employees.","SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code" List roles that have more than one employee. List the role description and number of employees.,CREATE TABLE ROLES (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR),"SELECT Roles.role_description, COUNT(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING COUNT(Employees.employee_id) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR) ### question:List roles that have more than one employee. List the role description and number of employees.","SELECT Roles.role_description, COUNT(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING COUNT(Employees.employee_id) > 1" What is the document status description of the document with id 1?,CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Document_Status (Id VARCHAR),SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Document_Status (Id VARCHAR) ### question:What is the document status description of the document with id 1?",SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1 How many documents have the status code done?,CREATE TABLE Documents (document_status_code VARCHAR),"SELECT COUNT(*) FROM Documents WHERE document_status_code = ""done""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_status_code VARCHAR) ### question:How many documents have the status code done?","SELECT COUNT(*) FROM Documents WHERE document_status_code = ""done""" List the document type code for the document with the id 2.,"CREATE TABLE Documents (document_type_code VARCHAR, document_id VARCHAR)",SELECT document_type_code FROM Documents WHERE document_id = 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_type_code VARCHAR, document_id VARCHAR) ### question:List the document type code for the document with the id 2.",SELECT document_type_code FROM Documents WHERE document_id = 2 List the document ids for any documents with the status code done and the type code paper.,"CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)","SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR) ### question:List the document ids for any documents with the status code done and the type code paper.","SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper""" What is the name of the shipping agent of the document with id 2?,CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR),SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR) ### question:What is the name of the shipping agent of the document with id 2?",SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2 How many documents were shipped by USPS?,CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR),"SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR) ### question:How many documents were shipped by USPS?","SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS""" Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.,CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR),"SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR) ### question:Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.","SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1" What is the receipt date of the document with id 3?,"CREATE TABLE Documents (receipt_date VARCHAR, document_id VARCHAR)",SELECT receipt_date FROM Documents WHERE document_id = 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (receipt_date VARCHAR, document_id VARCHAR) ### question:What is the receipt date of the document with id 3?",SELECT receipt_date FROM Documents WHERE document_id = 3 What address was the document with id 4 mailed to?,CREATE TABLE Addresses (document_id VARCHAR); CREATE TABLE Documents_Mailed (document_id VARCHAR),SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (document_id VARCHAR); CREATE TABLE Documents_Mailed (document_id VARCHAR) ### question:What address was the document with id 4 mailed to?",SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4 What is the mail date of the document with id 7?,"CREATE TABLE Documents_Mailed (mailing_date VARCHAR, document_id VARCHAR)",SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_Mailed (mailing_date VARCHAR, document_id VARCHAR) ### question:What is the mail date of the document with id 7?",SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7 "List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.","CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)","SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper"" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR) ### question:List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.","SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper"" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS""" List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.,"CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)","SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper"" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR) ### question:List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.","SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper"" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS""" What is draft detail of the document with id 7?,"CREATE TABLE Document_Drafts (draft_details VARCHAR, document_id VARCHAR)",SELECT draft_details FROM Document_Drafts WHERE document_id = 7,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_Drafts (draft_details VARCHAR, document_id VARCHAR) ### question:What is draft detail of the document with id 7?",SELECT draft_details FROM Document_Drafts WHERE document_id = 7 How many draft copies does the document with id 2 have?,CREATE TABLE Draft_Copies (document_id VARCHAR),SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Draft_Copies (document_id VARCHAR) ### question:How many draft copies does the document with id 2 have?",SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2 Which document has the most draft copies? List its document id and number of draft copies.,"CREATE TABLE Draft_Copies (document_id VARCHAR, copy_number VARCHAR)","SELECT document_id, COUNT(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY COUNT(copy_number) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Draft_Copies (document_id VARCHAR, copy_number VARCHAR) ### question:Which document has the most draft copies? List its document id and number of draft copies.","SELECT document_id, COUNT(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY COUNT(copy_number) DESC LIMIT 1" Which documents have more than 1 draft copies? List document id and number of draft copies.,CREATE TABLE Draft_Copies (document_id VARCHAR),"SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Draft_Copies (document_id VARCHAR) ### question:Which documents have more than 1 draft copies? List document id and number of draft copies.","SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1" List all employees in the circulation history of the document with id 1. List the employee's name.,CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR),SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR) ### question:List all employees in the circulation history of the document with id 1. List the employee's name.",SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1 List the employees who have not showed up in any circulation history of documents. List the employee's name.,CREATE TABLE Circulation_History (employee_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR),SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Circulation_History (employee_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR) ### question:List the employees who have not showed up in any circulation history of documents. List the employee's name.",SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.,CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR),"SELECT Employees.employee_name, COUNT(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR) ### question:Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.","SELECT Employees.employee_name, COUNT(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number ORDER BY COUNT(*) DESC LIMIT 1" "For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.","CREATE TABLE Circulation_History (document_id VARCHAR, employee_id VARCHAR)","SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Circulation_History (document_id VARCHAR, employee_id VARCHAR) ### question:For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.","SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id" List all department names ordered by their starting date.,"CREATE TABLE department (dname VARCHAR, mgr_start_date VARCHAR)",SELECT dname FROM department ORDER BY mgr_start_date,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dname VARCHAR, mgr_start_date VARCHAR) ### question:List all department names ordered by their starting date.",SELECT dname FROM department ORDER BY mgr_start_date find all dependent names who have a spouse relation with some employee.,"CREATE TABLE dependent (Dependent_name VARCHAR, relationship VARCHAR)",SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dependent (Dependent_name VARCHAR, relationship VARCHAR) ### question:find all dependent names who have a spouse relation with some employee.",SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse' how many female dependents are there?,CREATE TABLE dependent (sex VARCHAR),SELECT COUNT(*) FROM dependent WHERE sex = 'F',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dependent (sex VARCHAR) ### question:how many female dependents are there?",SELECT COUNT(*) FROM dependent WHERE sex = 'F' Find the names of departments that are located in Houston.,"CREATE TABLE dept_locations (dnumber VARCHAR, dlocation VARCHAR); CREATE TABLE department (dname VARCHAR, dnumber VARCHAR)",SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dept_locations (dnumber VARCHAR, dlocation VARCHAR); CREATE TABLE department (dname VARCHAR, dnumber VARCHAR) ### question:Find the names of departments that are located in Houston.",SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston' Return the first names and last names of employees who earn more than 30000 in salary.,"CREATE TABLE employee (fname VARCHAR, lname VARCHAR, salary INTEGER)","SELECT fname, lname FROM employee WHERE salary > 30000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (fname VARCHAR, lname VARCHAR, salary INTEGER) ### question:Return the first names and last names of employees who earn more than 30000 in salary.","SELECT fname, lname FROM employee WHERE salary > 30000" Find the number of employees of each gender whose salary is lower than 50000.,"CREATE TABLE employee (sex VARCHAR, salary INTEGER)","SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (sex VARCHAR, salary INTEGER) ### question:Find the number of employees of each gender whose salary is lower than 50000.","SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex" "list the first and last names, and the addresses of all employees in the ascending order of their birth date.","CREATE TABLE employee (fname VARCHAR, lname VARCHAR, address VARCHAR, Bdate VARCHAR)","SELECT fname, lname, address FROM employee ORDER BY Bdate","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (fname VARCHAR, lname VARCHAR, address VARCHAR, Bdate VARCHAR) ### question:list the first and last names, and the addresses of all employees in the ascending order of their birth date.","SELECT fname, lname, address FROM employee ORDER BY Bdate" what are the event details of the services that have the type code 'Marriage'?,"CREATE TABLE EVENTS (event_details VARCHAR, Service_ID VARCHAR); CREATE TABLE Services (Service_ID VARCHAR, Service_Type_Code VARCHAR)",SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE EVENTS (event_details VARCHAR, Service_ID VARCHAR); CREATE TABLE Services (Service_ID VARCHAR, Service_Type_Code VARCHAR) ### question:what are the event details of the services that have the type code 'Marriage'?",SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage' What are the ids and details of events that have more than one participants?,"CREATE TABLE EVENTS (event_id VARCHAR, event_details VARCHAR, Event_ID VARCHAR); CREATE TABLE Participants_in_Events (Event_ID VARCHAR)","SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE EVENTS (event_id VARCHAR, event_details VARCHAR, Event_ID VARCHAR); CREATE TABLE Participants_in_Events (Event_ID VARCHAR) ### question:What are the ids and details of events that have more than one participants?","SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING COUNT(*) > 1" "How many events have each participants attended? List the participant id, type and the number.","CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)","SELECT T1.Participant_ID, T1.Participant_Type_Code, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR) ### question:How many events have each participants attended? List the participant id, type and the number.","SELECT T1.Participant_ID, T1.Participant_Type_Code, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID" "What are all the the participant ids, type code and details?","CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR, Participant_Details VARCHAR)","SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR, Participant_Details VARCHAR) ### question:What are all the the participant ids, type code and details?","SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants" How many participants belong to the type 'Organizer'?,CREATE TABLE participants (participant_type_code VARCHAR),SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE participants (participant_type_code VARCHAR) ### question:How many participants belong to the type 'Organizer'?",SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer' List the type of the services in alphabetical order.,CREATE TABLE services (service_type_code VARCHAR),SELECT service_type_code FROM services ORDER BY service_type_code,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE services (service_type_code VARCHAR) ### question:List the type of the services in alphabetical order.",SELECT service_type_code FROM services ORDER BY service_type_code List the service id and details for the events.,"CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR)","SELECT service_id, event_details FROM EVENTS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR) ### question:List the service id and details for the events.","SELECT service_id, event_details FROM EVENTS" How many events had participants whose details had the substring 'Dr.',"CREATE TABLE participants (Participant_ID VARCHAR, participant_details VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)",SELECT COUNT(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE participants (Participant_ID VARCHAR, participant_details VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR) ### question:How many events had participants whose details had the substring 'Dr.'",SELECT COUNT(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%' What is the most common participant type?,CREATE TABLE participants (participant_type_code VARCHAR),SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE participants (participant_type_code VARCHAR) ### question:What is the most common participant type?",SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1 Which service id and type has the least number of participants?,"CREATE TABLE Participants_in_Events (Participant_ID VARCHAR, Event_ID VARCHAR); CREATE TABLE services (Service_Type_Code VARCHAR, service_id VARCHAR); CREATE TABLE EVENTS (service_id VARCHAR, Event_ID VARCHAR); CREATE TABLE participants (Participant_ID VARCHAR)","SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participants_in_Events (Participant_ID VARCHAR, Event_ID VARCHAR); CREATE TABLE services (Service_Type_Code VARCHAR, service_id VARCHAR); CREATE TABLE EVENTS (service_id VARCHAR, Event_ID VARCHAR); CREATE TABLE participants (Participant_ID VARCHAR) ### question:Which service id and type has the least number of participants?","SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) LIMIT 1" What is the id of the event with the most participants?,CREATE TABLE Participants_in_Events (Event_ID VARCHAR),SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participants_in_Events (Event_ID VARCHAR) ### question:What is the id of the event with the most participants?",SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1 Which events id does not have any participant with detail 'Kenyatta Kuhn'?,"CREATE TABLE Participants (Participant_ID VARCHAR); CREATE TABLE EVENTS (event_id VARCHAR, Participant_Details VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR, Participant_ID VARCHAR)",SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participants (Participant_ID VARCHAR); CREATE TABLE EVENTS (event_id VARCHAR, Participant_Details VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR, Participant_ID VARCHAR) ### question:Which events id does not have any participant with detail 'Kenyatta Kuhn'?",SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn' Which services type had both successful and failure event details?,"CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR); CREATE TABLE services (service_type_code VARCHAR, service_id VARCHAR)",SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR); CREATE TABLE services (service_type_code VARCHAR, service_id VARCHAR) ### question:Which services type had both successful and failure event details?",SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail' How many events did not have any participants?,CREATE TABLE EVENTS (event_id VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR),SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE EVENTS (event_id VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR) ### question:How many events did not have any participants?",SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events) What are all the distinct participant ids who attended any events?,CREATE TABLE participants_in_Events (participant_id VARCHAR),SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE participants_in_Events (participant_id VARCHAR) ### question:What are all the distinct participant ids who attended any events?",SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events What is the name of the race held most recently?,"CREATE TABLE races (name VARCHAR, date VARCHAR)",SELECT name FROM races ORDER BY date DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, date VARCHAR) ### question:What is the name of the race held most recently?",SELECT name FROM races ORDER BY date DESC LIMIT 1 What is the name and date of the most recent race?,"CREATE TABLE races (name VARCHAR, date VARCHAR)","SELECT name, date FROM races ORDER BY date DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, date VARCHAR) ### question:What is the name and date of the most recent race?","SELECT name, date FROM races ORDER BY date DESC LIMIT 1" Find the names of all races held in 2017.,"CREATE TABLE races (name VARCHAR, YEAR VARCHAR)",SELECT name FROM races WHERE YEAR = 2017,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, YEAR VARCHAR) ### question:Find the names of all races held in 2017.",SELECT name FROM races WHERE YEAR = 2017 Find the distinct names of all races held between 2014 and 2017?,"CREATE TABLE races (name VARCHAR, YEAR INTEGER)",SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, YEAR INTEGER) ### question:Find the distinct names of all races held between 2014 and 2017?",SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017 List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?,"CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER)","SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER) ### question:List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?","SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000" Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?,"CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER); CREATE TABLE drivers (driverid VARCHAR, nationality VARCHAR)","SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER); CREATE TABLE drivers (driverid VARCHAR, nationality VARCHAR) ### question:Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?","SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000" What are the forename and surname of the driver who has the smallest laptime?,"CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR)","SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR) ### question:What are the forename and surname of the driver who has the smallest laptime?","SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1" What is the id and family name of the driver who has the longest laptime?,"CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR)","SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR) ### question:What is the id and family name of the driver who has the longest laptime?","SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1" "What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?","CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR)","SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR) ### question:What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?","SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2" How many drivers participated in the race Australian Grand Prix held in 2009?,"CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (raceid VARCHAR)","SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = ""Australian Grand Prix"" AND YEAR = 2009","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (raceid VARCHAR) ### question:How many drivers participated in the race Australian Grand Prix held in 2009?","SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = ""Australian Grand Prix"" AND YEAR = 2009" How many drivers did not participate in the races held in 2009?,"CREATE TABLE races (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR); CREATE TABLE results (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR)",SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR); CREATE TABLE results (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR) ### question:How many drivers did not participate in the races held in 2009?",SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009) Give me a list of names and years of races that had any driver whose forename is Lewis?,"CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (name VARCHAR, year VARCHAR, raceid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR)","SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = ""Lewis""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (name VARCHAR, year VARCHAR, raceid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR) ### question:Give me a list of names and years of races that had any driver whose forename is Lewis?","SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = ""Lewis""" Find the forename and surname of drivers whose nationality is German?,"CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, nationality VARCHAR)","SELECT forename, surname FROM drivers WHERE nationality = ""German""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, nationality VARCHAR) ### question:Find the forename and surname of drivers whose nationality is German?","SELECT forename, surname FROM drivers WHERE nationality = ""German""" Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?,"CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR)","SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Australian Grand Prix"" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Chinese Grand Prix""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR) ### question:Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?","SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Australian Grand Prix"" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Chinese Grand Prix""" What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?,"CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR)","SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Australian Grand Prix"" EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Chinese Grand Prix""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR) ### question:What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?","SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Australian Grand Prix"" EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Chinese Grand Prix""" Find all the forenames of distinct drivers who was in position 1 as standing and won?,"CREATE TABLE driverstandings (driverid VARCHAR, position VARCHAR, wins VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR)",SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driverstandings (driverid VARCHAR, position VARCHAR, wins VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR) ### question:Find all the forenames of distinct drivers who was in position 1 as standing and won?",SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?,"CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR); CREATE TABLE driverstandings (driverid VARCHAR, points VARCHAR, position VARCHAR, wins VARCHAR)",SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR); CREATE TABLE driverstandings (driverid VARCHAR, points VARCHAR, position VARCHAR, wins VARCHAR) ### question:Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?",SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20 What are the numbers of constructors for different nationalities?,CREATE TABLE constructors (nationality VARCHAR),"SELECT COUNT(*), nationality FROM constructors GROUP BY nationality","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE constructors (nationality VARCHAR) ### question:What are the numbers of constructors for different nationalities?","SELECT COUNT(*), nationality FROM constructors GROUP BY nationality" What are the numbers of races for each constructor id?,CREATE TABLE constructorStandings (constructorid VARCHAR),"SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE constructorStandings (constructorid VARCHAR) ### question:What are the numbers of races for each constructor id?","SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid" What are the names of races that were held after 2017 and the circuits were in the country of Spain?,"CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR)","SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = ""Spain"" AND T1.year > 2017","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR) ### question:What are the names of races that were held after 2017 and the circuits were in the country of Spain?","SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = ""Spain"" AND T1.year > 2017" What are the unique names of races that held after 2000 and the circuits were in Spain?,"CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR)","SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = ""Spain"" AND T1.year > 2000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR) ### question:What are the unique names of races that held after 2000 and the circuits were in Spain?","SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = ""Spain"" AND T1.year > 2000" Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.,"CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR)","SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR) ### question:Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.","SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)" Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?,"CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR)","SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR) ### question:Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?","SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)" List the forenames of all distinct drivers in alphabetical order?,CREATE TABLE drivers (forename VARCHAR),SELECT DISTINCT forename FROM drivers ORDER BY forename,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR) ### question:List the forenames of all distinct drivers in alphabetical order?",SELECT DISTINCT forename FROM drivers ORDER BY forename List the names of all distinct races in reversed lexicographic order?,CREATE TABLE races (name VARCHAR),SELECT DISTINCT name FROM races ORDER BY name DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR) ### question:List the names of all distinct races in reversed lexicographic order?",SELECT DISTINCT name FROM races ORDER BY name DESC What are the names of races held between 2009 and 2011?,"CREATE TABLE races (name VARCHAR, YEAR INTEGER)",SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, YEAR INTEGER) ### question:What are the names of races held between 2009 and 2011?",SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011 What are the names of races held after 12:00:00 or before 09:00:00?,"CREATE TABLE races (name VARCHAR, TIME VARCHAR)","SELECT name FROM races WHERE TIME > ""12:00:00"" OR TIME < ""09:00:00""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, TIME VARCHAR) ### question:What are the names of races held after 12:00:00 or before 09:00:00?","SELECT name FROM races WHERE TIME > ""12:00:00"" OR TIME < ""09:00:00""" "What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?","CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR)","SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR) ### question:What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?","SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5" What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?,"CREATE TABLE drivers (surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR)","SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR) ### question:What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?","SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5" What is the id and last name of the driver who participated in the most races after 2010?,"CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR, year INTEGER); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)","SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR, year INTEGER); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) ### question:What is the id and last name of the driver who participated in the most races after 2010?","SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1" What are the names of circuits that belong to UK or Malaysia?,"CREATE TABLE circuits (name VARCHAR, country VARCHAR)","SELECT name FROM circuits WHERE country = ""UK"" OR country = ""Malaysia""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE circuits (name VARCHAR, country VARCHAR) ### question:What are the names of circuits that belong to UK or Malaysia?","SELECT name FROM circuits WHERE country = ""UK"" OR country = ""Malaysia""" Find the id and location of circuits that belong to France or Belgium?,"CREATE TABLE circuits (circuitid VARCHAR, LOCATION VARCHAR, country VARCHAR)","SELECT circuitid, LOCATION FROM circuits WHERE country = ""France"" OR country = ""Belgium""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE circuits (circuitid VARCHAR, LOCATION VARCHAR, country VARCHAR) ### question:Find the id and location of circuits that belong to France or Belgium?","SELECT circuitid, LOCATION FROM circuits WHERE country = ""France"" OR country = ""Belgium""" Find the names of Japanese constructors that have once earned more than 5 points?,"CREATE TABLE constructorstandings (constructorid VARCHAR, points VARCHAR); CREATE TABLE constructors (name VARCHAR, constructorid VARCHAR, nationality VARCHAR)","SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = ""Japanese"" AND T2.points > 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE constructorstandings (constructorid VARCHAR, points VARCHAR); CREATE TABLE constructors (name VARCHAR, constructorid VARCHAR, nationality VARCHAR) ### question:Find the names of Japanese constructors that have once earned more than 5 points?","SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = ""Japanese"" AND T2.points > 5" What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?,"CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR)","SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = ""Monaco Grand Prix""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR) ### question:What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?","SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = ""Monaco Grand Prix""" What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?,"CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR)","SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = ""Monaco Grand Prix""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR) ### question:What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?","SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = ""Monaco Grand Prix""" What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?,"CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR)","SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR) ### question:What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?","SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year" What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?,"CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR)","SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR) ### question:What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?","SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year" "Find the id, forename and number of races of all drivers who have at least participated in two races?","CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)","SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) ### question:Find the id, forename and number of races of all drivers who have at least participated in two races?","SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2" Find the driver id and number of races of all drivers who have at most participated in 30 races?,"CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (driverid VARCHAR)","SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (driverid VARCHAR) ### question:Find the driver id and number of races of all drivers who have at most participated in 30 races?","SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30" Find the id and surname of the driver who participated the most number of races?,"CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)","SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) ### question:Find the id and surname of the driver who participated the most number of races?","SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1" How many technicians are there?,CREATE TABLE technician (Id VARCHAR),SELECT COUNT(*) FROM technician,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Id VARCHAR) ### question:How many technicians are there?",SELECT COUNT(*) FROM technician List the names of technicians in ascending order of age.,"CREATE TABLE technician (Name VARCHAR, Age VARCHAR)",SELECT Name FROM technician ORDER BY Age,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, Age VARCHAR) ### question:List the names of technicians in ascending order of age.",SELECT Name FROM technician ORDER BY Age What are the team and starting year of technicians?,"CREATE TABLE technician (Team VARCHAR, Starting_Year VARCHAR)","SELECT Team, Starting_Year FROM technician","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR, Starting_Year VARCHAR) ### question:What are the team and starting year of technicians?","SELECT Team, Starting_Year FROM technician" "List the name of technicians whose team is not ""NYY"".","CREATE TABLE technician (Name VARCHAR, Team VARCHAR)","SELECT Name FROM technician WHERE Team <> ""NYY""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, Team VARCHAR) ### question:List the name of technicians whose team is not ""NYY"".","SELECT Name FROM technician WHERE Team <> ""NYY""" Show the name of technicians aged either 36 or 37,"CREATE TABLE technician (Name VARCHAR, Age VARCHAR)",SELECT Name FROM technician WHERE Age = 36 OR Age = 37,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, Age VARCHAR) ### question:Show the name of technicians aged either 36 or 37",SELECT Name FROM technician WHERE Age = 36 OR Age = 37 What is the starting year of the oldest technicians?,"CREATE TABLE technician (Starting_Year VARCHAR, Age VARCHAR)",SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Starting_Year VARCHAR, Age VARCHAR) ### question:What is the starting year of the oldest technicians?",SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1 Show different teams of technicians and the number of technicians in each team.,CREATE TABLE technician (Team VARCHAR),"SELECT Team, COUNT(*) FROM technician GROUP BY Team","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR) ### question:Show different teams of technicians and the number of technicians in each team.","SELECT Team, COUNT(*) FROM technician GROUP BY Team" Please show the team that has the most number of technicians.,CREATE TABLE technician (Team VARCHAR),SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR) ### question:Please show the team that has the most number of technicians.",SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1 Show the team that have at least two technicians.,CREATE TABLE technician (Team VARCHAR),SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR) ### question:Show the team that have at least two technicians.",SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2 Show names of technicians and series of machines they are assigned to repair.,"CREATE TABLE machine (Machine_series VARCHAR, machine_id VARCHAR); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)","SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE machine (Machine_series VARCHAR, machine_id VARCHAR); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians and series of machines they are assigned to repair.","SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID" Show names of technicians in ascending order of quality rank of the machine they are assigned.,"CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE machine (machine_id VARCHAR, quality_rank VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)",SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE machine (machine_id VARCHAR, quality_rank VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians in ascending order of quality rank of the machine they are assigned.",SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank Show names of technicians who are assigned to repair machines with value point more than 70.,"CREATE TABLE machine (machine_id VARCHAR, value_points INTEGER); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)",SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE machine (machine_id VARCHAR, value_points INTEGER); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians who are assigned to repair machines with value point more than 70.",SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70 Show names of technicians and the number of machines they are assigned to repair.,"CREATE TABLE repair_assignment (technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)","SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE repair_assignment (technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians and the number of machines they are assigned to repair.","SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name" List the names of technicians who have not been assigned to repair machines.,"CREATE TABLE technician (Name VARCHAR, technician_id VARCHAR); CREATE TABLE repair_assignment (Name VARCHAR, technician_id VARCHAR)",SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, technician_id VARCHAR); CREATE TABLE repair_assignment (Name VARCHAR, technician_id VARCHAR) ### question:List the names of technicians who have not been assigned to repair machines.",SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment) "Show the starting years shared by technicians from team ""CLE"" and ""CWS"".","CREATE TABLE technician (Starting_Year VARCHAR, Team VARCHAR)","SELECT Starting_Year FROM technician WHERE Team = ""CLE"" INTERSECT SELECT Starting_Year FROM technician WHERE Team = ""CWS""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Starting_Year VARCHAR, Team VARCHAR) ### question:Show the starting years shared by technicians from team ""CLE"" and ""CWS"".","SELECT Starting_Year FROM technician WHERE Team = ""CLE"" INTERSECT SELECT Starting_Year FROM technician WHERE Team = ""CWS""" How many entrepreneurs are there?,CREATE TABLE entrepreneur (Id VARCHAR),SELECT COUNT(*) FROM entrepreneur,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Id VARCHAR) ### question:How many entrepreneurs are there?",SELECT COUNT(*) FROM entrepreneur List the companies of entrepreneurs in descending order of money requested.,"CREATE TABLE entrepreneur (Company VARCHAR, Money_Requested VARCHAR)",SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, Money_Requested VARCHAR) ### question:List the companies of entrepreneurs in descending order of money requested.",SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC List the companies and the investors of entrepreneurs.,"CREATE TABLE entrepreneur (Company VARCHAR, Investor VARCHAR)","SELECT Company, Investor FROM entrepreneur","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, Investor VARCHAR) ### question:List the companies and the investors of entrepreneurs.","SELECT Company, Investor FROM entrepreneur" What is the average money requested by all entrepreneurs?,CREATE TABLE entrepreneur (Money_Requested INTEGER),SELECT AVG(Money_Requested) FROM entrepreneur,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Money_Requested INTEGER) ### question:What is the average money requested by all entrepreneurs?",SELECT AVG(Money_Requested) FROM entrepreneur What are the names of people in ascending order of weight?,"CREATE TABLE People (Name VARCHAR, Weight VARCHAR)",SELECT Name FROM People ORDER BY Weight,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE People (Name VARCHAR, Weight VARCHAR) ### question:What are the names of people in ascending order of weight?",SELECT Name FROM People ORDER BY Weight What are the names of entrepreneurs?,"CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR)",SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR) ### question:What are the names of entrepreneurs?",SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID "What are the names of entrepreneurs whose investor is not ""Rachel Elnaugh""?","CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)","SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> ""Rachel Elnaugh""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question: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""" What is the weight of the shortest person?,"CREATE TABLE people (Weight VARCHAR, Height VARCHAR)",SELECT Weight FROM people ORDER BY Height LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Weight VARCHAR, Height VARCHAR) ### question:What is the weight of the shortest person?",SELECT Weight FROM people ORDER BY Height LIMIT 1 What is the name of the entrepreneur with the greatest weight?,"CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR) ### question: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 What is the total money requested by entrepreneurs with height more than 1.85?,"CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE entrepreneur (Money_Requested INTEGER, People_ID VARCHAR)",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,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE entrepreneur (Money_Requested INTEGER, People_ID VARCHAR) ### question: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 "What are the dates of birth of entrepreneurs with investor ""Simon Woodroffe"" or ""Peter Jones""?","CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Date_of_Birth VARCHAR, People_ID VARCHAR)","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""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Date_of_Birth VARCHAR, People_ID VARCHAR) ### question: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""" What are the weights of entrepreneurs in descending order of money requested?,"CREATE TABLE entrepreneur (People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Weight VARCHAR, People_ID VARCHAR)",SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Weight VARCHAR, People_ID VARCHAR) ### question: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 What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?,CREATE TABLE entrepreneur (Investor VARCHAR),"SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR) ### question:What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?","SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor" What is the investor that has invested in the most number of entrepreneurs?,CREATE TABLE entrepreneur (Investor VARCHAR),SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR) ### question:What 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 What are the investors that have invested in at least two entrepreneurs?,CREATE TABLE entrepreneur (Investor VARCHAR),SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR) ### question:What are the investors that have invested in at least two entrepreneurs?",SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2 List the names of entrepreneurs and their companies in descending order of money requested?,"CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)","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","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question: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" List the names of people that are not entrepreneurs.,"CREATE TABLE entrepreneur (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)",SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:List the names of people that are not entrepreneurs.",SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur) Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.,"CREATE TABLE entrepreneur (Investor VARCHAR, Money_Requested INTEGER)",SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR, Money_Requested INTEGER) ### question: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 How many distinct companies are there?,CREATE TABLE entrepreneur (Company VARCHAR),SELECT COUNT(DISTINCT Company) FROM entrepreneur,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR) ### question:How many distinct companies are there?",SELECT COUNT(DISTINCT Company) FROM entrepreneur Show the company of the tallest entrepreneur.,"CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR)",SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR) ### question:Show the company of the tallest entrepreneur.",SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1 How many perpetrators are there?,CREATE TABLE perpetrator (Id VARCHAR),SELECT COUNT(*) FROM perpetrator,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Id VARCHAR) ### question:How many perpetrators are there?",SELECT COUNT(*) FROM perpetrator List the date of perpetrators in descending order of the number of people killed.,"CREATE TABLE perpetrator (Date VARCHAR, Killed VARCHAR)",SELECT Date FROM perpetrator ORDER BY Killed DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Date VARCHAR, Killed VARCHAR) ### question:List the date of perpetrators in descending order of the number of people killed.",SELECT Date FROM perpetrator ORDER BY Killed DESC List the number of people injured by perpetrators in ascending order.,CREATE TABLE perpetrator (Injured VARCHAR),SELECT Injured FROM perpetrator ORDER BY Injured,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Injured VARCHAR) ### question:List the number of people injured by perpetrators in ascending order.",SELECT Injured FROM perpetrator ORDER BY Injured What is the average number of people injured by all perpetrators?,CREATE TABLE perpetrator (Injured INTEGER),SELECT AVG(Injured) FROM perpetrator,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Injured INTEGER) ### question:What is the average number of people injured by all perpetrators?",SELECT AVG(Injured) FROM perpetrator What is the location of the perpetrator with the largest kills.,"CREATE TABLE perpetrator (LOCATION VARCHAR, Killed VARCHAR)",SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (LOCATION VARCHAR, Killed VARCHAR) ### question:What is the location of the perpetrator with the largest kills.",SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1 What are the names of people in ascending order of height?,"CREATE TABLE People (Name VARCHAR, Height VARCHAR)",SELECT Name FROM People ORDER BY Height,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE People (Name VARCHAR, Height VARCHAR) ### question:What are the names of people in ascending order of height?",SELECT Name FROM People ORDER BY Height What are the names of perpetrators?,"CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)",SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of perpetrators?",SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID "What are the names of perpetrators whose country is not ""China""?","CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)","SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> ""China""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of perpetrators whose country is not ""China""?","SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> ""China""" What is the name of the perpetrator with the biggest weight.,"CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR)",SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR) ### question:What is the name of the perpetrator with the biggest weight.",SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1 What is the total kills of the perpetrators with height more than 1.84.,"CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE perpetrator (Killed INTEGER, People_ID VARCHAR)",SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE perpetrator (Killed INTEGER, People_ID VARCHAR) ### question:What is the total kills of the perpetrators with height more than 1.84.",SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84 "What are the names of perpetrators in country ""China"" or ""Japan""?","CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)","SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = ""China"" OR T2.Country = ""Japan""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of perpetrators in country ""China"" or ""Japan""?","SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = ""China"" OR T2.Country = ""Japan""" What are the heights of perpetrators in descending order of the number of people they injured?,"CREATE TABLE perpetrator (People_ID VARCHAR, Injured VARCHAR); CREATE TABLE people (Height VARCHAR, People_ID VARCHAR)",SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Injured VARCHAR); CREATE TABLE people (Height VARCHAR, People_ID VARCHAR) ### question:What are the heights of perpetrators in descending order of the number of people they injured?",SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.,CREATE TABLE perpetrator (Country VARCHAR),"SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR) ### question:What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.","SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country" What is the country that has the most perpetrators?,CREATE TABLE perpetrator (Country VARCHAR),"SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR) ### question:What is the country that has the most perpetrators?","SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1" What are the countries that have at least two perpetrators?,CREATE TABLE perpetrator (Country VARCHAR),"SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR) ### question:What are the countries that have at least two perpetrators?","SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2" List the names of perpetrators in descending order of the year.,"CREATE TABLE perpetrator (People_ID VARCHAR, Year VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)",SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Year VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:List the names of perpetrators in descending order of the year.",SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC List the names of people that are not perpetrators.,"CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE perpetrator (Name VARCHAR, People_ID VARCHAR)",SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE perpetrator (Name VARCHAR, People_ID VARCHAR) ### question:List the names of people that are not perpetrators.",SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator) Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.,"CREATE TABLE perpetrator (Country VARCHAR, Injured INTEGER)",SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR, Injured INTEGER) ### question:Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.",SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20 How many distinct locations of perpetrators are there?,CREATE TABLE perpetrator (LOCATION VARCHAR),SELECT COUNT(DISTINCT LOCATION) FROM perpetrator,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (LOCATION VARCHAR) ### question:How many distinct locations of perpetrators are there?",SELECT COUNT(DISTINCT LOCATION) FROM perpetrator Show the date of the tallest perpetrator.,"CREATE TABLE perpetrator (Date VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR)",SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Date VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR) ### question:Show the date of the tallest perpetrator.",SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 In which year did the most recent crime happen?,CREATE TABLE perpetrator (YEAR INTEGER),SELECT MAX(YEAR) FROM perpetrator,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (YEAR INTEGER) ### question:In which year did the most recent crime happen?",SELECT MAX(YEAR) FROM perpetrator Report the name of all campuses in Los Angeles county.,"CREATE TABLE campuses (campus VARCHAR, county VARCHAR)","SELECT campus FROM campuses WHERE county = ""Los Angeles""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, county VARCHAR) ### question:Report the name of all campuses in Los Angeles county.","SELECT campus FROM campuses WHERE county = ""Los Angeles""" What are the names of all campuses located at Chico?,"CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR)","SELECT campus FROM campuses WHERE LOCATION = ""Chico""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR) ### question:What are the names of all campuses located at Chico?","SELECT campus FROM campuses WHERE LOCATION = ""Chico""" Find all the campuses opened in 1958.,"CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR)",SELECT campus FROM campuses WHERE YEAR = 1958,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR) ### question:Find all the campuses opened in 1958.",SELECT campus FROM campuses WHERE YEAR = 1958 Find the name of the campuses opened before 1800.,"CREATE TABLE campuses (campus VARCHAR, YEAR INTEGER)",SELECT campus FROM campuses WHERE YEAR < 1800,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, YEAR INTEGER) ### question:Find the name of the campuses opened before 1800.",SELECT campus FROM campuses WHERE YEAR < 1800 Which campus was opened between 1935 and 1939?,"CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR)",SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR) ### question:Which campus was opened between 1935 and 1939?",SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939 "Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco.","CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR, county VARCHAR)","SELECT campus FROM campuses WHERE LOCATION = ""Northridge"" AND county = ""Los Angeles"" UNION SELECT campus FROM campuses WHERE LOCATION = ""San Francisco"" AND county = ""San Francisco""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR, county VARCHAR) ### question:Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco.","SELECT campus FROM campuses WHERE LOCATION = ""Northridge"" AND county = ""Los Angeles"" UNION SELECT campus FROM campuses WHERE LOCATION = ""San Francisco"" AND county = ""San Francisco""" "What is the campus fee of ""San Jose State University"" in year 1996?",CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR),"SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = ""San Jose State University"" AND T2.year = 1996","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR) ### question:What is the campus fee of ""San Jose State University"" in year 1996?","SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = ""San Jose State University"" AND T2.year = 1996" "What is the campus fee of ""San Francisco State University"" in year 1996?",CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR),"SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = ""San Francisco State University"" AND T2.year = 1996","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR) ### question:What is the campus fee of ""San Francisco State University"" in year 1996?","SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = ""San Francisco State University"" AND T2.year = 1996" Find the count of universities whose campus fee is greater than the average campus fee.,CREATE TABLE csu_fees (campusfee INTEGER),SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE csu_fees (campusfee INTEGER) ### question:Find the count of universities whose campus fee is greater than the average campus fee.",SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees) Which university is in Los Angeles county and opened after 1950?,"CREATE TABLE campuses (campus VARCHAR, county VARCHAR, YEAR VARCHAR)","SELECT campus FROM campuses WHERE county = ""Los Angeles"" AND YEAR > 1950","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, county VARCHAR, YEAR VARCHAR) ### question:Which university is in Los Angeles county and opened after 1950?","SELECT campus FROM campuses WHERE county = ""Los Angeles"" AND YEAR > 1950" Which year has the most degrees conferred?,"CREATE TABLE degrees (YEAR VARCHAR, degrees INTEGER)",SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE degrees (YEAR VARCHAR, degrees INTEGER) ### question:Which year has the most degrees conferred?",SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1 Which campus has the most degrees conferred in all times?,"CREATE TABLE degrees (campus VARCHAR, degrees INTEGER)",SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE degrees (campus VARCHAR, degrees INTEGER) ### question:Which campus has the most degrees conferred in all times?",SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1 Which campus has the most faculties in year 2003?,"CREATE TABLE faculty (campus VARCHAR, year VARCHAR, faculty VARCHAR); CREATE TABLE campuses (campus VARCHAR, id VARCHAR)",SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE faculty (campus VARCHAR, year VARCHAR, faculty VARCHAR); CREATE TABLE campuses (campus VARCHAR, id VARCHAR) ### question:Which campus has the most faculties in year 2003?",SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1 Find the average fee on a CSU campus in 1996,"CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR)",SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR) ### question:Find the average fee on a CSU campus in 1996",SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996 What is the average fee on a CSU campus in 2005?,"CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR)",SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR) ### question:What is the average fee on a CSU campus in 2005?",SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005 report the total number of degrees granted between 1998 and 2002.,"CREATE TABLE campuses (campus VARCHAR, id VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR)","SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, id VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR) ### question:report the total number of degrees granted between 1998 and 2002.","SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus" "For each Orange county campus, report the number of degrees granted after 2000.","CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR)","SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = ""Orange"" AND T2.year >= 2000 GROUP BY T1.campus","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR) ### question:For each Orange county campus, report the number of degrees granted after 2000.","SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = ""Orange"" AND T2.year >= 2000 GROUP BY T1.campus" Find the names of the campus which has more faculties in 2002 than every campus in Orange county.,"CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR)","SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = ""Orange"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR) ### question:Find the names of the campus which has more faculties in 2002 than every campus in Orange county.","SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = ""Orange"")" What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?,"CREATE TABLE enrollments (campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR)",SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enrollments (campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR) ### question:What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?",SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200 How many campuses are there in Los Angeles county?,CREATE TABLE campuses (county VARCHAR),"SELECT COUNT(*) FROM campuses WHERE county = ""Los Angeles""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (county VARCHAR) ### question:How many campuses are there in Los Angeles county?","SELECT COUNT(*) FROM campuses WHERE county = ""Los Angeles""" "How many degrees were conferred in ""San Jose State University"" in 2000?",CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR),"SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = ""San Jose State University"" AND t2.year = 2000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR) ### question:How many degrees were conferred in ""San Jose State University"" in 2000?","SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = ""San Jose State University"" AND t2.year = 2000" "What are the degrees conferred in ""San Francisco State University"" in 2001.",CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR),"SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = ""San Francisco State University"" AND t2.year = 2001","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR) ### question:What are the degrees conferred in ""San Francisco State University"" in 2001.","SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = ""San Francisco State University"" AND t2.year = 2001" How many faculty is there in total in the year of 2002?,"CREATE TABLE faculty (faculty INTEGER, YEAR VARCHAR)",SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE faculty (faculty INTEGER, YEAR VARCHAR) ### question:How many faculty is there in total in the year of 2002?",SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002 "What is the number of faculty lines in campus ""Long Beach State University"" in 2002?","CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR)","SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = ""Long Beach State University""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR) ### question:What is the number of faculty lines in campus ""Long Beach State University"" in 2002?","SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = ""Long Beach State University""" "How many faculty lines are there in ""San Francisco State University"" in year 2004?","CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR)","SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = ""San Francisco State University""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR) ### question:How many faculty lines are there in ""San Francisco State University"" in year 2004?","SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = ""San Francisco State University""" List the campus that have between 600 and 1000 faculty lines in year 2004.,"CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (campus VARCHAR, faculty VARCHAR)",SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (campus VARCHAR, faculty VARCHAR) ### question:List the campus that have between 600 and 1000 faculty lines in year 2004.",SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004 How many faculty lines are there in the university that conferred the most number of degrees in year 2002?,CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR),SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR) ### question:How many faculty lines are there in the university that conferred the most number of degrees in year 2002?",SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1 How many faculty lines are there in the university that conferred the least number of degrees in year 2001?,CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR),SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR) ### question:How many faculty lines are there in the university that conferred the least number of degrees in year 2001?",SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1 "How many undergraduates are there in ""San Jose State University"" in year 2004?","CREATE TABLE discipline_enrollments (undergraduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR)","SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = ""San Jose State University""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE discipline_enrollments (undergraduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR) ### question:How many undergraduates are there in ""San Jose State University"" in year 2004?","SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = ""San Jose State University""" "What is the number of graduates in ""San Francisco State University"" in year 2004?","CREATE TABLE discipline_enrollments (graduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR)","SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = ""San Francisco State University""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE discipline_enrollments (graduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR) ### question:What is the number of graduates in ""San Francisco State University"" in year 2004?","SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = ""San Francisco State University""" "What is the campus fee of ""San Francisco State University"" in year 2000?","CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR)","SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = ""San Francisco State University"" AND t1.year = 2000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR) ### question:What is the campus fee of ""San Francisco State University"" in year 2000?","SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = ""San Francisco State University"" AND t1.year = 2000" "Find the campus fee of ""San Jose State University"" in year 2000.","CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR)","SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = ""San Jose State University"" AND t1.year = 2000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR) ### question:Find the campus fee of ""San Jose State University"" in year 2000.","SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = ""San Jose State University"" AND t1.year = 2000" How many CSU campuses are there?,CREATE TABLE campuses (Id VARCHAR),SELECT COUNT(*) FROM campuses,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE campuses (Id VARCHAR) ### question:How many CSU campuses are there?",SELECT COUNT(*) FROM campuses How many candidates are there?,CREATE TABLE candidate (Id VARCHAR),SELECT COUNT(*) FROM candidate,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (Id VARCHAR) ### question:How many candidates are there?",SELECT COUNT(*) FROM candidate Which poll resource provided the most number of candidate information?,CREATE TABLE candidate (poll_source VARCHAR),SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (poll_source VARCHAR) ### question:Which poll resource provided the most number of candidate information?",SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1 what are the top 3 highest support rates?,CREATE TABLE candidate (support_rate VARCHAR),SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (support_rate VARCHAR) ### question:what are the top 3 highest support rates?",SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3 Find the id of the candidate who got the lowest oppose rate.,"CREATE TABLE candidate (Candidate_ID VARCHAR, oppose_rate VARCHAR)",SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (Candidate_ID VARCHAR, oppose_rate VARCHAR) ### question:Find the id of the candidate who got the lowest oppose rate.",SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1 "Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.","CREATE TABLE candidate (Support_rate VARCHAR, Consider_rate VARCHAR, Oppose_rate VARCHAR, unsure_rate VARCHAR)","SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (Support_rate VARCHAR, Consider_rate VARCHAR, Oppose_rate VARCHAR, unsure_rate VARCHAR) ### question:Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.","SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate" which poll source does the highest oppose rate come from?,"CREATE TABLE candidate (poll_source VARCHAR, oppose_rate VARCHAR)",SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (poll_source VARCHAR, oppose_rate VARCHAR) ### question:which poll source does the highest oppose rate come from?",SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1 List all people names in the order of their date of birth from old to young.,"CREATE TABLE people (name VARCHAR, date_of_birth VARCHAR)",SELECT name FROM people ORDER BY date_of_birth,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (name VARCHAR, date_of_birth VARCHAR) ### question:List all people names in the order of their date of birth from old to young.",SELECT name FROM people ORDER BY date_of_birth Find the average height and weight for all males (sex is M).,"CREATE TABLE people (height INTEGER, weight INTEGER, sex VARCHAR)","SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (height INTEGER, weight INTEGER, sex VARCHAR) ### question:Find the average height and weight for all males (sex is M).","SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'" find the names of people who are taller than 200 or lower than 190.,"CREATE TABLE people (name VARCHAR, height VARCHAR)",SELECT name FROM people WHERE height > 200 OR height < 190,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (name VARCHAR, height VARCHAR) ### question:find the names of people who are taller than 200 or lower than 190.",SELECT name FROM people WHERE height > 200 OR height < 190 Find the average and minimum weight for each gender.,"CREATE TABLE people (sex VARCHAR, weight INTEGER)","SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (sex VARCHAR, weight INTEGER) ### question:Find the average and minimum weight for each gender.","SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex" Find the name and gender of the candidate who got the highest support rate.,"CREATE TABLE candidate (people_id VARCHAR, support_rate VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR)","SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (people_id VARCHAR, support_rate VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR) ### question:Find the name and gender of the candidate who got the highest support rate.","SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1" Find the name of the candidates whose oppose percentage is the lowest for each sex.,"CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR)","SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR) ### question:Find the name of the candidates whose oppose percentage is the lowest for each sex.","SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex" which gender got the highest average uncertain ratio.,"CREATE TABLE candidate (people_id VARCHAR, unsure_rate INTEGER); CREATE TABLE people (sex VARCHAR, people_id VARCHAR)",SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (people_id VARCHAR, unsure_rate INTEGER); CREATE TABLE people (sex VARCHAR, people_id VARCHAR) ### question:which gender got the highest average uncertain ratio.",SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1 what are the names of people who did not participate in the candidate election.,"CREATE TABLE candidate (name VARCHAR, people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR)",SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (name VARCHAR, people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR) ### question:what are the names of people who did not participate in the candidate election.",SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate) Find the names of the candidates whose support percentage is lower than their oppose rate.,"CREATE TABLE candidate (people_id VARCHAR, support_rate INTEGER, oppose_rate VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR)",SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (people_id VARCHAR, support_rate INTEGER, oppose_rate VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR) ### question:Find the names of the candidates whose support percentage is lower than their oppose rate.",SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate how many people are there whose weight is higher than 85 for each gender?,"CREATE TABLE people (sex VARCHAR, weight INTEGER)","SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (sex VARCHAR, weight INTEGER) ### question:how many people are there whose weight is higher than 85 for each gender?","SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex" "find the highest support percentage, lowest consider rate and oppose rate of all candidates.","CREATE TABLE candidate (support_rate INTEGER, consider_rate INTEGER, oppose_rate INTEGER)","SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (support_rate INTEGER, consider_rate INTEGER, oppose_rate INTEGER) ### question:find the highest support percentage, lowest consider rate and oppose rate of all candidates.","SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate" list all female (sex is F) candidate names in the alphabetical order.,"CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR, sex VARCHAR)",SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR, sex VARCHAR) ### question:list all female (sex is F) candidate names in the alphabetical order.",SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name find the name of people whose height is lower than the average.,"CREATE TABLE people (name VARCHAR, height INTEGER)",SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (name VARCHAR, height INTEGER) ### question:find the name of people whose height is lower than the average.",SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people) List all info about all people.,CREATE TABLE people (Id VARCHAR),SELECT * FROM people,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Id VARCHAR) ### question:List all info about all people.",SELECT * FROM people Find the titles of all movies directed by steven spielberg.,"CREATE TABLE Movie (title VARCHAR, director VARCHAR)",SELECT title FROM Movie WHERE director = 'Steven Spielberg',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (title VARCHAR, director VARCHAR) ### question:Find the titles of all movies directed by steven spielberg.",SELECT title FROM Movie WHERE director = 'Steven Spielberg' What is the name of the movie produced after 2000 and directed by James Cameron?,"CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR)",SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR) ### question:What is the name of the movie produced after 2000 and directed by James Cameron?",SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000 How many movies were made before 2000?,CREATE TABLE Movie (YEAR INTEGER),SELECT COUNT(*) FROM Movie WHERE YEAR < 2000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (YEAR INTEGER) ### question:How many movies were made before 2000?",SELECT COUNT(*) FROM Movie WHERE YEAR < 2000 Who is the director of movie Avatar?,"CREATE TABLE Movie (director VARCHAR, title VARCHAR)",SELECT director FROM Movie WHERE title = 'Avatar',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (director VARCHAR, title VARCHAR) ### question:Who is the director of movie Avatar?",SELECT director FROM Movie WHERE title = 'Avatar' How many reviewers listed?,CREATE TABLE Reviewer (Id VARCHAR),SELECT COUNT(*) FROM Reviewer,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (Id VARCHAR) ### question:How many reviewers listed?",SELECT COUNT(*) FROM Reviewer What is the id of the reviewer whose name has substring “Mike”?,"CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR)","SELECT rID FROM Reviewer WHERE name LIKE ""%Mike%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR) ### question:What is the id of the reviewer whose name has substring “Mike”?","SELECT rID FROM Reviewer WHERE name LIKE ""%Mike%""" What is the reviewer id of Daniel Lewis?,"CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR)","SELECT rID FROM Reviewer WHERE name = ""Daniel Lewis""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR) ### question:What is the reviewer id of Daniel Lewis?","SELECT rID FROM Reviewer WHERE name = ""Daniel Lewis""" What is the total number of ratings that has more than 3 stars?,CREATE TABLE Rating (stars INTEGER),SELECT COUNT(*) FROM Rating WHERE stars > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars INTEGER) ### question:What is the total number of ratings that has more than 3 stars?",SELECT COUNT(*) FROM Rating WHERE stars > 3 What is the lowest and highest rating star?,CREATE TABLE Rating (stars INTEGER),"SELECT MAX(stars), MIN(stars) FROM Rating","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars INTEGER) ### question:What is the lowest and highest rating star?","SELECT MAX(stars), MIN(stars) FROM Rating" "Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.","CREATE TABLE Movie (mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR)",SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR) ### question:Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.",SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year What are the names of directors who directed movies with 5 star rating? Also return the title of these movies.,"CREATE TABLE Movie (director VARCHAR, title VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR)","SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (director VARCHAR, title VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR) ### question:What are the names of directors who directed movies with 5 star rating? Also return the title of these movies.","SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5" What is the average rating star for each reviewer?,"CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (stars INTEGER, rID VARCHAR)","SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (stars INTEGER, rID VARCHAR) ### question:What is the average rating star for each reviewer?","SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name" Find the titles of all movies that have no ratings.,"CREATE TABLE Rating (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)",SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:Find the titles of all movies that have no ratings.",SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating) Find the names of all reviewers who have ratings with a NULL value for the date.,CREATE TABLE Rating (rID VARCHAR); CREATE TABLE Reviewer (rID VARCHAR),"SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = ""null""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (rID VARCHAR); CREATE TABLE Reviewer (rID VARCHAR) ### question:Find the names of all reviewers who have ratings with a NULL value for the date.","SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = ""null""" What is the average rating stars and title for the oldest movie?,"CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER)","SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(YEAR) FROM Movie)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER) ### question:What is the average rating stars and title for the oldest movie?","SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(YEAR) FROM Movie)" What is the name of the most recent movie?,"CREATE TABLE Movie (title VARCHAR, YEAR INTEGER)",SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (title VARCHAR, YEAR INTEGER) ### question:What is the name of the most recent movie?",SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie) What is the maximum stars and year for the most recent movie?,"CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER); CREATE TABLE Movie (year VARCHAR, mID VARCHAR)","SELECT MAX(T1.stars), T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MAX(YEAR) FROM Movie)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER); CREATE TABLE Movie (year VARCHAR, mID VARCHAR) ### question:What is the maximum stars and year for the most recent movie?","SELECT MAX(T1.stars), T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MAX(YEAR) FROM Movie)" What is the names of movies whose created year is after all movies directed by Steven Spielberg?,"CREATE TABLE Movie (title VARCHAR, YEAR INTEGER, director VARCHAR)","SELECT title FROM Movie WHERE YEAR > (SELECT MAX(YEAR) FROM Movie WHERE director = ""Steven Spielberg"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (title VARCHAR, YEAR INTEGER, director VARCHAR) ### question:What is the names of movies whose created year is after all movies directed by Steven Spielberg?","SELECT title FROM Movie WHERE YEAR > (SELECT MAX(YEAR) FROM Movie WHERE director = ""Steven Spielberg"")" What are the titles and directors of the movies whose star is greater than the average stars of the movies directed by James Cameron?,"CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR)","SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = ""James Cameron"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR) ### question:What are the titles and directors of the movies whose star is greater than the average stars of the movies directed by James Cameron?","SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = ""James Cameron"")" "Return reviewer name, movie title, stars, and ratingDate. And sort the data first by reviewer name, then by movie title, and lastly by number of stars.","CREATE TABLE Rating (stars VARCHAR, ratingDate VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)","SELECT T3.name, T2.title, T1.stars, T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name, T2.title, T1.stars","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars VARCHAR, ratingDate VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:Return reviewer name, movie title, stars, and ratingDate. And sort the data first by reviewer name, then by movie title, and lastly by number of stars.","SELECT T3.name, T2.title, T1.stars, T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name, T2.title, T1.stars" Find the names of all reviewers who have contributed three or more ratings.,"CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR)",SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR) ### question:Find the names of all reviewers who have contributed three or more ratings.",SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3 Find the names of all reviewers who rated Gone with the Wind.,"CREATE TABLE Movie (mID VARCHAR, title VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)",SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (mID VARCHAR, title VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) ### question:Find the names of all reviewers who rated Gone with the Wind.",SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind' Find the names of all directors whose movies are rated by Sarah Martinez.,"CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)",SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) ### question:Find the names of all directors whose movies are rated by Sarah Martinez.",SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez' "For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.","CREATE TABLE Rating (stars VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, director VARCHAR)","SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, director VARCHAR) ### question:For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.","SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name" Return all reviewer names and movie names together in a single list.,"CREATE TABLE Reviewer (name VARCHAR, title VARCHAR); CREATE TABLE Movie (name VARCHAR, title VARCHAR)",SELECT name FROM Reviewer UNION SELECT title FROM Movie,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (name VARCHAR, title VARCHAR); CREATE TABLE Movie (name VARCHAR, title VARCHAR) ### question:Return all reviewer names and movie names together in a single list.",SELECT name FROM Reviewer UNION SELECT title FROM Movie Find the titles of all movies not reviewed by Chris Jackson.,"CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)",SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) ### question:Find the titles of all movies not reviewed by Chris Jackson.",SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson' "For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.","CREATE TABLE Movie (title VARCHAR, director VARCHAR); CREATE TABLE Movie (director VARCHAR, title VARCHAR)","SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director, T1.title","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (title VARCHAR, director VARCHAR); CREATE TABLE Movie (director VARCHAR, title VARCHAR) ### question:For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.","SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director, T1.title" "For directors who had more than one movie, return the titles and produced years of all movies directed by them.","CREATE TABLE Movie (director VARCHAR, title VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, director VARCHAR)","SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (director VARCHAR, title VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, director VARCHAR) ### question:For directors who had more than one movie, return the titles and produced years of all movies directed by them.","SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title" What are the names of the directors who made exactly one movie?,CREATE TABLE Movie (director VARCHAR),SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (director VARCHAR) ### question:What are the names of the directors who made exactly one movie?",SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1 What are the names of the directors who made exactly one movie excluding director NULL?,CREATE TABLE Movie (director VARCHAR),"SELECT director FROM Movie WHERE director <> ""null"" GROUP BY director HAVING COUNT(*) = 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (director VARCHAR) ### question:What are the names of the directors who made exactly one movie excluding director NULL?","SELECT director FROM Movie WHERE director <> ""null"" GROUP BY director HAVING COUNT(*) = 1" How many movie reviews does each director get?,"CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR)","SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR) ### question:How many movie reviews does each director get?","SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director" Find the movies with the highest average rating. Return the movie titles and average rating.,"CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)","SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:Find the movies with the highest average rating. Return the movie titles and average rating.","SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) DESC LIMIT 1" What are the movie titles and average rating of the movies with the lowest average rating?,"CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)","SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:What are the movie titles and average rating of the movies with the lowest average rating?","SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) LIMIT 1" What are the names and years of the movies that has the top 3 highest rating star?,"CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, mID VARCHAR)","SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, mID VARCHAR) ### question:What are the names and years of the movies that has the top 3 highest rating star?","SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3" "For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.","CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR)","SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> ""null"" GROUP BY director","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR) ### question:For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.","SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> ""null"" GROUP BY director" Find the title and star rating of the movie that got the least rating star for each reviewer.,"CREATE TABLE Rating (rID VARCHAR, stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)","SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (rID VARCHAR, stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:Find the title and star rating of the movie that got the least rating star for each reviewer.","SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID" Find the title and score of the movie with the lowest rating among all movies directed by each director.,"CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR)","SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR) ### question:Find the title and score of the movie with the lowest rating among all movies directed by each director.","SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director" What is the name of the movie that is rated by most of times?,"CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)","SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:What is the name of the movie that is rated by most of times?","SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1" What are the titles of all movies that have rating star is between 3 and 5?,"CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)",SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:What are the titles of all movies that have rating star is between 3 and 5?",SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 Find the names of reviewers who had given higher than 3 star ratings.,"CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars INTEGER)",SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars INTEGER) ### question:Find the names of reviewers who had given higher than 3 star ratings.",SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3 Find the average rating star for each movie that are not reviewed by Brittany Harris.,"CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)","SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = ""Brittany Harris"") GROUP BY mID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) ### question:Find the average rating star for each movie that are not reviewed by Brittany Harris.","SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = ""Brittany Harris"") GROUP BY mID" What are the ids of the movies that are not reviewed by Brittany Harris.,"CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)","SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = ""Brittany Harris""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) ### question:What are the ids of the movies that are not reviewed by Brittany Harris.","SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = ""Brittany Harris""" Find the average rating star for each movie that received at least 2 ratings.,"CREATE TABLE Rating (mID VARCHAR, stars INTEGER)","SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (mID VARCHAR, stars INTEGER) ### question:Find the average rating star for each movie that received at least 2 ratings.","SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2" find the ids of reviewers who did not give 4 star.,"CREATE TABLE Rating (rID VARCHAR, stars VARCHAR)",SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (rID VARCHAR, stars VARCHAR) ### question:find the ids of reviewers who did not give 4 star.",SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4 Find the ids of reviewers who didn't only give 4 star.,"CREATE TABLE Rating (rID VARCHAR, stars VARCHAR)",SELECT rID FROM Rating WHERE stars <> 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (rID VARCHAR, stars VARCHAR) ### question:Find the ids of reviewers who didn't only give 4 star.",SELECT rID FROM Rating WHERE stars <> 4 What are names of the movies that are either made after 2000 or reviewed by Brittany Harris?,"CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)",SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) ### question:What are names of the movies that are either made after 2000 or reviewed by Brittany Harris?",SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000 What are names of the movies that are either made before 1980 or directed by James Cameron?,"CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR)","SELECT title FROM Movie WHERE director = ""James Cameron"" OR YEAR < 1980","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR) ### question:What are names of the movies that are either made before 1980 or directed by James Cameron?","SELECT title FROM Movie WHERE director = ""James Cameron"" OR YEAR < 1980" What are the names of reviewers who had rated 3 star and 4 star?,"CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars VARCHAR)",SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars VARCHAR) ### question:What are the names of reviewers who had rated 3 star and 4 star?",SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4 What are the names of movies that get 3 star and 4 star?,"CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)",SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) ### question:What are the names of movies that get 3 star and 4 star?",SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4 How many counties are there?,CREATE TABLE county_public_safety (Id VARCHAR),SELECT COUNT(*) FROM county_public_safety,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Id VARCHAR) ### question:How many counties are there?",SELECT COUNT(*) FROM county_public_safety List the names of counties in descending order of population.,"CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR)",SELECT Name FROM county_public_safety ORDER BY Population DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR) ### question:List the names of counties in descending order of population.",SELECT Name FROM county_public_safety ORDER BY Population DESC List the distinct police forces of counties whose location is not on east side.,"CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR)","SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION <> ""East""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR) ### question:List the distinct police forces of counties whose location is not on east side.","SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION <> ""East""" What are the minimum and maximum crime rate of counties?,CREATE TABLE county_public_safety (Crime_rate INTEGER),"SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Crime_rate INTEGER) ### question:What are the minimum and maximum crime rate of counties?","SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety" Show the crime rates of counties in ascending order of number of police officers.,"CREATE TABLE county_public_safety (Crime_rate VARCHAR, Police_officers VARCHAR)",SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Crime_rate VARCHAR, Police_officers VARCHAR) ### question:Show the crime rates of counties in ascending order of number of police officers.",SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers What are the names of cities in ascending alphabetical order?,CREATE TABLE city (Name VARCHAR),SELECT Name FROM city ORDER BY Name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (Name VARCHAR) ### question:What are the names of cities in ascending alphabetical order?",SELECT Name FROM city ORDER BY Name What are the percentage of hispanics in cities with the black percentage higher than 10?,"CREATE TABLE city (Hispanic VARCHAR, Black INTEGER)",SELECT Hispanic FROM city WHERE Black > 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (Hispanic VARCHAR, Black INTEGER) ### question:What are the percentage of hispanics in cities with the black percentage higher than 10?",SELECT Hispanic FROM city WHERE Black > 10 List the name of the county with the largest population.,"CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR)",SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Name VARCHAR, Population VARCHAR) ### question:List the name of the county with the largest population.",SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1 List the names of the city with the top 5 white percentages.,"CREATE TABLE city (Name VARCHAR, White VARCHAR)",SELECT Name FROM city ORDER BY White DESC LIMIT 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (Name VARCHAR, White VARCHAR) ### question:List the names of the city with the top 5 white percentages.",SELECT Name FROM city ORDER BY White DESC LIMIT 5 Show names of cities and names of counties they are in.,"CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR)","SELECT T1.Name, T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR) ### question:Show names of cities and names of counties they are in.","SELECT T1.Name, T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID" Show white percentages of cities and the crime rates of counties they are in.,"CREATE TABLE city (White VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR)","SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (White VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR) ### question:Show white percentages of cities and the crime rates of counties they are in.","SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID" Show the name of cities in the county that has the largest number of police officers.,"CREATE TABLE city (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR); CREATE TABLE county_public_safety (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR)",SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR); CREATE TABLE county_public_safety (name VARCHAR, county_ID VARCHAR, Police_officers VARCHAR) ### question:Show the name of cities in the county that has the largest number of police officers.",SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1) Show the number of cities in counties that have a population more than 20000.,"CREATE TABLE county_public_safety (county_ID VARCHAR, population INTEGER); CREATE TABLE city (county_ID VARCHAR, population INTEGER)",SELECT COUNT(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (county_ID VARCHAR, population INTEGER); CREATE TABLE city (county_ID VARCHAR, population INTEGER) ### question:Show the number of cities in counties that have a population more than 20000.",SELECT COUNT(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000) Show the crime rate of counties with a city having white percentage more than 90.,"CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR); CREATE TABLE city (County_ID VARCHAR, White INTEGER)",SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Crime_rate VARCHAR, County_ID VARCHAR); CREATE TABLE city (County_ID VARCHAR, White INTEGER) ### question:Show the crime rate of counties with a city having white percentage more than 90.",SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90 Please show the police forces and the number of counties with each police force.,CREATE TABLE county_public_safety (Police_force VARCHAR),"SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Police_force VARCHAR) ### question:Please show the police forces and the number of counties with each police force.","SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force" What is the location shared by most counties?,CREATE TABLE county_public_safety (LOCATION VARCHAR),SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (LOCATION VARCHAR) ### question:What is the location shared by most counties?",SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 List the names of counties that do not have any cities.,"CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR)",SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (Name VARCHAR, County_ID VARCHAR); CREATE TABLE county_public_safety (Name VARCHAR, County_ID VARCHAR) ### question:List the names of counties that do not have any cities.",SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city) Show the police force shared by counties with location on the east and west.,"CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR)","SELECT Police_force FROM county_public_safety WHERE LOCATION = ""East"" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = ""West""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Police_force VARCHAR, LOCATION VARCHAR) ### question:Show the police force shared by counties with location on the east and west.","SELECT Police_force FROM county_public_safety WHERE LOCATION = ""East"" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = ""West""" Show the names of cities in counties that have a crime rate less than 100.,"CREATE TABLE county_public_safety (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER); CREATE TABLE city (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER)",SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER); CREATE TABLE city (name VARCHAR, county_id VARCHAR, Crime_rate INTEGER) ### question:Show the names of cities in counties that have a crime rate less than 100.",SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100) Show the case burden of counties in descending order of population.,"CREATE TABLE county_public_safety (Case_burden VARCHAR, Population VARCHAR)",SELECT Case_burden FROM county_public_safety ORDER BY Population DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county_public_safety (Case_burden VARCHAR, Population VARCHAR) ### question:Show the case burden of counties in descending order of population.",SELECT Case_burden FROM county_public_safety ORDER BY Population DESC Find the names of all modern rooms with a base price below $160 and two beds.,"CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, basePrice VARCHAR, beds VARCHAR)",SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, basePrice VARCHAR, beds VARCHAR) ### question:Find the names of all modern rooms with a base price below $160 and two beds.",SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern' Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.,"CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR, basePrice VARCHAR, maxOccupancy VARCHAR)","SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR, basePrice VARCHAR, maxOccupancy VARCHAR) ### question:Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.","SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2" Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.,"CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)",SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) ### question:Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.",SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC LIMIT 1 How many kids stay in the rooms reserved by ROY SWEAZY?,"CREATE TABLE Reservations (kids VARCHAR, FirstName VARCHAR, LastName VARCHAR)","SELECT kids FROM Reservations WHERE FirstName = ""ROY"" AND LastName = ""SWEAZY""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (kids VARCHAR, FirstName VARCHAR, LastName VARCHAR) ### question:How many kids stay in the rooms reserved by ROY SWEAZY?","SELECT kids FROM Reservations WHERE FirstName = ""ROY"" AND LastName = ""SWEAZY""" How many times does ROY SWEAZY has reserved a room.,"CREATE TABLE Reservations (FirstName VARCHAR, LastName VARCHAR)","SELECT COUNT(*) FROM Reservations WHERE FirstName = ""ROY"" AND LastName = ""SWEAZY""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (FirstName VARCHAR, LastName VARCHAR) ### question:How many times does ROY SWEAZY has reserved a room.","SELECT COUNT(*) FROM Reservations WHERE FirstName = ""ROY"" AND LastName = ""SWEAZY""" "Which room has the highest rate? List the room's full name, rate, check in and check out date.","CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR); CREATE TABLE Reservations (Rate VARCHAR, CheckIn VARCHAR, CheckOut VARCHAR, Room VARCHAR)","SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR); CREATE TABLE Reservations (Rate VARCHAR, CheckIn VARCHAR, CheckOut VARCHAR, Room VARCHAR) ### question:Which room has the highest rate? List the room's full name, rate, check in and check out date.","SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1" "How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?","CREATE TABLE Reservations (Adults VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR)","SELECT Adults FROM Reservations WHERE CheckIn = ""2010-10-23"" AND FirstName = ""CONRAD"" AND LastName = ""SELBIG""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (Adults VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR) ### question:How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?","SELECT Adults FROM Reservations WHERE CheckIn = ""2010-10-23"" AND FirstName = ""CONRAD"" AND LastName = ""SELBIG""" "How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?","CREATE TABLE Reservations (Kids VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR)","SELECT Kids FROM Reservations WHERE CheckIn = ""2010-09-21"" AND FirstName = ""DAMIEN"" AND LastName = ""TRACHSEL""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (Kids VARCHAR, LastName VARCHAR, CheckIn VARCHAR, FirstName VARCHAR) ### question:How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?","SELECT Kids FROM Reservations WHERE CheckIn = ""2010-09-21"" AND FirstName = ""DAMIEN"" AND LastName = ""TRACHSEL""" How many king beds are there?,"CREATE TABLE Rooms (beds INTEGER, bedtype VARCHAR)",SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (beds INTEGER, bedtype VARCHAR) ### question:How many king beds are there?",SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King' List the names and decor of rooms that have a king bed. Sort the list by their price.,"CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, bedtype VARCHAR, basePrice VARCHAR)","SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, decor VARCHAR, bedtype VARCHAR, basePrice VARCHAR) ### question:List the names and decor of rooms that have a king bed. Sort the list by their price.","SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice" Which room has cheapest base price? List the room's name and the base price.,"CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR)","SELECT roomName, basePrice FROM Rooms ORDER BY basePrice LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR) ### question:Which room has cheapest base price? List the room's name and the base price.","SELECT roomName, basePrice FROM Rooms ORDER BY basePrice LIMIT 1" What is the decor of room Recluse and defiance?,"CREATE TABLE Rooms (decor VARCHAR, roomName VARCHAR)","SELECT decor FROM Rooms WHERE roomName = ""Recluse and defiance""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (decor VARCHAR, roomName VARCHAR) ### question:What is the decor of room Recluse and defiance?","SELECT decor FROM Rooms WHERE roomName = ""Recluse and defiance""" What is the average base price of different bed type? List bed type and average base price.,"CREATE TABLE Rooms (bedType VARCHAR, basePrice INTEGER)","SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (bedType VARCHAR, basePrice INTEGER) ### question:What is the average base price of different bed type? List bed type and average base price.","SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType" What is the total number of people who could stay in the modern rooms in this inn?,"CREATE TABLE Rooms (maxOccupancy INTEGER, decor VARCHAR)",SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (maxOccupancy INTEGER, decor VARCHAR) ### question:What is the total number of people who could stay in the modern rooms in this inn?",SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern' What kind of decor has the least number of reservations?,"CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (decor VARCHAR, RoomId VARCHAR)",SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY COUNT(T2.decor) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (decor VARCHAR, RoomId VARCHAR) ### question:What kind of decor has the least number of reservations?",SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY COUNT(T2.decor) LIMIT 1 List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids.,"CREATE TABLE Rooms (RoomId VARCHAR, maxOccupancy VARCHAR); CREATE TABLE Reservations (Room VARCHAR, Adults VARCHAR, Kids VARCHAR)",SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (RoomId VARCHAR, maxOccupancy VARCHAR); CREATE TABLE Reservations (Room VARCHAR, Adults VARCHAR, Kids VARCHAR) ### question:List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids.",SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids Find the first and last names of people who payed more than the rooms' base prices.,"CREATE TABLE Reservations (firstname VARCHAR, lastname VARCHAR, Room VARCHAR, Rate VARCHAR); CREATE TABLE Rooms (RoomId VARCHAR, basePrice VARCHAR)","SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (firstname VARCHAR, lastname VARCHAR, Room VARCHAR, Rate VARCHAR); CREATE TABLE Rooms (RoomId VARCHAR, basePrice VARCHAR) ### question:Find the first and last names of people who payed more than the rooms' base prices.","SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0" How many rooms are there?,CREATE TABLE Rooms (Id VARCHAR),SELECT COUNT(*) FROM Rooms,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (Id VARCHAR) ### question:How many rooms are there?",SELECT COUNT(*) FROM Rooms Find the number of rooms with a king bed.,CREATE TABLE Rooms (bedType VARCHAR),"SELECT COUNT(*) FROM Rooms WHERE bedType = ""King""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (bedType VARCHAR) ### question:Find the number of rooms with a king bed.","SELECT COUNT(*) FROM Rooms WHERE bedType = ""King""" Find the number of rooms for each bed type.,CREATE TABLE Rooms (bedType VARCHAR),"SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (bedType VARCHAR) ### question:Find the number of rooms for each bed type.","SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType" Find the name of the room with the maximum occupancy.,"CREATE TABLE Rooms (roomName VARCHAR, maxOccupancy VARCHAR)",SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, maxOccupancy VARCHAR) ### question:Find the name of the room with the maximum occupancy.",SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1 Find the id and name of the most expensive base price room.,"CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR)","SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR) ### question:Find the id and name of the most expensive base price room.","SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1" List the type of bed and name of all traditional rooms.,"CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR, decor VARCHAR)","SELECT roomName, bedType FROM Rooms WHERE decor = ""traditional""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR, decor VARCHAR) ### question:List the type of bed and name of all traditional rooms.","SELECT roomName, bedType FROM Rooms WHERE decor = ""traditional""" Find the number of rooms with king bed for each decor type.,"CREATE TABLE Rooms (decor VARCHAR, bedType VARCHAR)","SELECT decor, COUNT(*) FROM Rooms WHERE bedType = ""King"" GROUP BY decor","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (decor VARCHAR, bedType VARCHAR) ### question:Find the number of rooms with king bed for each decor type.","SELECT decor, COUNT(*) FROM Rooms WHERE bedType = ""King"" GROUP BY decor" Find the average and minimum price of the rooms in different decor.,"CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER)","SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER) ### question:Find the average and minimum price of the rooms in different decor.","SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor" List the name of all rooms sorted by their prices.,"CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR)",SELECT roomName FROM Rooms ORDER BY basePrice,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, basePrice VARCHAR) ### question:List the name of all rooms sorted by their prices.",SELECT roomName FROM Rooms ORDER BY basePrice Find the number of rooms with price higher than 120 for different decor.,"CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER)","SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (decor VARCHAR, basePrice INTEGER) ### question:Find the number of rooms with price higher than 120 for different decor.","SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor" List the name of rooms with king or queen bed.,"CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR)","SELECT roomName FROM Rooms WHERE bedType = ""King"" OR bedType = ""Queen""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, bedType VARCHAR) ### question:List the name of rooms with king or queen bed.","SELECT roomName FROM Rooms WHERE bedType = ""King"" OR bedType = ""Queen""" How many different types of beds are there?,CREATE TABLE Rooms (bedType VARCHAR),SELECT COUNT(DISTINCT bedType) FROM Rooms,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (bedType VARCHAR) ### question:How many different types of beds are there?",SELECT COUNT(DISTINCT bedType) FROM Rooms Find the name and id of the top 3 expensive rooms.,"CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR)","SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (RoomId VARCHAR, roomName VARCHAR, basePrice VARCHAR) ### question:Find the name and id of the top 3 expensive rooms.","SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3" Find the name of rooms whose price is higher than the average price.,"CREATE TABLE Rooms (roomName VARCHAR, basePrice INTEGER)",SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rooms (roomName VARCHAR, basePrice INTEGER) ### question:Find the name of rooms whose price is higher than the average price.",SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms) Find the number of rooms that do not have any reservation.,"CREATE TABLE rooms (roomid VARCHAR, room VARCHAR); CREATE TABLE reservations (roomid VARCHAR, room VARCHAR)",SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE rooms (roomid VARCHAR, room VARCHAR); CREATE TABLE reservations (roomid VARCHAR, room VARCHAR) ### question:Find the number of rooms that do not have any reservation.",SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations) Return the name and number of reservations made for each of the rooms.,"CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)","SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) ### question:Return the name and number of reservations made for each of the rooms.","SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room" Find the names of rooms that have been reserved for more than 60 times.,"CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)",SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) ### question:Find the names of rooms that have been reserved for more than 60 times.",SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60 Find the name of rooms whose base price is between 120 and 150.,"CREATE TABLE rooms (roomname VARCHAR, baseprice INTEGER)",SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE rooms (roomname VARCHAR, baseprice INTEGER) ### question:Find the name of rooms whose base price is between 120 and 150.",SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150 Find the name of rooms booked by some customers whose first name contains ROY.,"CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR)",SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Reservations (Room VARCHAR); CREATE TABLE Rooms (roomName VARCHAR, RoomId VARCHAR) ### question:Find the name of rooms booked by some customers whose first name contains ROY.",SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%' what are the details of the cmi masters that have the cross reference code 'Tax'?,"CREATE TABLE CMI_Cross_References (master_customer_id VARCHAR, source_system_code VARCHAR); CREATE TABLE Customer_Master_Index (cmi_details VARCHAR, master_customer_id VARCHAR)",SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CMI_Cross_References (master_customer_id VARCHAR, source_system_code VARCHAR); CREATE TABLE Customer_Master_Index (cmi_details VARCHAR, master_customer_id VARCHAR) ### question:what are the details of the cmi masters that have the cross reference code 'Tax'?",SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.,"CREATE TABLE Council_Tax (cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR)","SELECT T1.cmi_cross_ref_id, T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING COUNT(*) >= 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Council_Tax (cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR) ### question:What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.","SELECT T1.cmi_cross_ref_id, T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING COUNT(*) >= 1" "How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n","CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR); CREATE TABLE Business_Rates (cmi_cross_ref_id VARCHAR)","SELECT T2.cmi_cross_ref_id, T2.master_customer_id, COUNT(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR); CREATE TABLE Business_Rates (cmi_cross_ref_id VARCHAR) ### question:How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n","SELECT T2.cmi_cross_ref_id, T2.master_customer_id, COUNT(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id" "What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.","CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Benefits_Overpayments (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR)","SELECT T1.source_system_code, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Benefits_Overpayments (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR) ### question:What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.","SELECT T1.source_system_code, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id" Wat is the tax source system code and master customer id of the taxes related to each parking fine id?,"CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, master_customer_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Parking_Fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR)","SELECT T1.source_system_code, T1.master_customer_id, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CMI_Cross_References (source_system_code VARCHAR, master_customer_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Parking_Fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR) ### question:Wat is the tax source system code and master customer id of the taxes related to each parking fine id?","SELECT T1.source_system_code, T1.master_customer_id, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id" "What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?","CREATE TABLE Rent_Arrears (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Customer_Master_Index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR)","SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details <> 'Schmidt , Kertzmann and Lubowitz'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Rent_Arrears (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE Customer_Master_Index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, master_customer_id VARCHAR) ### question:What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?","SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details <> 'Schmidt , Kertzmann and Lubowitz'" What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?,"CREATE TABLE Electoral_Register (electoral_register_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR)",SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Electoral_Register (electoral_register_id VARCHAR, cmi_cross_ref_id VARCHAR); CREATE TABLE CMI_Cross_References (cmi_cross_ref_id VARCHAR, source_system_code VARCHAR) ### question:What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?",SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax' How many different source system code for the cmi cross references are there?,CREATE TABLE CMI_cross_references (source_system_code VARCHAR),SELECT COUNT(DISTINCT source_system_code) FROM CMI_cross_references,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CMI_cross_references (source_system_code VARCHAR) ### question:How many different source system code for the cmi cross references are there?",SELECT COUNT(DISTINCT source_system_code) FROM CMI_cross_references "List all information about customer master index, and sort them by details in descending order.",CREATE TABLE customer_master_index (cmi_details VARCHAR),SELECT * FROM customer_master_index ORDER BY cmi_details DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_master_index (cmi_details VARCHAR) ### question:List all information about customer master index, and sort them by details in descending order.",SELECT * FROM customer_master_index ORDER BY cmi_details DESC List the council tax ids and their related cmi cross references of all the parking fines.,"CREATE TABLE parking_fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR)","SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE parking_fines (council_tax_id VARCHAR, cmi_cross_ref_id VARCHAR) ### question:List the council tax ids and their related cmi cross references of all the parking fines.","SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines" How many council taxes are collected for renting arrears ?,CREATE TABLE rent_arrears (Id VARCHAR),SELECT COUNT(*) FROM rent_arrears,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE rent_arrears (Id VARCHAR) ### question:How many council taxes are collected for renting arrears ?",SELECT COUNT(*) FROM rent_arrears "What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?","CREATE TABLE customer_master_index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE cmi_cross_references (source_system_code VARCHAR, master_customer_id VARCHAR)","SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb , Becker and Wyman'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_master_index (master_customer_id VARCHAR, cmi_details VARCHAR); CREATE TABLE cmi_cross_references (source_system_code VARCHAR, master_customer_id VARCHAR) ### question:What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?","SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb , Becker and Wyman'" Which cmi cross reference id is not related to any parking taxes?,CREATE TABLE parking_fines (cmi_cross_ref_id VARCHAR); CREATE TABLE cmi_cross_references (cmi_cross_ref_id VARCHAR),SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE parking_fines (cmi_cross_ref_id VARCHAR); CREATE TABLE cmi_cross_references (cmi_cross_ref_id VARCHAR) ### question:Which cmi cross reference id is not related to any parking taxes?",SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines Which distinct source system code includes the substring 'en'?,CREATE TABLE cmi_cross_references (source_system_code VARCHAR),SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE cmi_cross_references (source_system_code VARCHAR) ### question:Which distinct source system code includes the substring 'en'?",SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%' How many parties are there?,CREATE TABLE party (Id VARCHAR),SELECT COUNT(*) FROM party,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Id VARCHAR) ### question:How many parties are there?",SELECT COUNT(*) FROM party List the themes of parties in ascending order of number of hosts.,"CREATE TABLE party (Party_Theme VARCHAR, Number_of_hosts VARCHAR)",SELECT Party_Theme FROM party ORDER BY Number_of_hosts,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Party_Theme VARCHAR, Number_of_hosts VARCHAR) ### question:List the themes of parties in ascending order of number of hosts.",SELECT Party_Theme FROM party ORDER BY Number_of_hosts What are the themes and locations of parties?,"CREATE TABLE party (Party_Theme VARCHAR, LOCATION VARCHAR)","SELECT Party_Theme, LOCATION FROM party","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Party_Theme VARCHAR, LOCATION VARCHAR) ### question:What are the themes and locations of parties?","SELECT Party_Theme, LOCATION FROM party" "Show the first year and last year of parties with theme ""Spring"" or ""Teqnology"".","CREATE TABLE party (First_year VARCHAR, Last_year VARCHAR, Party_Theme VARCHAR)","SELECT First_year, Last_year FROM party WHERE Party_Theme = ""Spring"" OR Party_Theme = ""Teqnology""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (First_year VARCHAR, Last_year VARCHAR, Party_Theme VARCHAR) ### question:Show the first year and last year of parties with theme ""Spring"" or ""Teqnology"".","SELECT First_year, Last_year FROM party WHERE Party_Theme = ""Spring"" OR Party_Theme = ""Teqnology""" What is the average number of hosts for parties?,CREATE TABLE party (Number_of_hosts INTEGER),SELECT AVG(Number_of_hosts) FROM party,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Number_of_hosts INTEGER) ### question:What is the average number of hosts for parties?",SELECT AVG(Number_of_hosts) FROM party What is the location of the party with the most hosts?,"CREATE TABLE party (LOCATION VARCHAR, Number_of_hosts VARCHAR)",SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (LOCATION VARCHAR, Number_of_hosts VARCHAR) ### question:What is the location of the party with the most hosts?",SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1 Show different nationalities along with the number of hosts of each nationality.,CREATE TABLE HOST (Nationality VARCHAR),"SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOST (Nationality VARCHAR) ### question:Show different nationalities along with the number of hosts of each nationality.","SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality" Show the most common nationality of hosts.,CREATE TABLE HOST (Nationality VARCHAR),SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOST (Nationality VARCHAR) ### question:Show the most common nationality of hosts.",SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 Show the nations that have both hosts older than 45 and hosts younger than 35.,"CREATE TABLE HOST (Nationality VARCHAR, Age INTEGER)",SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOST (Nationality VARCHAR, Age INTEGER) ### question:Show the nations that have both hosts older than 45 and hosts younger than 35.",SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35 Show the themes of parties and the names of the party hosts.,"CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_Theme VARCHAR, Party_ID VARCHAR)","SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_Theme VARCHAR, Party_ID VARCHAR) ### question:Show the themes of parties and the names of the party hosts.","SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID" Show the locations of parties and the names of the party hosts in ascending order of the age of the host.,"CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR, Age VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR)","SELECT T3.Location, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR, Age VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR) ### question:Show the locations of parties and the names of the party hosts in ascending order of the age of the host.","SELECT T3.Location, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age" Show the locations of parties with hosts older than 50.,"CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Host_ID VARCHAR, Age INTEGER)",SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Location VARCHAR, Party_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE HOST (Host_ID VARCHAR, Age INTEGER) ### question:Show the locations of parties with hosts older than 50.",SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50 Show the host names for parties with number of hosts greater than 20.,"CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Number_of_hosts INTEGER)",SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Host_ID VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Number_of_hosts INTEGER) ### question:Show the host names for parties with number of hosts greater than 20.",SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20 Show the name and the nationality of the oldest host.,"CREATE TABLE HOST (Name VARCHAR, Nationality VARCHAR, Age VARCHAR)","SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOST (Name VARCHAR, Nationality VARCHAR, Age VARCHAR) ### question:Show the name and the nationality of the oldest host.","SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1" List the names of hosts who did not serve as a host of any party in our record.,"CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Name VARCHAR, Host_ID VARCHAR)",SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOST (Name VARCHAR, Host_ID VARCHAR); CREATE TABLE party_host (Name VARCHAR, Host_ID VARCHAR) ### question:List the names of hosts who did not serve as a host of any party in our record.",SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host) Show all region code and region name sorted by the codes.,"CREATE TABLE region (region_code VARCHAR, region_name VARCHAR)","SELECT region_code, region_name FROM region ORDER BY region_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_code VARCHAR, region_name VARCHAR) ### question:Show all region code and region name sorted by the codes.","SELECT region_code, region_name FROM region ORDER BY region_code" List all region names in alphabetical order.,CREATE TABLE region (region_name VARCHAR),SELECT region_name FROM region ORDER BY region_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR) ### question:List all region names in alphabetical order.",SELECT region_name FROM region ORDER BY region_name Show names for all regions except for Denmark.,CREATE TABLE region (region_name VARCHAR),SELECT region_name FROM region WHERE region_name <> 'Denmark',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR) ### question:Show names for all regions except for Denmark.",SELECT region_name FROM region WHERE region_name <> 'Denmark' How many storms had death records?,CREATE TABLE storm (Number_Deaths INTEGER),SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (Number_Deaths INTEGER) ### question:How many storms had death records?",SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0 "List name, dates active, and number of deaths for all storms with at least 1 death.","CREATE TABLE storm (name VARCHAR, dates_active VARCHAR, number_deaths VARCHAR)","SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (name VARCHAR, dates_active VARCHAR, number_deaths VARCHAR) ### question:List name, dates active, and number of deaths for all storms with at least 1 death.","SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1" Show the average and maximum damage for all storms with max speed higher than 1000.,"CREATE TABLE storm (damage_millions_USD INTEGER, max_speed INTEGER)","SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (damage_millions_USD INTEGER, max_speed INTEGER) ### question:Show the average and maximum damage for all storms with max speed higher than 1000.","SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000" What is the total number of deaths and damage for all storms with a max speed greater than the average?,"CREATE TABLE storm (number_deaths INTEGER, damage_millions_USD INTEGER, max_speed INTEGER)","SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (number_deaths INTEGER, damage_millions_USD INTEGER, max_speed INTEGER) ### question:What is the total number of deaths and damage for all storms with a max speed greater than the average?","SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)" List name and damage for all storms in a descending order of max speed.,"CREATE TABLE storm (name VARCHAR, damage_millions_USD VARCHAR, max_speed VARCHAR)","SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (name VARCHAR, damage_millions_USD VARCHAR, max_speed VARCHAR) ### question:List name and damage for all storms in a descending order of max speed.","SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC" How many regions are affected?,CREATE TABLE affected_region (region_id VARCHAR),SELECT COUNT(DISTINCT region_id) FROM affected_region,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affected_region (region_id VARCHAR) ### question:How many regions are affected?",SELECT COUNT(DISTINCT region_id) FROM affected_region Show the name for regions not affected.,"CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_name VARCHAR, region_id VARCHAR)",SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_name VARCHAR, region_id VARCHAR) ### question:Show the name for regions not affected.",SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region) Show the name for regions and the number of storms for each region.,"CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR)","SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR) ### question:Show the name for regions and the number of storms for each region.","SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id" List the name for storms and the number of affected regions for each storm.,"CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)","SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) ### question:List the name for storms and the number of affected regions for each storm.","SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id" What is the storm name and max speed which affected the greatest number of regions?,"CREATE TABLE storm (name VARCHAR, max_speed VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR)","SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (name VARCHAR, max_speed VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR) ### question:What is the storm name and max speed which affected the greatest number of regions?","SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1" Show the name of storms which don't have affected region in record.,"CREATE TABLE affected_region (name VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)",SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affected_region (name VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) ### question:Show the name of storms which don't have affected region in record.",SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region) Show storm name with at least two regions and 10 cities affected.,"CREATE TABLE affected_region (storm_id VARCHAR, number_city_affected INTEGER); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)",SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affected_region (storm_id VARCHAR, number_city_affected INTEGER); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) ### question:Show storm name with at least two regions and 10 cities affected.",SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10 Show all storm names except for those with at least two affected regions.,"CREATE TABLE storm (name VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)",SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (name VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) ### question:Show all storm names except for those with at least two affected regions.",SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 What are the region names affected by the storm with a number of deaths of least 10?,"CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, number_deaths VARCHAR)",SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, number_deaths VARCHAR) ### question:What are the region names affected by the storm with a number of deaths of least 10?",SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10 "Show all storm names affecting region ""Denmark"".","CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)",SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) ### question:Show all storm names affecting region ""Denmark"".",SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark' Show the region name with at least two storms.,"CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR)",SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR) ### question:Show the region name with at least two storms.",SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2 Find the names of the regions which were affected by the storm that killed the greatest number of people.,"CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, Number_Deaths VARCHAR)",SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, Number_Deaths VARCHAR) ### question:Find the names of the regions which were affected by the storm that killed the greatest number of people.",SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1 Find the name of the storm that affected both Afghanistan and Albania regions.,"CREATE TABLE storm (Name VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE region (region_id VARCHAR, Region_name VARCHAR)",SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE storm (Name VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE region (region_id VARCHAR, Region_name VARCHAR) ### question:Find the name of the storm that affected both Afghanistan and Albania regions.",SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania' How many counties are there in total?,CREATE TABLE county (Id VARCHAR),SELECT COUNT(*) FROM county,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (Id VARCHAR) ### question:How many counties are there in total?",SELECT COUNT(*) FROM county Show the county name and population of all counties.,"CREATE TABLE county (County_name VARCHAR, Population VARCHAR)","SELECT County_name, Population FROM county","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (County_name VARCHAR, Population VARCHAR) ### question:Show the county name and population of all counties.","SELECT County_name, Population FROM county" Show the average population of all counties.,CREATE TABLE county (Population INTEGER),SELECT AVG(Population) FROM county,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (Population INTEGER) ### question:Show the average population of all counties.",SELECT AVG(Population) FROM county Return the maximum and minimum population among all counties.,CREATE TABLE county (Population INTEGER),"SELECT MAX(Population), MIN(Population) FROM county","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (Population INTEGER) ### question:Return the maximum and minimum population among all counties.","SELECT MAX(Population), MIN(Population) FROM county" Show all the distinct districts for elections.,CREATE TABLE election (District VARCHAR),SELECT DISTINCT District FROM election,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (District VARCHAR) ### question:Show all the distinct districts for elections.",SELECT DISTINCT District FROM election "Show the zip code of the county with name ""Howard"".","CREATE TABLE county (Zip_code VARCHAR, County_name VARCHAR)","SELECT Zip_code FROM county WHERE County_name = ""Howard""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (Zip_code VARCHAR, County_name VARCHAR) ### question:Show the zip code of the county with name ""Howard"".","SELECT Zip_code FROM county WHERE County_name = ""Howard""" Show the delegate from district 1 in election.,"CREATE TABLE election (Delegate VARCHAR, District VARCHAR)",SELECT Delegate FROM election WHERE District = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Delegate VARCHAR, District VARCHAR) ### question:Show the delegate from district 1 in election.",SELECT Delegate FROM election WHERE District = 1 Show the delegate and committee information of elections.,"CREATE TABLE election (Delegate VARCHAR, Committee VARCHAR)","SELECT Delegate, Committee FROM election","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Delegate VARCHAR, Committee VARCHAR) ### question:Show the delegate and committee information of elections.","SELECT Delegate, Committee FROM election" How many distinct governors are there?,CREATE TABLE party (Governor VARCHAR),SELECT COUNT(DISTINCT Governor) FROM party,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Governor VARCHAR) ### question:How many distinct governors are there?",SELECT COUNT(DISTINCT Governor) FROM party Show the lieutenant governor and comptroller from the democratic party.,"CREATE TABLE party (Lieutenant_Governor VARCHAR, Comptroller VARCHAR, Party VARCHAR)","SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = ""Democratic""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Lieutenant_Governor VARCHAR, Comptroller VARCHAR, Party VARCHAR) ### question:Show the lieutenant governor and comptroller from the democratic party.","SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = ""Democratic""" "In which distinct years was the governor ""Eliot Spitzer""?","CREATE TABLE party (YEAR VARCHAR, Governor VARCHAR)","SELECT DISTINCT YEAR FROM party WHERE Governor = ""Eliot Spitzer""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (YEAR VARCHAR, Governor VARCHAR) ### question:In which distinct years was the governor ""Eliot Spitzer""?","SELECT DISTINCT YEAR FROM party WHERE Governor = ""Eliot Spitzer""" Show all the information about election.,CREATE TABLE election (Id VARCHAR),SELECT * FROM election,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Id VARCHAR) ### question:Show all the information about election.",SELECT * FROM election Show the delegates and the names of county they belong to.,"CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)","SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) ### question:Show the delegates and the names of county they belong to.","SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District" Which delegates are from counties with population smaller than 100000?,"CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER)",SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER) ### question:Which delegates are from counties with population smaller than 100000?",SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000 How many distinct delegates are from counties with population larger than 50000?,"CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER)",SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER) ### question:How many distinct delegates are from counties with population larger than 50000?",SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000 "What are the names of the county that the delegates on ""Appropriations"" committee belong to?","CREATE TABLE election (District VARCHAR, Committee VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)","SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = ""Appropriations""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (District VARCHAR, Committee VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) ### question:What are the names of the county that the delegates on ""Appropriations"" committee belong to?","SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = ""Appropriations""" Show the delegates and the names of the party they belong to.,"CREATE TABLE election (Delegate VARCHAR, Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)","SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Delegate VARCHAR, Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) ### question:Show the delegates and the names of the party they belong to.","SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID" Who were the governors of the parties associated with delegates from district 1?,"CREATE TABLE party (Governor VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR)",SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Governor VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR) ### question:Who were the governors of the parties associated with delegates from district 1?",SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?,"CREATE TABLE party (Comptroller VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR)",SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Comptroller VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR) ### question:Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?",SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 Return all the committees that have delegates from Democratic party.,"CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR)","SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = ""Democratic""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR) ### question:Return all the committees that have delegates from Democratic party.","SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = ""Democratic""" Show the name of each county along with the corresponding number of delegates from that county.,"CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)","SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) ### question:Show the name of each county along with the corresponding number of delegates from that county.","SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id" Show the name of each party and the corresponding number of delegates from that party.,"CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)","SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) ### question:Show the name of each party and the corresponding number of delegates from that party.","SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party" Return the names of all counties sorted by population in ascending order.,"CREATE TABLE county (County_name VARCHAR, Population VARCHAR)",SELECT County_name FROM county ORDER BY Population,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (County_name VARCHAR, Population VARCHAR) ### question:Return the names of all counties sorted by population in ascending order.",SELECT County_name FROM county ORDER BY Population Return the names of all counties sorted by county name in descending alphabetical order.,CREATE TABLE county (County_name VARCHAR),SELECT County_name FROM county ORDER BY County_name DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (County_name VARCHAR) ### question:Return the names of all counties sorted by county name in descending alphabetical order.",SELECT County_name FROM county ORDER BY County_name DESC Show the name of the county with the biggest population.,"CREATE TABLE county (County_name VARCHAR, Population VARCHAR)",SELECT County_name FROM county ORDER BY Population DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (County_name VARCHAR, Population VARCHAR) ### question:Show the name of the county with the biggest population.",SELECT County_name FROM county ORDER BY Population DESC LIMIT 1 Show the 3 counties with the smallest population.,"CREATE TABLE county (County_name VARCHAR, Population VARCHAR)",SELECT County_name FROM county ORDER BY Population LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE county (County_name VARCHAR, Population VARCHAR) ### question:Show the 3 counties with the smallest population.",SELECT County_name FROM county ORDER BY Population LIMIT 3 Show the names of counties that have at least two delegates.,"CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)",SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) ### question:Show the names of counties that have at least two delegates.",SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2 Show the name of the party that has at least two records.,CREATE TABLE party (Party VARCHAR),SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Party VARCHAR) ### question:Show the name of the party that has at least two records.",SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2 Show the name of the party that has the most delegates.,"CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)",SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) ### question:Show the name of the party that has the most delegates.",SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1 Show the people that have been governor the most times.,CREATE TABLE party (Governor VARCHAR),SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Governor VARCHAR) ### question:Show the people that have been governor the most times.",SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1 Show the people that have been comptroller the most times and the corresponding number of times.,CREATE TABLE party (Comptroller VARCHAR),"SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party (Comptroller VARCHAR) ### question:Show the people that have been comptroller the most times and the corresponding number of times.","SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1" What are the names of parties that do not have delegates in election?,"CREATE TABLE election (Party VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)",SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Party VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) ### question:What are the names of parties that do not have delegates in election?",SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election) "What are the names of parties that have both delegates on ""Appropriations"" committee and","CREATE TABLE election (Party VARCHAR, Committee VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)","SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = ""Appropriations"" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = ""Economic Matters""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Party VARCHAR, Committee VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) ### question:What are the names of parties that have both delegates on ""Appropriations"" committee and","SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = ""Appropriations"" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = ""Economic Matters""" Which committees have delegates from both democratic party and liberal party?,"CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR)","SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = ""Democratic"" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = ""Liberal""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR) ### question:Which committees have delegates from both democratic party and liberal party?","SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = ""Democratic"" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = ""Liberal""" How many journalists are there?,CREATE TABLE journalist (Id VARCHAR),SELECT COUNT(*) FROM journalist,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Id VARCHAR) ### question:How many journalists are there?",SELECT COUNT(*) FROM journalist List the names of journalists in ascending order of years working.,"CREATE TABLE journalist (Name VARCHAR, Years_working VARCHAR)",SELECT Name FROM journalist ORDER BY Years_working,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Name VARCHAR, Years_working VARCHAR) ### question:List the names of journalists in ascending order of years working.",SELECT Name FROM journalist ORDER BY Years_working What are the nationalities and ages of journalists?,"CREATE TABLE journalist (Nationality VARCHAR, Age VARCHAR)","SELECT Nationality, Age FROM journalist","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Nationality VARCHAR, Age VARCHAR) ### question:What are the nationalities and ages of journalists?","SELECT Nationality, Age FROM journalist" "Show the names of journalists from ""England"" or ""Wales"".","CREATE TABLE journalist (Name VARCHAR, Nationality VARCHAR)","SELECT Name FROM journalist WHERE Nationality = ""England"" OR Nationality = ""Wales""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Name VARCHAR, Nationality VARCHAR) ### question:Show the names of journalists from ""England"" or ""Wales"".","SELECT Name FROM journalist WHERE Nationality = ""England"" OR Nationality = ""Wales""" What is the average number of years spent working as a journalist?,CREATE TABLE journalist (Years_working INTEGER),SELECT AVG(Years_working) FROM journalist,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Years_working INTEGER) ### question:What is the average number of years spent working as a journalist?",SELECT AVG(Years_working) FROM journalist What is the nationality of the journalist with the largest number of years working?,"CREATE TABLE journalist (Nationality VARCHAR, Years_working VARCHAR)",SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Nationality VARCHAR, Years_working VARCHAR) ### question:What is the nationality of the journalist with the largest number of years working?",SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1 Show the different nationalities and the number of journalists of each nationality.,CREATE TABLE journalist (Nationality VARCHAR),"SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Nationality VARCHAR) ### question:Show the different nationalities and the number of journalists of each nationality.","SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality" Show the most common nationality for journalists.,CREATE TABLE journalist (Nationality VARCHAR),SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Nationality VARCHAR) ### question:Show the most common nationality for journalists.",SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.,"CREATE TABLE journalist (Nationality VARCHAR, Years_working INTEGER)",SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Nationality VARCHAR, Years_working INTEGER) ### question:Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.",SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3 "Show the dates, places, and names of events in descending order of the attendance.","CREATE TABLE event (Date VARCHAR, Name VARCHAR, venue VARCHAR, Event_Attendance VARCHAR)","SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE event (Date VARCHAR, Name VARCHAR, venue VARCHAR, Event_Attendance VARCHAR) ### question:Show the dates, places, and names of events in descending order of the attendance.","SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC" Show the names of journalists and the dates of the events they reported.,"CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Date VARCHAR, Event_ID VARCHAR)","SELECT T3.Name, T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Date VARCHAR, Event_ID VARCHAR) ### question:Show the names of journalists and the dates of the events they reported.","SELECT T3.Name, T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID" Show the names of journalists and the names of the events they reported in ascending order,"CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Name VARCHAR, Event_ID VARCHAR, Event_Attendance VARCHAR)","SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Name VARCHAR, Event_ID VARCHAR, Event_Attendance VARCHAR) ### question:Show the names of journalists and the names of the events they reported in ascending order","SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance" Show the names of journalists and the number of events they reported.,"CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR)","SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR) ### question:Show the names of journalists and the number of events they reported.","SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name" Show the names of journalists that have reported more than one event.,"CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR)",SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR) ### question:Show the names of journalists that have reported more than one event.",SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1 List the names of journalists who have not reported any event.,"CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Name VARCHAR, journalist_ID VARCHAR)",SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Name VARCHAR, journalist_ID VARCHAR) ### question:List the names of journalists who have not reported any event.",SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report) what are the average and maximum attendances of all events?,CREATE TABLE event (Event_Attendance INTEGER),"SELECT AVG(Event_Attendance), MAX(Event_Attendance) FROM event","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE event (Event_Attendance INTEGER) ### question:what are the average and maximum attendances of all events?","SELECT AVG(Event_Attendance), MAX(Event_Attendance) FROM event" Find the average age and experience working length of journalists working on different role type.,"CREATE TABLE news_report (work_type VARCHAR, journalist_id VARCHAR); CREATE TABLE journalist (age INTEGER, journalist_id VARCHAR)","SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE news_report (work_type VARCHAR, journalist_id VARCHAR); CREATE TABLE journalist (age INTEGER, journalist_id VARCHAR) ### question:Find the average age and experience working length of journalists working on different role type.","SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type" List the event venues and names that have the top 2 most number of people attended.,"CREATE TABLE event (venue VARCHAR, name VARCHAR, Event_Attendance VARCHAR)","SELECT venue, name FROM event ORDER BY Event_Attendance DESC LIMIT 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE event (venue VARCHAR, name VARCHAR, Event_Attendance VARCHAR) ### question:List the event venues and names that have the top 2 most number of people attended.","SELECT venue, name FROM event ORDER BY Event_Attendance DESC LIMIT 2" Show me all the restaurants.,CREATE TABLE Restaurant (ResName VARCHAR),SELECT ResName FROM Restaurant,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Restaurant (ResName VARCHAR) ### question:Show me all the restaurants.",SELECT ResName FROM Restaurant What is the address of the restaurant Subway?,"CREATE TABLE Restaurant (Address VARCHAR, ResName VARCHAR)","SELECT Address FROM Restaurant WHERE ResName = ""Subway""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Restaurant (Address VARCHAR, ResName VARCHAR) ### question:What is the address of the restaurant Subway?","SELECT Address FROM Restaurant WHERE ResName = ""Subway""" What is the rating of the restaurant Subway?,"CREATE TABLE Restaurant (Rating VARCHAR, ResName VARCHAR)","SELECT Rating FROM Restaurant WHERE ResName = ""Subway""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Restaurant (Rating VARCHAR, ResName VARCHAR) ### question:What is the rating of the restaurant Subway?","SELECT Rating FROM Restaurant WHERE ResName = ""Subway""" List all restaurant types.,CREATE TABLE Restaurant_Type (ResTypeName VARCHAR),SELECT ResTypeName FROM Restaurant_Type,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Restaurant_Type (ResTypeName VARCHAR) ### question:List all restaurant types.",SELECT ResTypeName FROM Restaurant_Type What is the description of the restaurant type Sandwich?,"CREATE TABLE Restaurant_Type (ResTypeDescription VARCHAR, ResTypeName VARCHAR)","SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = ""Sandwich""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Restaurant_Type (ResTypeDescription VARCHAR, ResTypeName VARCHAR) ### question:What is the description of the restaurant type Sandwich?","SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = ""Sandwich""" Which restaurants have highest rating? List the restaurant name and its rating.,"CREATE TABLE Restaurant (ResName VARCHAR, Rating VARCHAR)","SELECT ResName, Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Restaurant (ResName VARCHAR, Rating VARCHAR) ### question:Which restaurants have highest rating? List the restaurant name and its rating.","SELECT ResName, Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1" What is the age of student Linda Smith?,"CREATE TABLE Student (Age VARCHAR, Fname VARCHAR, Lname VARCHAR)","SELECT Age FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Age VARCHAR, Fname VARCHAR, Lname VARCHAR) ### question:What is the age of student Linda Smith?","SELECT Age FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith""" What is the gender of the student Linda Smith?,"CREATE TABLE Student (Sex VARCHAR, Fname VARCHAR, Lname VARCHAR)","SELECT Sex FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Sex VARCHAR, Fname VARCHAR, Lname VARCHAR) ### question:What is the gender of the student Linda Smith?","SELECT Sex FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith""" List all students' first names and last names who majored in 600.,"CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Major VARCHAR)","SELECT Fname, Lname FROM Student WHERE Major = 600","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Major VARCHAR) ### question:List all students' first names and last names who majored in 600.","SELECT Fname, Lname FROM Student WHERE Major = 600" Which city does student Linda Smith live in?,"CREATE TABLE Student (city_code VARCHAR, Fname VARCHAR, Lname VARCHAR)","SELECT city_code FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (city_code VARCHAR, Fname VARCHAR, Lname VARCHAR) ### question:Which city does student Linda Smith live in?","SELECT city_code FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith""" Advisor 1121 has how many students?,CREATE TABLE Student (Advisor VARCHAR),SELECT COUNT(*) FROM Student WHERE Advisor = 1121,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Advisor VARCHAR) ### question:Advisor 1121 has how many students?",SELECT COUNT(*) FROM Student WHERE Advisor = 1121 Which Advisor has most of students? List advisor and the number of students.,CREATE TABLE Student (Advisor VARCHAR),"SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor ORDER BY COUNT(Advisor) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Advisor VARCHAR) ### question:Which Advisor has most of students? List advisor and the number of students.","SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor ORDER BY COUNT(Advisor) DESC LIMIT 1" Which major has least number of students? List the major and the number of students.,CREATE TABLE Student (Major VARCHAR),"SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Major VARCHAR) ### question:Which major has least number of students? List the major and the number of students.","SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) LIMIT 1" Which major has between 2 and 30 number of students? List major and the number of students.,CREATE TABLE Student (Major VARCHAR),"SELECT Major, COUNT(*) FROM Student GROUP BY Major HAVING COUNT(Major) BETWEEN 2 AND 30","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Major VARCHAR) ### question:Which major has between 2 and 30 number of students? List major and the number of students.","SELECT Major, COUNT(*) FROM Student GROUP BY Major HAVING COUNT(Major) BETWEEN 2 AND 30" Which student's age is older than 18 and is majoring in 600? List each student's first and last name.,"CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Age VARCHAR, Major VARCHAR)","SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major = 600","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Age VARCHAR, Major VARCHAR) ### question:Which student's age is older than 18 and is majoring in 600? List each student's first and last name.","SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major = 600" List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.,"CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Sex VARCHAR, Age VARCHAR, Major VARCHAR)","SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Sex VARCHAR, Age VARCHAR, Major VARCHAR) ### question:List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.","SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F'" How many restaurant is the Sandwich type restaurant?,CREATE TABLE Type_Of_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR); CREATE TABLE Restaurant_Type (Id VARCHAR),SELECT COUNT(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Type_Of_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR); CREATE TABLE Restaurant_Type (Id VARCHAR) ### question:How many restaurant is the Sandwich type restaurant?",SELECT COUNT(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich' How long does student Linda Smith spend on the restaurant in total?,CREATE TABLE Visits_Restaurant (Spent INTEGER); CREATE TABLE Student (Spent INTEGER),"SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Visits_Restaurant (Spent INTEGER); CREATE TABLE Student (Spent INTEGER) ### question:How long does student Linda Smith spend on the restaurant in total?","SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith""" How many times has the student Linda Smith visited Subway?,CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR),"SELECT COUNT(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith"" AND Restaurant.ResName = ""Subway""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR) ### question:How many times has the student Linda Smith visited Subway?","SELECT COUNT(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith"" AND Restaurant.ResName = ""Subway""" When did Linda Smith visit Subway?,CREATE TABLE Restaurant (TIME VARCHAR); CREATE TABLE Visits_Restaurant (TIME VARCHAR); CREATE TABLE Student (TIME VARCHAR),"SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith"" AND Restaurant.ResName = ""Subway""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Restaurant (TIME VARCHAR); CREATE TABLE Visits_Restaurant (TIME VARCHAR); CREATE TABLE Student (TIME VARCHAR) ### question:When did Linda Smith visit Subway?","SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith"" AND Restaurant.ResName = ""Subway""" At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.,CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR),"SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR) ### question:At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.","SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) LIMIT 1" Which student visited restaurant most often? List student's first name and last name.,CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR),"SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR) ### question:Which student visited restaurant most often? List student's first name and last name.","SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1" Find the ids of orders whose status is 'Success'.,"CREATE TABLE actual_orders (actual_order_id VARCHAR, order_status_code VARCHAR)",SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE actual_orders (actual_order_id VARCHAR, order_status_code VARCHAR) ### question:Find the ids of orders whose status is 'Success'.",SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success' Find the name and price of the product that has been ordered the greatest number of times.,"CREATE TABLE products (product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE regular_order_products (product_id VARCHAR)","SELECT t1.product_name, t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE regular_order_products (product_id VARCHAR) ### question:Find the name and price of the product that has been ordered the greatest number of times.","SELECT t1.product_name, t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY COUNT(*) DESC LIMIT 1" Find the number of customers in total.,CREATE TABLE customers (Id VARCHAR),SELECT COUNT(*) FROM customers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (Id VARCHAR) ### question:Find the number of customers in total.",SELECT COUNT(*) FROM customers How many different payment methods are there?,CREATE TABLE customers (payment_method VARCHAR),SELECT COUNT(DISTINCT payment_method) FROM customers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (payment_method VARCHAR) ### question:How many different payment methods are there?",SELECT COUNT(DISTINCT payment_method) FROM customers Show the details of all trucks in the order of their license number.,"CREATE TABLE trucks (truck_details VARCHAR, truck_licence_number VARCHAR)",SELECT truck_details FROM trucks ORDER BY truck_licence_number,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trucks (truck_details VARCHAR, truck_licence_number VARCHAR) ### question:Show the details of all trucks in the order of their license number.",SELECT truck_details FROM trucks ORDER BY truck_licence_number Find the name of the most expensive product.,"CREATE TABLE products (product_name VARCHAR, product_price VARCHAR)",SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_price VARCHAR) ### question:Find the name of the most expensive product.",SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1 Find the names of customers who are not living in the state of California.,"CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)",SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR) ### question:Find the names of customers who are not living in the state of California.",SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' List the names and emails of customers who payed by Visa card.,"CREATE TABLE customers (customer_email VARCHAR, customer_name VARCHAR, payment_method VARCHAR)","SELECT customer_email, customer_name FROM customers WHERE payment_method = 'Visa'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_email VARCHAR, customer_name VARCHAR, payment_method VARCHAR) ### question:List the names and emails of customers who payed by Visa card.","SELECT customer_email, customer_name FROM customers WHERE payment_method = 'Visa'" Find the names and phone numbers of customers living in California state.,"CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)","SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR) ### question:Find the names and phone numbers of customers living in California state.","SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'" Find the states which do not have any employee in their record.,"CREATE TABLE Employees (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR)",SELECT state_province_county FROM addresses WHERE NOT address_id IN (SELECT employee_address_id FROM Employees),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR) ### question:Find the states which do not have any employee in their record.",SELECT state_province_county FROM addresses WHERE NOT address_id IN (SELECT employee_address_id FROM Employees) "List the names, phone numbers, and emails of all customers sorted by their dates of becoming customers.","CREATE TABLE Customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, date_became_customer VARCHAR)","SELECT customer_name, customer_phone, customer_email FROM Customers ORDER BY date_became_customer","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, date_became_customer VARCHAR) ### question:List the names, phone numbers, and emails of all customers sorted by their dates of becoming customers.","SELECT customer_name, customer_phone, customer_email FROM Customers ORDER BY date_became_customer" Find the name of the first 5 customers.,"CREATE TABLE Customers (customer_name VARCHAR, date_became_customer VARCHAR)",SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_name VARCHAR, date_became_customer VARCHAR) ### question:Find the name of the first 5 customers.",SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5 Find the payment method that is used most frequently.,CREATE TABLE Customers (payment_method VARCHAR),SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (payment_method VARCHAR) ### question:Find the payment method that is used most frequently.",SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1 List the names of all routes in alphabetic order.,CREATE TABLE Delivery_Routes (route_name VARCHAR),SELECT route_name FROM Delivery_Routes ORDER BY route_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Delivery_Routes (route_name VARCHAR) ### question:List the names of all routes in alphabetic order.",SELECT route_name FROM Delivery_Routes ORDER BY route_name Find the name of route that has the highest number of deliveries.,"CREATE TABLE Delivery_Routes (route_name VARCHAR, route_id VARCHAR); CREATE TABLE Delivery_Route_Locations (route_id VARCHAR)",SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Delivery_Routes (route_name VARCHAR, route_id VARCHAR); CREATE TABLE Delivery_Route_Locations (route_id VARCHAR) ### question:Find the name of route that has the highest number of deliveries.",SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1 List the state names and the number of customers living in each state.,"CREATE TABLE customer_addresses (address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR)","SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_addresses (address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR) ### question:List the state names and the number of customers living in each state.","SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county" How many authors are there?,CREATE TABLE authors (Id VARCHAR),SELECT COUNT(*) FROM authors,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authors (Id VARCHAR) ### question:How many authors are there?",SELECT COUNT(*) FROM authors How many institutions are there?,CREATE TABLE inst (Id VARCHAR),SELECT COUNT(*) FROM inst,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inst (Id VARCHAR) ### question:How many institutions are there?",SELECT COUNT(*) FROM inst How many papers are published in total?,CREATE TABLE papers (Id VARCHAR),SELECT COUNT(*) FROM papers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE papers (Id VARCHAR) ### question:How many papers are published in total?",SELECT COUNT(*) FROM papers "What are the titles of papers published by ""Jeremy Gibbons""?","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Jeremy"" AND t1.lname = ""Gibbons""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) ### question:What are the titles of papers published by ""Jeremy Gibbons""?","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Jeremy"" AND t1.lname = ""Gibbons""" "Find all the papers published by ""Aaron Turon"".","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Aaron"" AND t1.lname = ""Turon""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) ### question:Find all the papers published by ""Aaron Turon"".","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Aaron"" AND t1.lname = ""Turon""" "How many papers have ""Atsushi Ohori"" published?","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE papers (paperid VARCHAR)","SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Atsushi"" AND t1.lname = ""Ohori""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE papers (paperid VARCHAR) ### question:How many papers have ""Atsushi Ohori"" published?","SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Atsushi"" AND t1.lname = ""Ohori""" "What is the name of the institution that ""Matthias Blume"" belongs to?","CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)","SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = ""Matthias"" AND t1.lname = ""Blume""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR) ### question:What is the name of the institution that ""Matthias Blume"" belongs to?","SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = ""Matthias"" AND t1.lname = ""Blume""" "Which institution does ""Katsuhiro Ueno"" belong to?","CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)","SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = ""Katsuhiro"" AND t1.lname = ""Ueno""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR) ### question:Which institution does ""Katsuhiro Ueno"" belong to?","SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = ""Katsuhiro"" AND t1.lname = ""Ueno""" "Who belong to the institution ""University of Oxford""? Show the first names and last names.","CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR)","SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""University of Oxford""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR) ### question:Who belong to the institution ""University of Oxford""? Show the first names and last names.","SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""University of Oxford""" "Which authors belong to the institution ""Google""? Show the first names and last names.","CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR)","SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Google""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR) ### question:Which authors belong to the institution ""Google""? Show the first names and last names.","SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Google""" "What are the last names of the author of the paper titled ""Binders Unbound""?","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)","SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = ""Binders Unbound""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR) ### question:What are the last names of the author of the paper titled ""Binders Unbound""?","SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = ""Binders Unbound""" "Find the first and last name of the author(s) who wrote the paper ""Nameless, Painless"".","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR)","SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = ""Nameless , Painless""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR) ### question:Find the first and last name of the author(s) who wrote the paper ""Nameless, Painless"".","SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = ""Nameless , Painless""" "What are the papers published under the institution ""Indiana University""?","CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)","SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Indiana University""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) ### question:What are the papers published under the institution ""Indiana University""?","SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Indiana University""" "Find all the papers published by the institution ""Google"".","CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)","SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Google""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) ### question:Find all the papers published by the institution ""Google"".","SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Google""" "How many papers are published by the institution ""Tokohu University""?","CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)","SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Tokohu University""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) ### question:How many papers are published by the institution ""Tokohu University""?","SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Tokohu University""" "Find the number of papers published by the institution ""University of Pennsylvania"".","CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)","SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""University of Pennsylvania""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) ### question:Find the number of papers published by the institution ""University of Pennsylvania"".","SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""University of Pennsylvania""" "Find the papers which have ""Olin Shivers"" as an author.","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Olin"" AND t1.lname = ""Shivers""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) ### question:Find the papers which have ""Olin Shivers"" as an author.","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Olin"" AND t1.lname = ""Shivers""" "Which papers have ""Stephanie Weirich"" as an author?","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Stephanie"" AND t1.lname = ""Weirich""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) ### question:Which papers have ""Stephanie Weirich"" as an author?","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Stephanie"" AND t1.lname = ""Weirich""" "Which paper is published in an institution in ""USA"" and have ""Turon"" as its second author?","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = ""USA"" AND t2.authorder = 2 AND t1.lname = ""Turon""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR) ### question:Which paper is published in an institution in ""USA"" and have ""Turon"" as its second author?","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = ""USA"" AND t2.authorder = 2 AND t1.lname = ""Turon""" "Find the titles of papers whose first author is affiliated with an institution in the country ""Japan"" and has last name ""Ohori""?","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = ""Japan"" AND t2.authorder = 1 AND t1.lname = ""Ohori""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR) ### question:Find the titles of papers whose first author is affiliated with an institution in the country ""Japan"" and has last name ""Ohori""?","SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = ""Japan"" AND t2.authorder = 1 AND t1.lname = ""Ohori""" What is the last name of the author that has published the most papers?,"CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR)","SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR) ### question:What is the last name of the author that has published the most papers?","SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1" Retrieve the country that has published the most papers.,"CREATE TABLE inst (country VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)",SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inst (country VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR) ### question:Retrieve the country that has published the most papers.",SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1 Find the name of the organization that has published the largest number of papers.,"CREATE TABLE inst (name VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)",SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inst (name VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR) ### question:Find the name of the organization that has published the largest number of papers.",SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1 "Find the titles of the papers that contain the word ""ML"".",CREATE TABLE papers (title VARCHAR),"SELECT title FROM papers WHERE title LIKE ""%ML%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE papers (title VARCHAR) ### question:Find the titles of the papers that contain the word ""ML"".","SELECT title FROM papers WHERE title LIKE ""%ML%""" "Which paper's title contains the word ""Database""?",CREATE TABLE papers (title VARCHAR),"SELECT title FROM papers WHERE title LIKE ""%Database%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE papers (title VARCHAR) ### question:Which paper's title contains the word ""Database""?","SELECT title FROM papers WHERE title LIKE ""%Database%""" "Find the first names of all the authors who have written a paper with title containing the word ""Functional"".","CREATE TABLE authors (fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR)","SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE ""%Functional%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authors (fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR) ### question:Find the first names of all the authors who have written a paper with title containing the word ""Functional"".","SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE ""%Functional%""" "Find the last names of all the authors that have written a paper with title containing the word ""Monadic"".","CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)","SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE ""%Monadic%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR) ### question:Find the last names of all the authors that have written a paper with title containing the word ""Monadic"".","SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE ""%Monadic%""" Retrieve the title of the paper that has the largest number of authors.,"CREATE TABLE authorship (authorder INTEGER); CREATE TABLE authorship (paperid VARCHAR, authorder INTEGER); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)",SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authorship (authorder INTEGER); CREATE TABLE authorship (paperid VARCHAR, authorder INTEGER); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) ### question:Retrieve the title of the paper that has the largest number of authors.",SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship) "What is the first name of the author with last name ""Ueno""?","CREATE TABLE authors (fname VARCHAR, lname VARCHAR)","SELECT fname FROM authors WHERE lname = ""Ueno""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authors (fname VARCHAR, lname VARCHAR) ### question:What is the first name of the author with last name ""Ueno""?","SELECT fname FROM authors WHERE lname = ""Ueno""" "Find the last name of the author with first name ""Amal"".","CREATE TABLE authors (lname VARCHAR, fname VARCHAR)","SELECT lname FROM authors WHERE fname = ""Amal""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authors (lname VARCHAR, fname VARCHAR) ### question:Find the last name of the author with first name ""Amal"".","SELECT lname FROM authors WHERE fname = ""Amal""" Find the first names of all the authors ordered in alphabetical order.,CREATE TABLE authors (fname VARCHAR),SELECT fname FROM authors ORDER BY fname,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authors (fname VARCHAR) ### question:Find the first names of all the authors ordered in alphabetical order.",SELECT fname FROM authors ORDER BY fname Retrieve all the last names of authors in alphabetical order.,CREATE TABLE authors (lname VARCHAR),SELECT lname FROM authors ORDER BY lname,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authors (lname VARCHAR) ### question:Retrieve all the last names of authors in alphabetical order.",SELECT lname FROM authors ORDER BY lname Retrieve all the first and last names of authors in the alphabetical order of last names.,"CREATE TABLE authors (fname VARCHAR, lname VARCHAR)","SELECT fname, lname FROM authors ORDER BY lname","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE authors (fname VARCHAR, lname VARCHAR) ### question:Retrieve all the first and last names of authors in the alphabetical order of last names.","SELECT fname, lname FROM authors ORDER BY lname" How many different last names do the actors and actresses have?,CREATE TABLE actor (last_name VARCHAR),SELECT COUNT(DISTINCT last_name) FROM actor,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE actor (last_name VARCHAR) ### question:How many different last names do the actors and actresses have?",SELECT COUNT(DISTINCT last_name) FROM actor What is the most popular first name of the actors?,CREATE TABLE actor (first_name VARCHAR),SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE actor (first_name VARCHAR) ### question:What is the most popular first name of the actors?",SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1 What is the most popular full name of the actors?,"CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR)","SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR) ### question:What is the most popular full name of the actors?","SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1" Which districts have at least two addresses?,CREATE TABLE address (district VARCHAR),SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE address (district VARCHAR) ### question:Which districts have at least two addresses?",SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2 What is the phone number and postal code of the address 1031 Daugavpils Parkway?,"CREATE TABLE address (phone VARCHAR, postal_code VARCHAR, address VARCHAR)","SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE address (phone VARCHAR, postal_code VARCHAR, address VARCHAR) ### question:What is the phone number and postal code of the address 1031 Daugavpils Parkway?","SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'" "Which city has the most addresses? List the city name, number of addresses, and city id.","CREATE TABLE address (city_id VARCHAR); CREATE TABLE city (city VARCHAR, city_id VARCHAR)","SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE address (city_id VARCHAR); CREATE TABLE city (city VARCHAR, city_id VARCHAR) ### question:Which city has the most addresses? List the city name, number of addresses, and city id.","SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1" How many addresses are in the district of California?,CREATE TABLE address (district VARCHAR),SELECT COUNT(*) FROM address WHERE district = 'California',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE address (district VARCHAR) ### question:How many addresses are in the district of California?",SELECT COUNT(*) FROM address WHERE district = 'California' Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.,"CREATE TABLE film (title VARCHAR, film_id VARCHAR, rental_rate VARCHAR); CREATE TABLE inventory (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR)","SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, film_id VARCHAR, rental_rate VARCHAR); CREATE TABLE inventory (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR) ### question:Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.","SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3" How many cities are in Australia?,"CREATE TABLE country (country_id VARCHAR, country VARCHAR); CREATE TABLE city (country_id VARCHAR)",SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE country (country_id VARCHAR, country VARCHAR); CREATE TABLE city (country_id VARCHAR) ### question:How many cities are in Australia?",SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia' Which countries have at least 3 cities?,"CREATE TABLE country (country VARCHAR, country_id VARCHAR); CREATE TABLE city (country_id VARCHAR)",SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE country (country VARCHAR, country_id VARCHAR); CREATE TABLE city (country_id VARCHAR) ### question:Which countries have at least 3 cities?",SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3 Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa.,"CREATE TABLE payment (payment_date VARCHAR, staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, first_name VARCHAR); CREATE TABLE payment (payment_date VARCHAR, amount INTEGER)",SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payment (payment_date VARCHAR, staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, first_name VARCHAR); CREATE TABLE payment (payment_date VARCHAR, amount INTEGER) ### question:Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa.",SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' How many customers have an active value of 1?,CREATE TABLE customer (active VARCHAR),SELECT COUNT(*) FROM customer WHERE active = '1',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (active VARCHAR) ### question:How many customers have an active value of 1?",SELECT COUNT(*) FROM customer WHERE active = '1' Which film has the highest rental rate? And what is the rate?,"CREATE TABLE film (title VARCHAR, rental_rate VARCHAR)","SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, rental_rate VARCHAR) ### question:Which film has the highest rental rate? And what is the rate?","SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1" "Which film has the most number of actors or actresses? List the film name, film id and description.","CREATE TABLE film_actor (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR, description VARCHAR)","SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_actor (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR, description VARCHAR) ### question:Which film has the most number of actors or actresses? List the film name, film id and description.","SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY COUNT(*) DESC LIMIT 1" "Which film actor (actress) starred the most films? List his or her first name, last name and actor id.","CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR)","SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR) ### question:Which film actor (actress) starred the most films? List his or her first name, last name and actor id.","SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1" Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.,"CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR)","SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR) ### question:Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.","SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30" Which store owns most items?,CREATE TABLE inventory (store_id VARCHAR),SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inventory (store_id VARCHAR) ### question:Which store owns most items?",SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1 What is the total amount of all payments?,CREATE TABLE payment (amount INTEGER),SELECT SUM(amount) FROM payment,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payment (amount INTEGER) ### question:What is the total amount of all payments?",SELECT SUM(amount) FROM payment "Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.","CREATE TABLE payment (customer_id VARCHAR); CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR)","SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payment (customer_id VARCHAR); CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR) ### question:Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.","SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) LIMIT 1" What is the genre name of the film HUNGER ROOF?,"CREATE TABLE film_category (category_id VARCHAR, film_id VARCHAR); CREATE TABLE film (film_id VARCHAR, title VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR)",SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_category (category_id VARCHAR, film_id VARCHAR); CREATE TABLE film (film_id VARCHAR, title VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR) ### question:What is the genre name of the film HUNGER ROOF?",SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF' "How many films are there in each category? List the genre name, genre id and the count.","CREATE TABLE film_category (category_id VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR)","SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_category (category_id VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR) ### question:How many films are there in each category? List the genre name, genre id and the count.","SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id" Which film has the most copies in the inventory? List both title and id.,"CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (film_id VARCHAR)","SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (film_id VARCHAR) ### question:Which film has the most copies in the inventory? List both title and id.","SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY COUNT(*) DESC LIMIT 1" What is the film title and inventory id of the item in the inventory which was rented most frequently?,"CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (inventory_id VARCHAR, film_id VARCHAR); CREATE TABLE rental (inventory_id VARCHAR)","SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (inventory_id VARCHAR, film_id VARCHAR); CREATE TABLE rental (inventory_id VARCHAR) ### question:What is the film title and inventory id of the item in the inventory which was rented most frequently?","SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1" How many languages are in these films?,CREATE TABLE film (language_id VARCHAR),SELECT COUNT(DISTINCT language_id) FROM film,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (language_id VARCHAR) ### question:How many languages are in these films?",SELECT COUNT(DISTINCT language_id) FROM film What are all the movies rated as R? List the titles.,"CREATE TABLE film (title VARCHAR, rating VARCHAR)",SELECT title FROM film WHERE rating = 'R',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, rating VARCHAR) ### question:What are all the movies rated as R? List the titles.",SELECT title FROM film WHERE rating = 'R' Where is store 1 located?,"CREATE TABLE store (address_id VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR)",SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE store (address_id VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) ### question:Where is store 1 located?",SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1 Which staff handled least number of payments? List the full name and the id.,"CREATE TABLE payment (staff_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR)","SELECT T1.first_name, T1.last_name, T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY COUNT(*) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payment (staff_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR) ### question:Which staff handled least number of payments? List the full name and the id.","SELECT T1.first_name, T1.last_name, T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY COUNT(*) LIMIT 1" Which language does the film AIRPORT POLLOCK use? List the language name.,"CREATE TABLE film (language_id VARCHAR, title VARCHAR); CREATE TABLE LANGUAGE (name VARCHAR, language_id VARCHAR)",SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (language_id VARCHAR, title VARCHAR); CREATE TABLE LANGUAGE (name VARCHAR, language_id VARCHAR) ### question:Which language does the film AIRPORT POLLOCK use? List the language name.",SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK' How many stores are there?,CREATE TABLE store (Id VARCHAR),SELECT COUNT(*) FROM store,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE store (Id VARCHAR) ### question:How many stores are there?",SELECT COUNT(*) FROM store How many kinds of different ratings are listed?,CREATE TABLE film (rating VARCHAR),SELECT COUNT(DISTINCT rating) FROM film,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (rating VARCHAR) ### question:How many kinds of different ratings are listed?",SELECT COUNT(DISTINCT rating) FROM film Which movies have 'Deleted Scenes' as a substring in the special feature?,"CREATE TABLE film (title VARCHAR, special_features VARCHAR)",SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, special_features VARCHAR) ### question:Which movies have 'Deleted Scenes' as a substring in the special feature?",SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%' How many items in inventory does store 1 have?,CREATE TABLE inventory (store_id VARCHAR),SELECT COUNT(*) FROM inventory WHERE store_id = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE inventory (store_id VARCHAR) ### question:How many items in inventory does store 1 have?",SELECT COUNT(*) FROM inventory WHERE store_id = 1 When did the first payment happen?,CREATE TABLE payment (payment_date VARCHAR),SELECT payment_date FROM payment ORDER BY payment_date LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payment (payment_date VARCHAR) ### question:When did the first payment happen?",SELECT payment_date FROM payment ORDER BY payment_date LIMIT 1 Where does the customer with the first name Linda live? And what is her email?,"CREATE TABLE customer (email VARCHAR, address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR)","SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (email VARCHAR, address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) ### question:Where does the customer with the first name Linda live? And what is her email?","SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'" "Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.","CREATE TABLE film (title VARCHAR, replacement_cost INTEGER, LENGTH VARCHAR, rating VARCHAR)",SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, replacement_cost INTEGER, LENGTH VARCHAR, rating VARCHAR) ### question:Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.",SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200 What is the first name and the last name of the customer who made the earliest rental?,"CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE rental (customer_id VARCHAR, rental_date VARCHAR)","SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE rental (customer_id VARCHAR, rental_date VARCHAR) ### question:What is the first name and the last name of the customer who made the earliest rental?","SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date LIMIT 1" What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?,"CREATE TABLE customer (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE rental (staff_id VARCHAR, customer_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR)","SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE rental (staff_id VARCHAR, customer_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR) ### question:What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?","SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'" Which store has most the customers?,CREATE TABLE customer (store_id VARCHAR),SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (store_id VARCHAR) ### question:Which store has most the customers?",SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1 What is the largest payment amount?,CREATE TABLE payment (amount VARCHAR),SELECT amount FROM payment ORDER BY amount DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE payment (amount VARCHAR) ### question:What is the largest payment amount?",SELECT amount FROM payment ORDER BY amount DESC LIMIT 1 Where does the staff member with the first name Elsa live?,"CREATE TABLE staff (address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR)",SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) ### question:Where does the staff member with the first name Elsa live?",SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa' What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?,"CREATE TABLE customer (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER); CREATE TABLE rental (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER)",SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER); CREATE TABLE rental (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER) ### question:What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?",SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01') How many bank branches are there?,CREATE TABLE bank (Id VARCHAR),SELECT COUNT(*) FROM bank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (Id VARCHAR) ### question:How many bank branches are there?",SELECT COUNT(*) FROM bank How many customers are there?,CREATE TABLE bank (no_of_customers INTEGER),SELECT SUM(no_of_customers) FROM bank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (no_of_customers INTEGER) ### question:How many customers are there?",SELECT SUM(no_of_customers) FROM bank Find the number of customers in the banks at New York City.,"CREATE TABLE bank (no_of_customers INTEGER, city VARCHAR)",SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (no_of_customers INTEGER, city VARCHAR) ### question:Find the number of customers in the banks at New York City.",SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City' Find the average number of customers in all banks of Utah state.,"CREATE TABLE bank (no_of_customers INTEGER, state VARCHAR)",SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (no_of_customers INTEGER, state VARCHAR) ### question:Find the average number of customers in all banks of Utah state.",SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah' Find the average number of customers cross all banks.,CREATE TABLE bank (no_of_customers INTEGER),SELECT AVG(no_of_customers) FROM bank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (no_of_customers INTEGER) ### question:Find the average number of customers cross all banks.",SELECT AVG(no_of_customers) FROM bank Find the city and state of the bank branch named morningside.,"CREATE TABLE bank (city VARCHAR, state VARCHAR, bname VARCHAR)","SELECT city, state FROM bank WHERE bname = 'morningside'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (city VARCHAR, state VARCHAR, bname VARCHAR) ### question:Find the city and state of the bank branch named morningside.","SELECT city, state FROM bank WHERE bname = 'morningside'" Find the branch names of banks in the New York state.,"CREATE TABLE bank (bname VARCHAR, state VARCHAR)",SELECT bname FROM bank WHERE state = 'New York',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (bname VARCHAR, state VARCHAR) ### question:Find the branch names of banks in the New York state.",SELECT bname FROM bank WHERE state = 'New York' List the name of all customers sorted by their account balance in ascending order.,"CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR)",SELECT cust_name FROM customer ORDER BY acc_bal,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR) ### question:List the name of all customers sorted by their account balance in ascending order.",SELECT cust_name FROM customer ORDER BY acc_bal List the name of all different customers who have some loan sorted by their total loan amount.,"CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR)",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR) ### question:List the name of all different customers who have some loan sorted by their total loan amount.",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) "Find the state, account type, and credit score of the customer whose number of loan is 0.","CREATE TABLE customer (state VARCHAR, acc_type VARCHAR, credit_score VARCHAR, no_of_loans VARCHAR)","SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (state VARCHAR, acc_type VARCHAR, credit_score VARCHAR, no_of_loans VARCHAR) ### question:Find the state, account type, and credit score of the customer whose number of loan is 0.","SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0" Find the number of different cities which banks are located at.,CREATE TABLE bank (city VARCHAR),SELECT COUNT(DISTINCT city) FROM bank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (city VARCHAR) ### question:Find the number of different cities which banks are located at.",SELECT COUNT(DISTINCT city) FROM bank Find the number of different states which banks are located at.,CREATE TABLE bank (state VARCHAR),SELECT COUNT(DISTINCT state) FROM bank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (state VARCHAR) ### question:Find the number of different states which banks are located at.",SELECT COUNT(DISTINCT state) FROM bank How many distinct types of accounts are there?,CREATE TABLE customer (acc_type VARCHAR),SELECT COUNT(DISTINCT acc_type) FROM customer,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (acc_type VARCHAR) ### question:How many distinct types of accounts are there?",SELECT COUNT(DISTINCT acc_type) FROM customer Find the name and account balance of the customer whose name includes the letter ‘a’.,"CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR)","SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR) ### question:Find the name and account balance of the customer whose name includes the letter ‘a’.","SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'" Find the total account balance of each customer from Utah or Texas.,"CREATE TABLE customer (acc_bal INTEGER, state VARCHAR)",SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (acc_bal INTEGER, state VARCHAR) ### question:Find the total account balance of each customer from Utah or Texas.",SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' Find the name of customers who have both saving and checking account types.,"CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR)",SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR) ### question:Find the name of customers who have both saving and checking account types.",SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking' Find the name of customers who do not have an saving account.,"CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR)",SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR) ### question:Find the name of customers who do not have an saving account.",SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' Find the name of customers who do not have a loan with a type of Mortgages.,"CREATE TABLE loan (cust_id VARCHAR, loan_type VARCHAR); CREATE TABLE customer (cust_name VARCHAR); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR)",SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (cust_id VARCHAR, loan_type VARCHAR); CREATE TABLE customer (cust_name VARCHAR); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR) ### question:Find the name of customers who do not have a loan with a type of Mortgages.",SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' Find the name of customers who have loans of both Mortgages and Auto.,"CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR)",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR) ### question:Find the name of customers who have loans of both Mortgages and Auto.",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto' Find the name of customers whose credit score is below the average credit scores of all customers.,"CREATE TABLE customer (cust_name VARCHAR, credit_score INTEGER)",SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, credit_score INTEGER) ### question:Find the name of customers whose credit score is below the average credit scores of all customers.",SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer) Find the branch name of the bank that has the most number of customers.,"CREATE TABLE bank (bname VARCHAR, no_of_customers VARCHAR)",SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (bname VARCHAR, no_of_customers VARCHAR) ### question:Find the branch name of the bank that has the most number of customers.",SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 Find the name of customer who has the lowest credit score.,"CREATE TABLE customer (cust_name VARCHAR, credit_score VARCHAR)",SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, credit_score VARCHAR) ### question:Find the name of customer who has the lowest credit score.",SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 "Find the name, account type, and account balance of the customer who has the highest credit score.","CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR, acc_bal VARCHAR, credit_score VARCHAR)","SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR, acc_bal VARCHAR, credit_score VARCHAR) ### question:Find the name, account type, and account balance of the customer who has the highest credit score.","SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1" Find the name of customer who has the highest amount of loans.,"CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR)",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR) ### question:Find the name of customer who has the highest amount of loans.",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1 Find the state which has the most number of customers.,"CREATE TABLE bank (state VARCHAR, no_of_customers INTEGER)",SELECT state FROM bank GROUP BY state ORDER BY SUM(no_of_customers) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (state VARCHAR, no_of_customers INTEGER) ### question:Find the state which has the most number of customers.",SELECT state FROM bank GROUP BY state ORDER BY SUM(no_of_customers) DESC LIMIT 1 "For each account type, find the average account balance of customers with credit score lower than 50.","CREATE TABLE customer (acc_type VARCHAR, acc_bal INTEGER, credit_score INTEGER)","SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (acc_type VARCHAR, acc_bal INTEGER, credit_score INTEGER) ### question:For each account type, find the average account balance of customers with credit score lower than 50.","SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type" "For each state, find the total account balance of customers whose credit score is above 100.","CREATE TABLE customer (state VARCHAR, acc_bal INTEGER, credit_score INTEGER)","SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (state VARCHAR, acc_bal INTEGER, credit_score INTEGER) ### question:For each state, find the total account balance of customers whose credit score is above 100.","SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state" Find the total amount of loans offered by each bank branch.,"CREATE TABLE loan (branch_id VARCHAR); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR)","SELECT SUM(amount), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (branch_id VARCHAR); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR) ### question:Find the total amount of loans offered by each bank branch.","SELECT SUM(amount), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname" Find the name of customers who have more than one loan.,"CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR)",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR) ### question:Find the name of customers who have more than one loan.",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING COUNT(*) > 1 Find the name and account balance of the customers who have loans with a total amount of more than 5000.,"CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR, cust_id VARCHAR)","SELECT T1.cust_name, T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING SUM(T2.amount) > 5000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR, cust_id VARCHAR) ### question:Find the name and account balance of the customers who have loans with a total amount of more than 5000.","SELECT T1.cust_name, T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING SUM(T2.amount) > 5000" Find the name of bank branch that provided the greatest total amount of loans.,"CREATE TABLE loan (branch_id VARCHAR, amount INTEGER); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR)",SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY SUM(T2.amount) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (branch_id VARCHAR, amount INTEGER); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR) ### question:Find the name of bank branch that provided the greatest total amount of loans.",SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY SUM(T2.amount) DESC LIMIT 1 Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.,"CREATE TABLE loan (branch_id VARCHAR, cust_id VARCHAR, amount INTEGER); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR); CREATE TABLE customer (cust_id VARCHAR, credit_score INTEGER)",SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (branch_id VARCHAR, cust_id VARCHAR, amount INTEGER); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR); CREATE TABLE customer (cust_id VARCHAR, credit_score INTEGER) ### question:Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.",SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC LIMIT 1 Find the name of bank branches that provided some loans.,"CREATE TABLE loan (branch_id VARCHAR); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR)",SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (branch_id VARCHAR); CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR) ### question:Find the name of bank branches that provided some loans.",SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id Find the name and credit score of the customers who have some loans.,"CREATE TABLE customer (cust_name VARCHAR, credit_score VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR)","SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, credit_score VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR) ### question:Find the name and credit score of the customers who have some loans.","SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id" Find the the name of the customers who have a loan with amount more than 3000.,"CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR)",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR) ### question:Find the the name of the customers who have a loan with amount more than 3000.",SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000 Find the city and name of bank branches that provide business loans.,"CREATE TABLE bank (bname VARCHAR, city VARCHAR, branch_id VARCHAR); CREATE TABLE loan (branch_id VARCHAR, loan_type VARCHAR)","SELECT T1.bname, T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (bname VARCHAR, city VARCHAR, branch_id VARCHAR); CREATE TABLE loan (branch_id VARCHAR, loan_type VARCHAR) ### question:Find the city and name of bank branches that provide business loans.","SELECT T1.bname, T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'" Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.,"CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR); CREATE TABLE customer (cust_id VARCHAR, credit_score INTEGER); CREATE TABLE loan (branch_id VARCHAR, cust_id VARCHAR)",SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (bname VARCHAR, branch_id VARCHAR); CREATE TABLE customer (cust_id VARCHAR, credit_score INTEGER); CREATE TABLE loan (branch_id VARCHAR, cust_id VARCHAR) ### question:Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.",SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 Find the total amount of loans provided by bank branches in the state of New York.,"CREATE TABLE bank (branch_id VARCHAR, state VARCHAR); CREATE TABLE loan (amount INTEGER, branch_id VARCHAR)",SELECT SUM(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bank (branch_id VARCHAR, state VARCHAR); CREATE TABLE loan (amount INTEGER, branch_id VARCHAR) ### question:Find the total amount of loans provided by bank branches in the state of New York.",SELECT SUM(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York' Find the average credit score of the customers who have some loan.,"CREATE TABLE loan (credit_score INTEGER, cust_id VARCHAR); CREATE TABLE customer (credit_score INTEGER, cust_id VARCHAR)",SELECT AVG(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (credit_score INTEGER, cust_id VARCHAR); CREATE TABLE customer (credit_score INTEGER, cust_id VARCHAR) ### question:Find the average credit score of the customers who have some loan.",SELECT AVG(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) Find the average credit score of the customers who do not have any loan.,"CREATE TABLE loan (credit_score INTEGER, cust_id VARCHAR); CREATE TABLE customer (credit_score INTEGER, cust_id VARCHAR)",SELECT AVG(credit_score) FROM customer WHERE NOT cust_id IN (SELECT cust_id FROM loan),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE loan (credit_score INTEGER, cust_id VARCHAR); CREATE TABLE customer (credit_score INTEGER, cust_id VARCHAR) ### question:Find the average credit score of the customers who do not have any loan.",SELECT AVG(credit_score) FROM customer WHERE NOT cust_id IN (SELECT cust_id FROM loan) How many assessment notes are there in total?,CREATE TABLE ASSESSMENT_NOTES (Id VARCHAR),SELECT COUNT(*) FROM ASSESSMENT_NOTES,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ASSESSMENT_NOTES (Id VARCHAR) ### question:How many assessment notes are there in total?",SELECT COUNT(*) FROM ASSESSMENT_NOTES What are the dates of the assessment notes?,CREATE TABLE Assessment_Notes (date_of_notes VARCHAR),SELECT date_of_notes FROM Assessment_Notes,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assessment_Notes (date_of_notes VARCHAR) ### question:What are the dates of the assessment notes?",SELECT date_of_notes FROM Assessment_Notes How many addresses have zip code 197?,CREATE TABLE ADDRESSES (zip_postcode VARCHAR),"SELECT COUNT(*) FROM ADDRESSES WHERE zip_postcode = ""197""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ADDRESSES (zip_postcode VARCHAR) ### question:How many addresses have zip code 197?","SELECT COUNT(*) FROM ADDRESSES WHERE zip_postcode = ""197""" How many distinct incident type codes are there?,CREATE TABLE Behavior_Incident (incident_type_code VARCHAR),SELECT COUNT(DISTINCT incident_type_code) FROM Behavior_Incident,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Behavior_Incident (incident_type_code VARCHAR) ### question:How many distinct incident type codes are there?",SELECT COUNT(DISTINCT incident_type_code) FROM Behavior_Incident Return all distinct detention type codes.,CREATE TABLE Detention (detention_type_code VARCHAR),SELECT DISTINCT detention_type_code FROM Detention,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Detention (detention_type_code VARCHAR) ### question:Return all distinct detention type codes.",SELECT DISTINCT detention_type_code FROM Detention "What are the start and end dates for incidents with incident type code ""NOISE""?","CREATE TABLE Behavior_Incident (date_incident_start VARCHAR, date_incident_end VARCHAR, incident_type_code VARCHAR)","SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = ""NOISE""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Behavior_Incident (date_incident_start VARCHAR, date_incident_end VARCHAR, incident_type_code VARCHAR) ### question:What are the start and end dates for incidents with incident type code ""NOISE""?","SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = ""NOISE""" Return all detention summaries.,CREATE TABLE Detention (detention_summary VARCHAR),SELECT detention_summary FROM Detention,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Detention (detention_summary VARCHAR) ### question:Return all detention summaries.",SELECT detention_summary FROM Detention Return the cell phone number and email address for all students.,"CREATE TABLE STUDENTS (cell_mobile_number VARCHAR, email_address VARCHAR)","SELECT cell_mobile_number, email_address FROM STUDENTS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENTS (cell_mobile_number VARCHAR, email_address VARCHAR) ### question:Return the cell phone number and email address for all students.","SELECT cell_mobile_number, email_address FROM STUDENTS" "What is the email of the student with first name ""Emma"" and last name ""Rohan""?","CREATE TABLE Students (email_address VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT email_address FROM Students WHERE first_name = ""Emma"" AND last_name = ""Rohan""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (email_address VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:What is the email of the student with first name ""Emma"" and last name ""Rohan""?","SELECT email_address FROM Students WHERE first_name = ""Emma"" AND last_name = ""Rohan""" How many distinct students have been in detention?,CREATE TABLE Students_in_Detention (student_id VARCHAR),SELECT COUNT(DISTINCT student_id) FROM Students_in_Detention,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students_in_Detention (student_id VARCHAR) ### question:How many distinct students have been in detention?",SELECT COUNT(DISTINCT student_id) FROM Students_in_Detention "What is the gender of the teacher with last name ""Medhurst""?","CREATE TABLE TEACHERS (gender VARCHAR, last_name VARCHAR)","SELECT gender FROM TEACHERS WHERE last_name = ""Medhurst""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TEACHERS (gender VARCHAR, last_name VARCHAR) ### question:What is the gender of the teacher with last name ""Medhurst""?","SELECT gender FROM TEACHERS WHERE last_name = ""Medhurst""" "What is the incident type description for the incident type with code ""VIOLENCE""?","CREATE TABLE Ref_Incident_Type (incident_type_description VARCHAR, incident_type_code VARCHAR)","SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = ""VIOLENCE""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Incident_Type (incident_type_description VARCHAR, incident_type_code VARCHAR) ### question:What is the incident type description for the incident type with code ""VIOLENCE""?","SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = ""VIOLENCE""" Find the maximum and minimum monthly rental for all student addresses.,CREATE TABLE Student_Addresses (monthly_rental INTEGER),"SELECT MAX(monthly_rental), MIN(monthly_rental) FROM Student_Addresses","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Addresses (monthly_rental INTEGER) ### question:Find the maximum and minimum monthly rental for all student addresses.","SELECT MAX(monthly_rental), MIN(monthly_rental) FROM Student_Addresses" "Find the first names of teachers whose email address contains the word ""man"".","CREATE TABLE Teachers (first_name VARCHAR, email_address VARCHAR)",SELECT first_name FROM Teachers WHERE email_address LIKE '%man%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Teachers (first_name VARCHAR, email_address VARCHAR) ### question:Find the first names of teachers whose email address contains the word ""man"".",SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' List all information about the assessment notes sorted by date in ascending order.,CREATE TABLE Assessment_Notes (date_of_notes VARCHAR),SELECT * FROM Assessment_Notes ORDER BY date_of_notes,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assessment_Notes (date_of_notes VARCHAR) ### question:List all information about the assessment notes sorted by date in ascending order.",SELECT * FROM Assessment_Notes ORDER BY date_of_notes List all cities of addresses in alphabetical order.,CREATE TABLE Addresses (city VARCHAR),SELECT city FROM Addresses ORDER BY city,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (city VARCHAR) ### question:List all cities of addresses in alphabetical order.",SELECT city FROM Addresses ORDER BY city Find the first names and last names of teachers in alphabetical order of last name.,"CREATE TABLE Teachers (first_name VARCHAR, last_name VARCHAR)","SELECT first_name, last_name FROM Teachers ORDER BY last_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Teachers (first_name VARCHAR, last_name VARCHAR) ### question:Find the first names and last names of teachers in alphabetical order of last name.","SELECT first_name, last_name FROM Teachers ORDER BY last_name" "Find all information about student addresses, and sort by monthly rental in descending order.",CREATE TABLE Student_Addresses (monthly_rental VARCHAR),SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Addresses (monthly_rental VARCHAR) ### question:Find all information about student addresses, and sort by monthly rental in descending order.",SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC Find the id and first name of the student that has the most number of assessment notes?,"CREATE TABLE Students (first_name VARCHAR, student_id VARCHAR); CREATE TABLE Assessment_Notes (student_id VARCHAR)","SELECT T1.student_id, T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (first_name VARCHAR, student_id VARCHAR); CREATE TABLE Assessment_Notes (student_id VARCHAR) ### question:Find the id and first name of the student that has the most number of assessment notes?","SELECT T1.student_id, T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1" Find the ids and first names of the 3 teachers that have the most number of assessment notes?,"CREATE TABLE Assessment_Notes (teacher_id VARCHAR); CREATE TABLE Teachers (first_name VARCHAR, teacher_id VARCHAR)","SELECT T1.teacher_id, T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assessment_Notes (teacher_id VARCHAR); CREATE TABLE Teachers (first_name VARCHAR, teacher_id VARCHAR) ### question:Find the ids and first names of the 3 teachers that have the most number of assessment notes?","SELECT T1.teacher_id, T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 3" Find the id and last name of the student that has the most behavior incidents?,"CREATE TABLE Students (last_name VARCHAR, student_id VARCHAR); CREATE TABLE Behavior_Incident (student_id VARCHAR)","SELECT T1.student_id, T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (last_name VARCHAR, student_id VARCHAR); CREATE TABLE Behavior_Incident (student_id VARCHAR) ### question:Find the id and last name of the student that has the most behavior incidents?","SELECT T1.student_id, T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1" "Find the id and last name of the teacher that has the most detentions with detention type code ""AFTER""?","CREATE TABLE Detention (teacher_id VARCHAR, detention_type_code VARCHAR); CREATE TABLE Teachers (last_name VARCHAR, teacher_id VARCHAR)","SELECT T1.teacher_id, T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = ""AFTER"" GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Detention (teacher_id VARCHAR, detention_type_code VARCHAR); CREATE TABLE Teachers (last_name VARCHAR, teacher_id VARCHAR) ### question:Find the id and last name of the teacher that has the most detentions with detention type code ""AFTER""?","SELECT T1.teacher_id, T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = ""AFTER"" GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 1" What are the id and first name of the student whose addresses have the highest average monthly rental?,"CREATE TABLE Students (first_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Addresses (student_id VARCHAR)","SELECT T1.student_id, T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (first_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Addresses (student_id VARCHAR) ### question:What are the id and first name of the student whose addresses have the highest average monthly rental?","SELECT T1.student_id, T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1" Find the id and city of the student address with the highest average monthly rental.,"CREATE TABLE Student_Addresses (address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR)","SELECT T2.address_id, T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Addresses (address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) ### question:Find the id and city of the student address with the highest average monthly rental.","SELECT T2.address_id, T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1" What are the code and description of the most frequent behavior incident type?,"CREATE TABLE Ref_Incident_Type (incident_type_description VARCHAR, incident_type_code VARCHAR); CREATE TABLE Behavior_Incident (incident_type_code VARCHAR)","SELECT T1.incident_type_code, T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Incident_Type (incident_type_description VARCHAR, incident_type_code VARCHAR); CREATE TABLE Behavior_Incident (incident_type_code VARCHAR) ### question:What are the code and description of the most frequent behavior incident type?","SELECT T1.incident_type_code, T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY COUNT(*) DESC LIMIT 1" What are the code and description of the least frequent detention type ?,"CREATE TABLE Ref_Detention_Type (detention_type_description VARCHAR, detention_type_code VARCHAR); CREATE TABLE Detention (detention_type_code VARCHAR)","SELECT T1.detention_type_code, T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY COUNT(*) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Detention_Type (detention_type_description VARCHAR, detention_type_code VARCHAR); CREATE TABLE Detention (detention_type_code VARCHAR) ### question:What are the code and description of the least frequent detention type ?","SELECT T1.detention_type_code, T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY COUNT(*) LIMIT 1" "Find the dates of assessment notes for students with first name ""Fanny"".","CREATE TABLE Students (student_id VARCHAR, first_name VARCHAR); CREATE TABLE Assessment_Notes (date_of_notes VARCHAR, student_id VARCHAR)","SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = ""Fanny""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (student_id VARCHAR, first_name VARCHAR); CREATE TABLE Assessment_Notes (date_of_notes VARCHAR, student_id VARCHAR) ### question:Find the dates of assessment notes for students with first name ""Fanny"".","SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = ""Fanny""" "Find the texts of assessment notes for teachers with last name ""Schuster"".","CREATE TABLE Assessment_Notes (text_of_notes VARCHAR, teacher_id VARCHAR); CREATE TABLE Teachers (teacher_id VARCHAR, last_name VARCHAR)","SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = ""Schuster""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assessment_Notes (text_of_notes VARCHAR, teacher_id VARCHAR); CREATE TABLE Teachers (teacher_id VARCHAR, last_name VARCHAR) ### question:Find the texts of assessment notes for teachers with last name ""Schuster"".","SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = ""Schuster""" "Find the start and end dates of behavior incidents of students with last name ""Fahey"".","CREATE TABLE Behavior_Incident (date_incident_start VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, last_name VARCHAR)","SELECT T1.date_incident_start, date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = ""Fahey""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Behavior_Incident (date_incident_start VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, last_name VARCHAR) ### question:Find the start and end dates of behavior incidents of students with last name ""Fahey"".","SELECT T1.date_incident_start, date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = ""Fahey""" "Find the start and end dates of detentions of teachers with last name ""Schultz"".","CREATE TABLE Detention (datetime_detention_start VARCHAR, teacher_id VARCHAR); CREATE TABLE Teachers (teacher_id VARCHAR, last_name VARCHAR)","SELECT T1.datetime_detention_start, datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = ""Schultz""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Detention (datetime_detention_start VARCHAR, teacher_id VARCHAR); CREATE TABLE Teachers (teacher_id VARCHAR, last_name VARCHAR) ### question:Find the start and end dates of detentions of teachers with last name ""Schultz"".","SELECT T1.datetime_detention_start, datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = ""Schultz""" What are the id and zip code of the address with the highest monthly rental?,"CREATE TABLE Student_Addresses (address_id VARCHAR); CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR)","SELECT T2.address_id, T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Addresses (address_id VARCHAR); CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR) ### question:What are the id and zip code of the address with the highest monthly rental?","SELECT T2.address_id, T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1" What is the cell phone number of the student whose address has the lowest monthly rental?,"CREATE TABLE Students (cell_mobile_number VARCHAR, student_id VARCHAR); CREATE TABLE Student_Addresses (student_id VARCHAR, monthly_rental VARCHAR)",SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (cell_mobile_number VARCHAR, student_id VARCHAR); CREATE TABLE Student_Addresses (student_id VARCHAR, monthly_rental VARCHAR) ### question:What is the cell phone number of the student whose address has the lowest monthly rental?",SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental LIMIT 1 What are the monthly rentals of student addresses in Texas state?,"CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Student_Addresses (monthly_rental VARCHAR, address_id VARCHAR)","SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = ""Texas""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Student_Addresses (monthly_rental VARCHAR, address_id VARCHAR) ### question:What are the monthly rentals of student addresses in Texas state?","SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = ""Texas""" What are the first names and last names of students with address in Wisconsin state?,"CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Students (first_name VARCHAR, last_name VARCHAR, address_id VARCHAR)","SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = ""Wisconsin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Students (first_name VARCHAR, last_name VARCHAR, address_id VARCHAR) ### question:What are the first names and last names of students with address in Wisconsin state?","SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = ""Wisconsin""" What are the line 1 and average monthly rentals of all student addresses?,"CREATE TABLE Addresses (line_1 VARCHAR, address_id VARCHAR); CREATE TABLE Student_Addresses (monthly_rental INTEGER, address_id VARCHAR)","SELECT T1.line_1, AVG(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (line_1 VARCHAR, address_id VARCHAR); CREATE TABLE Student_Addresses (monthly_rental INTEGER, address_id VARCHAR) ### question:What are the line 1 and average monthly rentals of all student addresses?","SELECT T1.line_1, AVG(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id" "What is the zip code of the address where the teacher with first name ""Lyla"" lives?","CREATE TABLE Teachers (address_id VARCHAR, first_name VARCHAR); CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR)","SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = ""Lyla""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Teachers (address_id VARCHAR, first_name VARCHAR); CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR) ### question:What is the zip code of the address where the teacher with first name ""Lyla"" lives?","SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = ""Lyla""" "What are the email addresses of teachers whose address has zip code ""918""?","CREATE TABLE Addresses (address_id VARCHAR, zip_postcode VARCHAR); CREATE TABLE Teachers (email_address VARCHAR, address_id VARCHAR)","SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = ""918""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (address_id VARCHAR, zip_postcode VARCHAR); CREATE TABLE Teachers (email_address VARCHAR, address_id VARCHAR) ### question:What are the email addresses of teachers whose address has zip code ""918""?","SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = ""918""" How many students are not involved in any behavior incident?,CREATE TABLE STUDENTS (student_id VARCHAR); CREATE TABLE Behavior_Incident (student_id VARCHAR),SELECT COUNT(*) FROM STUDENTS WHERE NOT student_id IN (SELECT student_id FROM Behavior_Incident),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENTS (student_id VARCHAR); CREATE TABLE Behavior_Incident (student_id VARCHAR) ### question:How many students are not involved in any behavior incident?",SELECT COUNT(*) FROM STUDENTS WHERE NOT student_id IN (SELECT student_id FROM Behavior_Incident) Find the last names of teachers who are not involved in any detention.,"CREATE TABLE Teachers (last_name VARCHAR); CREATE TABLE Teachers (last_name VARCHAR, teacher_id VARCHAR); CREATE TABLE Detention (teacher_id VARCHAR)",SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Teachers (last_name VARCHAR); CREATE TABLE Teachers (last_name VARCHAR, teacher_id VARCHAR); CREATE TABLE Detention (teacher_id VARCHAR) ### question:Find the last names of teachers who are not involved in any detention.",SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id What are the line 1 of addresses shared by some students and some teachers?,"CREATE TABLE Teachers (address_id VARCHAR); CREATE TABLE Students (address_id VARCHAR); CREATE TABLE Addresses (line_1 VARCHAR, address_id VARCHAR)",SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Teachers (address_id VARCHAR); CREATE TABLE Students (address_id VARCHAR); CREATE TABLE Addresses (line_1 VARCHAR, address_id VARCHAR) ### question:What are the line 1 of addresses shared by some students and some teachers?",SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.,"CREATE TABLE Assets (asset_id VARCHAR, asset_details VARCHAR); CREATE TABLE Asset_Parts (asset_id VARCHAR); CREATE TABLE Fault_Log (asset_id VARCHAR)","SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) = 2 INTERSECT SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) < 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assets (asset_id VARCHAR, asset_details VARCHAR); CREATE TABLE Asset_Parts (asset_id VARCHAR); CREATE TABLE Fault_Log (asset_id VARCHAR) ### question:Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.","SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) = 2 INTERSECT SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) < 2" How many assets does each maintenance contract contain? List the number and the contract id.,CREATE TABLE Assets (maintenance_contract_id VARCHAR); CREATE TABLE Maintenance_Contracts (maintenance_contract_id VARCHAR),"SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assets (maintenance_contract_id VARCHAR); CREATE TABLE Maintenance_Contracts (maintenance_contract_id VARCHAR) ### question:How many assets does each maintenance contract contain? List the number and the contract id.","SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id" How many assets does each third party company supply? List the count and the company id.,CREATE TABLE Assets (supplier_company_id VARCHAR); CREATE TABLE Third_Party_Companies (company_id VARCHAR),"SELECT COUNT(*), T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assets (supplier_company_id VARCHAR); CREATE TABLE Third_Party_Companies (company_id VARCHAR) ### question:How many assets does each third party company supply? List the count and the company id.","SELECT COUNT(*), T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id" Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.,"CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR); CREATE TABLE Maintenance_Engineers (company_id VARCHAR); CREATE TABLE Third_Party_Companies (company_id VARCHAR, company_name VARCHAR)","SELECT T1.company_id, T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(*) >= 2 UNION SELECT T3.company_id, T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id = T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR); CREATE TABLE Maintenance_Engineers (company_id VARCHAR); CREATE TABLE Third_Party_Companies (company_id VARCHAR, company_name VARCHAR) ### question:Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.","SELECT T1.company_id, T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(*) >= 2 UNION SELECT T3.company_id, T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id = T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING COUNT(*) >= 2" What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers?,"CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE Fault_Log (recorded_by_staff_id VARCHAR)","SELECT T1.staff_name, T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id = T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name, T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id = T4.contact_staff_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE Fault_Log (recorded_by_staff_id VARCHAR) ### question:What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers?","SELECT T1.staff_name, T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id = T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name, T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id = T4.contact_staff_id" "Which engineer has visited the most times? Show the engineer id, first name and last name.","CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Engineer_Visits (Id VARCHAR)","SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Engineer_Visits (Id VARCHAR) ### question:Which engineer has visited the most times? Show the engineer id, first name and last name.","SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY COUNT(*) DESC LIMIT 1" Which parts have more than 2 faults? Show the part name and id.,"CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Part_Faults (part_id VARCHAR)","SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id HAVING COUNT(*) > 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Part_Faults (part_id VARCHAR) ### question:Which parts have more than 2 faults? Show the part name and id.","SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id HAVING COUNT(*) > 2" "List all every engineer's first name, last name, details and coresponding skill description.","CREATE TABLE Maintenance_Engineers (first_name VARCHAR, last_name VARCHAR, other_details VARCHAR, engineer_id VARCHAR); CREATE TABLE Engineer_Skills (engineer_id VARCHAR, skill_id VARCHAR); CREATE TABLE Skills (skill_description VARCHAR, skill_id VARCHAR)","SELECT T1.first_name, T1.last_name, T1.other_details, T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Maintenance_Engineers (first_name VARCHAR, last_name VARCHAR, other_details VARCHAR, engineer_id VARCHAR); CREATE TABLE Engineer_Skills (engineer_id VARCHAR, skill_id VARCHAR); CREATE TABLE Skills (skill_description VARCHAR, skill_id VARCHAR) ### question:List all every engineer's first name, last name, details and coresponding skill description.","SELECT T1.first_name, T1.last_name, T1.other_details, T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id" "For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.","CREATE TABLE Skills_Required_To_Fix (part_fault_id VARCHAR, skill_id VARCHAR); CREATE TABLE Part_Faults (fault_short_name VARCHAR, part_fault_id VARCHAR); CREATE TABLE Skills (skill_description VARCHAR, skill_id VARCHAR)","SELECT T1.fault_short_name, T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Skills_Required_To_Fix (part_fault_id VARCHAR, skill_id VARCHAR); CREATE TABLE Part_Faults (fault_short_name VARCHAR, part_fault_id VARCHAR); CREATE TABLE Skills (skill_description VARCHAR, skill_id VARCHAR) ### question:For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.","SELECT T1.fault_short_name, T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id" How many assets can each parts be used in? List the part name and the number.,"CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Asset_Parts (part_id VARCHAR)","SELECT T1.part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Asset_Parts (part_id VARCHAR) ### question:How many assets can each parts be used in? List the part name and the number.","SELECT T1.part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name" What are all the fault descriptions and the fault status of all the faults recoreded in the logs?,"CREATE TABLE Fault_Log (fault_description VARCHAR, fault_log_entry_id VARCHAR); CREATE TABLE Fault_Log_Parts (fault_status VARCHAR, fault_log_entry_id VARCHAR)","SELECT T1.fault_description, T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Fault_Log (fault_description VARCHAR, fault_log_entry_id VARCHAR); CREATE TABLE Fault_Log_Parts (fault_status VARCHAR, fault_log_entry_id VARCHAR) ### question:What are all the fault descriptions and the fault status of all the faults recoreded in the logs?","SELECT T1.fault_description, T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id" How many engineer visits are required at most for a single fault log? List the number and the log entry id.,CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR); CREATE TABLE Engineer_Visits (fault_log_entry_id VARCHAR),"SELECT COUNT(*), T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR); CREATE TABLE Engineer_Visits (fault_log_entry_id VARCHAR) ### question:How many engineer visits are required at most for a single fault log? List the number and the log entry id.","SELECT COUNT(*), T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1" What are all the distinct last names of all the engineers?,CREATE TABLE Maintenance_Engineers (last_name VARCHAR),SELECT DISTINCT last_name FROM Maintenance_Engineers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Maintenance_Engineers (last_name VARCHAR) ### question:What are all the distinct last names of all the engineers?",SELECT DISTINCT last_name FROM Maintenance_Engineers How many fault status codes are recorded in the fault log parts table?,CREATE TABLE Fault_Log_Parts (fault_status VARCHAR),SELECT DISTINCT fault_status FROM Fault_Log_Parts,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Fault_Log_Parts (fault_status VARCHAR) ### question:How many fault status codes are recorded in the fault log parts table?",SELECT DISTINCT fault_status FROM Fault_Log_Parts Which engineers have never visited to maintain the assets? List the engineer first name and last name.,"CREATE TABLE Engineer_Visits (first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR); CREATE TABLE Maintenance_Engineers (first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR)","SELECT first_name, last_name FROM Maintenance_Engineers WHERE NOT engineer_id IN (SELECT engineer_id FROM Engineer_Visits)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Engineer_Visits (first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR); CREATE TABLE Maintenance_Engineers (first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR) ### question:Which engineers have never visited to maintain the assets? List the engineer first name and last name.","SELECT first_name, last_name FROM Maintenance_Engineers WHERE NOT engineer_id IN (SELECT engineer_id FROM Engineer_Visits)" "List the asset id, details, make and model for every asset.","CREATE TABLE Assets (asset_id VARCHAR, asset_details VARCHAR, asset_make VARCHAR, asset_model VARCHAR)","SELECT asset_id, asset_details, asset_make, asset_model FROM Assets","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assets (asset_id VARCHAR, asset_details VARCHAR, asset_make VARCHAR, asset_model VARCHAR) ### question:List the asset id, details, make and model for every asset.","SELECT asset_id, asset_details, asset_make, asset_model FROM Assets" When was the first asset acquired?,CREATE TABLE Assets (asset_acquired_date VARCHAR),SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assets (asset_acquired_date VARCHAR) ### question:When was the first asset acquired?",SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date LIMIT 1 Which part fault requires the most number of skills to fix? List part id and name.,"CREATE TABLE Part_Faults (part_id VARCHAR, part_fault_id VARCHAR); CREATE TABLE Skills_Required_To_Fix (part_fault_id VARCHAR); CREATE TABLE Parts (part_id VARCHAR, part_name VARCHAR)","SELECT T1.part_id, T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Part_Faults (part_id VARCHAR, part_fault_id VARCHAR); CREATE TABLE Skills_Required_To_Fix (part_fault_id VARCHAR); CREATE TABLE Parts (part_id VARCHAR, part_name VARCHAR) ### question:Which part fault requires the most number of skills to fix? List part id and name.","SELECT T1.part_id, T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id ORDER BY COUNT(*) DESC LIMIT 1" Which kind of part has the least number of faults? List the part name.,"CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Part_Faults (part_id VARCHAR)",SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Part_Faults (part_id VARCHAR) ### question:Which kind of part has the least number of faults? List the part name.",SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) LIMIT 1 "Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.","CREATE TABLE Engineer_Visits (engineer_id VARCHAR); CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY COUNT(*) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Engineer_Visits (engineer_id VARCHAR); CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.","SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY COUNT(*) LIMIT 1" Which staff have contacted which engineers? List the staff name and the engineer first name and last name.,"CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR, engineer_id VARCHAR); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE Maintenance_Engineers (first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR)","SELECT T1.staff_name, T3.first_name, T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR, engineer_id VARCHAR); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE Maintenance_Engineers (first_name VARCHAR, last_name VARCHAR, engineer_id VARCHAR) ### question:Which staff have contacted which engineers? List the staff name and the engineer first name and last name.","SELECT T1.staff_name, T3.first_name, T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id" "Which fault log included the most number of faulty parts? List the fault log id, description and record time.","CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR, fault_description VARCHAR, fault_log_entry_datetime VARCHAR); CREATE TABLE Fault_Log_Parts (fault_log_entry_id VARCHAR)","SELECT T1.fault_log_entry_id, T1.fault_description, T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR, fault_description VARCHAR, fault_log_entry_datetime VARCHAR); CREATE TABLE Fault_Log_Parts (fault_log_entry_id VARCHAR) ### question:Which fault log included the most number of faulty parts? List the fault log id, description and record time.","SELECT T1.fault_log_entry_id, T1.fault_description, T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1" Which skill is used in fixing the most number of faults? List the skill id and description.,"CREATE TABLE Skills (skill_id VARCHAR, skill_description VARCHAR); CREATE TABLE Skills_Required_To_Fix (skill_id VARCHAR)","SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Skills (skill_id VARCHAR, skill_description VARCHAR); CREATE TABLE Skills_Required_To_Fix (skill_id VARCHAR) ### question:Which skill is used in fixing the most number of faults? List the skill id and description.","SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1" What are all the distinct asset models?,CREATE TABLE Assets (asset_model VARCHAR),SELECT DISTINCT asset_model FROM Assets,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assets (asset_model VARCHAR) ### question:What are all the distinct asset models?",SELECT DISTINCT asset_model FROM Assets "List the all the assets make, model, details by the disposed date ascendingly.","CREATE TABLE Assets (asset_make VARCHAR, asset_model VARCHAR, asset_details VARCHAR, asset_disposed_date VARCHAR)","SELECT asset_make, asset_model, asset_details FROM Assets ORDER BY asset_disposed_date","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Assets (asset_make VARCHAR, asset_model VARCHAR, asset_details VARCHAR, asset_disposed_date VARCHAR) ### question:List the all the assets make, model, details by the disposed date ascendingly.","SELECT asset_make, asset_model, asset_details FROM Assets ORDER BY asset_disposed_date" Which part has the least chargeable amount? List the part id and amount.,"CREATE TABLE Parts (part_id VARCHAR, chargeable_amount VARCHAR)","SELECT part_id, chargeable_amount FROM Parts ORDER BY chargeable_amount LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Parts (part_id VARCHAR, chargeable_amount VARCHAR) ### question:Which part has the least chargeable amount? List the part id and amount.","SELECT part_id, chargeable_amount FROM Parts ORDER BY chargeable_amount LIMIT 1" Which company started the earliest the maintenance contract? Show the company name.,"CREATE TABLE Third_Party_Companies (company_name VARCHAR, company_id VARCHAR); CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR, contract_start_date VARCHAR)",SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_start_date LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Third_Party_Companies (company_name VARCHAR, company_id VARCHAR); CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR, contract_start_date VARCHAR) ### question:Which company started the earliest the maintenance contract? Show the company name.",SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_start_date LIMIT 1 What is the description of the type of the company who concluded its contracts most recently?,"CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR, contract_end_date VARCHAR); CREATE TABLE Third_Party_Companies (company_name VARCHAR, company_id VARCHAR, company_type_code VARCHAR); CREATE TABLE Ref_Company_Types (company_type_code VARCHAR)",SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code = T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR, contract_end_date VARCHAR); CREATE TABLE Third_Party_Companies (company_name VARCHAR, company_id VARCHAR, company_type_code VARCHAR); CREATE TABLE Ref_Company_Types (company_type_code VARCHAR) ### question:What is the description of the type of the company who concluded its contracts most recently?",SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code = T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1 Which gender makes up the majority of the staff?,CREATE TABLE staff (gender VARCHAR),SELECT gender FROM staff GROUP BY gender ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (gender VARCHAR) ### question:Which gender makes up the majority of the staff?",SELECT gender FROM staff GROUP BY gender ORDER BY COUNT(*) DESC LIMIT 1 How many engineers did each staff contact? List both the contact staff name and number of engineers contacted.,"CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR)","SELECT T1.staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR) ### question:How many engineers did each staff contact? List both the contact staff name and number of engineers contacted.","SELECT T1.staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name" Which assets did not incur any fault log? List the asset model.,"CREATE TABLE Fault_Log (asset_model VARCHAR, asset_id VARCHAR); CREATE TABLE Assets (asset_model VARCHAR, asset_id VARCHAR)",SELECT asset_model FROM Assets WHERE NOT asset_id IN (SELECT asset_id FROM Fault_Log),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Fault_Log (asset_model VARCHAR, asset_id VARCHAR); CREATE TABLE Assets (asset_model VARCHAR, asset_id VARCHAR) ### question:Which assets did not incur any fault log? List the asset model.",SELECT asset_model FROM Assets WHERE NOT asset_id IN (SELECT asset_id FROM Fault_Log) list the local authorities and services provided by all stations.,"CREATE TABLE station (local_authority VARCHAR, services VARCHAR)","SELECT local_authority, services FROM station","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (local_authority VARCHAR, services VARCHAR) ### question:list the local authorities and services provided by all stations.","SELECT local_authority, services FROM station" show all train numbers and names ordered by their time from early to late.,"CREATE TABLE train (train_number VARCHAR, name VARCHAR, TIME VARCHAR)","SELECT train_number, name FROM train ORDER BY TIME","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (train_number VARCHAR, name VARCHAR, TIME VARCHAR) ### question:show all train numbers and names ordered by their time from early to late.","SELECT train_number, name FROM train ORDER BY TIME" "Give me the times and numbers of all trains that go to Chennai, ordered by time.","CREATE TABLE train (TIME VARCHAR, train_number VARCHAR, destination VARCHAR)","SELECT TIME, train_number FROM train WHERE destination = 'Chennai' ORDER BY TIME","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (TIME VARCHAR, train_number VARCHAR, destination VARCHAR) ### question:Give me the times and numbers of all trains that go to Chennai, ordered by time.","SELECT TIME, train_number FROM train WHERE destination = 'Chennai' ORDER BY TIME" How many trains have 'Express' in their names?,CREATE TABLE train (name VARCHAR),"SELECT COUNT(*) FROM train WHERE name LIKE ""%Express%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (name VARCHAR) ### question:How many trains have 'Express' in their names?","SELECT COUNT(*) FROM train WHERE name LIKE ""%Express%""" Find the number and time of the train that goes from Chennai to Guruvayur.,"CREATE TABLE train (train_number VARCHAR, TIME VARCHAR, origin VARCHAR, destination VARCHAR)","SELECT train_number, TIME FROM train WHERE origin = 'Chennai' AND destination = 'Guruvayur'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (train_number VARCHAR, TIME VARCHAR, origin VARCHAR, destination VARCHAR) ### question:Find the number and time of the train that goes from Chennai to Guruvayur.","SELECT train_number, TIME FROM train WHERE origin = 'Chennai' AND destination = 'Guruvayur'" Find the number of trains starting from each origin.,CREATE TABLE train (origin VARCHAR),"SELECT origin, COUNT(*) FROM train GROUP BY origin","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (origin VARCHAR) ### question:Find the number of trains starting from each origin.","SELECT origin, COUNT(*) FROM train GROUP BY origin" Find the name of the train whose route runs through greatest number of stations.,"CREATE TABLE route (train_id VARCHAR); CREATE TABLE train (name VARCHAR, id VARCHAR)",SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE route (train_id VARCHAR); CREATE TABLE train (name VARCHAR, id VARCHAR) ### question:Find the name of the train whose route runs through greatest number of stations.",SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER BY COUNT(*) DESC LIMIT 1 "Find the number of trains for each station, as well as the station network name and services.","CREATE TABLE route (station_id VARCHAR); CREATE TABLE station (network_name VARCHAR, services VARCHAR, id VARCHAR)","SELECT COUNT(*), t1.network_name, t1.services FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE route (station_id VARCHAR); CREATE TABLE station (network_name VARCHAR, services VARCHAR, id VARCHAR) ### question:Find the number of trains for each station, as well as the station network name and services.","SELECT COUNT(*), t1.network_name, t1.services FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id" What is the average high temperature for each day of week?,"CREATE TABLE weekly_weather (day_of_week VARCHAR, high_temperature INTEGER)","SELECT AVG(high_temperature), day_of_week FROM weekly_weather GROUP BY day_of_week","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE weekly_weather (day_of_week VARCHAR, high_temperature INTEGER) ### question:What is the average high temperature for each day of week?","SELECT AVG(high_temperature), day_of_week FROM weekly_weather GROUP BY day_of_week" Give me the maximum low temperature and average precipitation at the Amersham station.,"CREATE TABLE weekly_weather (low_temperature INTEGER, precipitation INTEGER, station_id VARCHAR); CREATE TABLE station (id VARCHAR, network_name VARCHAR)","SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = ""Amersham""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE weekly_weather (low_temperature INTEGER, precipitation INTEGER, station_id VARCHAR); CREATE TABLE station (id VARCHAR, network_name VARCHAR) ### question:Give me the maximum low temperature and average precipitation at the Amersham station.","SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = ""Amersham""" Find names and times of trains that run through stations for the local authority Chiltern.,"CREATE TABLE station (id VARCHAR, local_authority VARCHAR); CREATE TABLE route (station_id VARCHAR, train_id VARCHAR); CREATE TABLE train (name VARCHAR, time VARCHAR, id VARCHAR)","SELECT t3.name, t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = ""Chiltern""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (id VARCHAR, local_authority VARCHAR); CREATE TABLE route (station_id VARCHAR, train_id VARCHAR); CREATE TABLE train (name VARCHAR, time VARCHAR, id VARCHAR) ### question:Find names and times of trains that run through stations for the local authority Chiltern.","SELECT t3.name, t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = ""Chiltern""" How many different services are provided by all stations?,CREATE TABLE station (services VARCHAR),SELECT COUNT(DISTINCT services) FROM station,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (services VARCHAR) ### question:How many different services are provided by all stations?",SELECT COUNT(DISTINCT services) FROM station Find the id and local authority of the station with has the highest average high temperature.,"CREATE TABLE weekly_weather (station_id VARCHAR); CREATE TABLE station (id VARCHAR, local_authority VARCHAR)","SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY AVG(high_temperature) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE weekly_weather (station_id VARCHAR); CREATE TABLE station (id VARCHAR, local_authority VARCHAR) ### question:Find the id and local authority of the station with has the highest average high temperature.","SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY AVG(high_temperature) DESC LIMIT 1" Find the id and local authority of the station whose maximum precipitation is higher than 50.,"CREATE TABLE weekly_weather (station_id VARCHAR, precipitation INTEGER); CREATE TABLE station (id VARCHAR, local_authority VARCHAR)","SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING MAX(t1.precipitation) > 50","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE weekly_weather (station_id VARCHAR, precipitation INTEGER); CREATE TABLE station (id VARCHAR, local_authority VARCHAR) ### question:Find the id and local authority of the station whose maximum precipitation is higher than 50.","SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING MAX(t1.precipitation) > 50" show the lowest low temperature and highest wind speed in miles per hour.,"CREATE TABLE weekly_weather (low_temperature INTEGER, wind_speed_mph INTEGER)","SELECT MIN(low_temperature), MAX(wind_speed_mph) FROM weekly_weather","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE weekly_weather (low_temperature INTEGER, wind_speed_mph INTEGER) ### question:show the lowest low temperature and highest wind speed in miles per hour.","SELECT MIN(low_temperature), MAX(wind_speed_mph) FROM weekly_weather" Find the origins from which more than 1 train starts.,CREATE TABLE train (origin VARCHAR),SELECT origin FROM train GROUP BY origin HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (origin VARCHAR) ### question:Find the origins from which more than 1 train starts.",SELECT origin FROM train GROUP BY origin HAVING COUNT(*) > 1 Find the number of professors in accounting department.,CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR),"SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = ""Accounting""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR) ### question:Find the number of professors in accounting department.","SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = ""Accounting""" How many professors are teaching class with code ACCT-211?,"CREATE TABLE CLASS (PROF_NUM VARCHAR, CRS_CODE VARCHAR)","SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = ""ACCT-211""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (PROF_NUM VARCHAR, CRS_CODE VARCHAR) ### question:How many professors are teaching class with code ACCT-211?","SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = ""ACCT-211""" What is the first and last name of the professor in biology department?,"CREATE TABLE professor (dept_code VARCHAR, EMP_NUM VARCHAR); CREATE TABLE department (dept_code VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_LNAME VARCHAR, EMP_NUM VARCHAR)","SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = ""Biology""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (dept_code VARCHAR, EMP_NUM VARCHAR); CREATE TABLE department (dept_code VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_LNAME VARCHAR, EMP_NUM VARCHAR) ### question:What is the first and last name of the professor in biology department?","SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = ""Biology""" What are the first names and date of birth of professors teaching course ACCT-211?,"CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_DOB VARCHAR, EMP_NUM VARCHAR)","SELECT DISTINCT T1.EMP_FNAME, T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = ""ACCT-211""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_DOB VARCHAR, EMP_NUM VARCHAR) ### question:What are the first names and date of birth of professors teaching course ACCT-211?","SELECT DISTINCT T1.EMP_FNAME, T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = ""ACCT-211""" How many classes are professor whose last name is Graztevski has?,"CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_NUM VARCHAR, EMP_LNAME VARCHAR)",SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_NUM VARCHAR, EMP_LNAME VARCHAR) ### question:How many classes are professor whose last name is Graztevski has?",SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski' What is the code of the school where the accounting department belongs to?,"CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)","SELECT school_code FROM department WHERE dept_name = ""Accounting""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR) ### question:What is the code of the school where the accounting department belongs to?","SELECT school_code FROM department WHERE dept_name = ""Accounting""" "How many credits does course CIS-220 have, and what its description?","CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR)","SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR) ### question:How many credits does course CIS-220 have, and what its description?","SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220'" what is the address of history department?,"CREATE TABLE department (dept_address VARCHAR, dept_name VARCHAR)",SELECT dept_address FROM department WHERE dept_name = 'History',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_address VARCHAR, dept_name VARCHAR) ### question:what is the address of history department?",SELECT dept_address FROM department WHERE dept_name = 'History' How many different locations does the school with code BUS has?,"CREATE TABLE department (dept_address VARCHAR, school_code VARCHAR)",SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_address VARCHAR, school_code VARCHAR) ### question:How many different locations does the school with code BUS has?",SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS' How many different locations does each school have?,"CREATE TABLE department (school_code VARCHAR, dept_address VARCHAR)","SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR, dept_address VARCHAR) ### question:How many different locations does each school have?","SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code" Find the description and credit for the course QM-261?,"CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR)","SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR) ### question:Find the description and credit for the course QM-261?","SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'" Find the number of departments in each school.,"CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)","SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR) ### question:Find the number of departments in each school.","SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code" Find the number of different departments in each school whose number of different departments is less than 5.,"CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)","SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code HAVING COUNT(DISTINCT dept_name) < 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR) ### question:Find the number of different departments in each school whose number of different departments is less than 5.","SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code HAVING COUNT(DISTINCT dept_name) < 5" How many sections does each course has?,CREATE TABLE CLASS (crs_code VARCHAR),"SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (crs_code VARCHAR) ### question:How many sections does each course has?","SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code" What is the total credit does each department offer?,"CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER)","SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER) ### question:What is the total credit does each department offer?","SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code" Find the number of classes offered for all class rooms that held at least 2 classes.,CREATE TABLE CLASS (class_room VARCHAR),"SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (class_room VARCHAR) ### question:Find the number of classes offered for all class rooms that held at least 2 classes.","SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2" Find the number of classes in each department.,CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR),"SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR) ### question:Find the number of classes in each department.","SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code" Find the number of classes in each school.,"CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR)","SELECT COUNT(*), T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR) ### question:Find the number of classes in each school.","SELECT COUNT(*), T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code" What is the number of professors for different school?,"CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR)","SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR) ### question:What is the number of professors for different school?","SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code" Find the count and code of the job has most employees.,CREATE TABLE employee (emp_jobcode VARCHAR),"SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (emp_jobcode VARCHAR) ### question:Find the count and code of the job has most employees.","SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1" Which school has the smallest amount of professors?,"CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR)",SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR) ### question:Which school has the smallest amount of professors?",SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY COUNT(*) LIMIT 1 Find the number of professors with a Ph.D. degree in each department.,"CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR)","SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR) ### question:Find the number of professors with a Ph.D. degree in each department.","SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code" Find the number of students for each department.,CREATE TABLE student (dept_code VARCHAR),"SELECT COUNT(*), dept_code FROM student GROUP BY dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (dept_code VARCHAR) ### question:Find the number of students for each department.","SELECT COUNT(*), dept_code FROM student GROUP BY dept_code" Find the total number of hours have done for all students in each department.,"CREATE TABLE student (dept_code VARCHAR, stu_hrs INTEGER)","SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (dept_code VARCHAR, stu_hrs INTEGER) ### question:Find the total number of hours have done for all students in each department.","SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code" "Find the max, average, and minimum gpa of all students in each department.","CREATE TABLE student (dept_code VARCHAR, stu_gpa INTEGER)","SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (dept_code VARCHAR, stu_gpa INTEGER) ### question:Find the max, average, and minimum gpa of all students in each department.","SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code" What is the name and the average gpa of department whose students have the highest average gpa?,"CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, dept_code VARCHAR)","SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, dept_code VARCHAR) ### question:What is the name and the average gpa of department whose students have the highest average gpa?","SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1" how many schools exist in total?,CREATE TABLE department (school_code VARCHAR),SELECT COUNT(DISTINCT school_code) FROM department,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (school_code VARCHAR) ### question:how many schools exist in total?",SELECT COUNT(DISTINCT school_code) FROM department How many different classes are there?,CREATE TABLE CLASS (class_code VARCHAR),SELECT COUNT(DISTINCT class_code) FROM CLASS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (class_code VARCHAR) ### question:How many different classes are there?",SELECT COUNT(DISTINCT class_code) FROM CLASS How many courses are offered?,CREATE TABLE CLASS (crs_code VARCHAR),SELECT COUNT(DISTINCT crs_code) FROM CLASS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (crs_code VARCHAR) ### question:How many courses are offered?",SELECT COUNT(DISTINCT crs_code) FROM CLASS How many departments does the college has?,CREATE TABLE department (dept_name VARCHAR),SELECT COUNT(DISTINCT dept_name) FROM department,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_name VARCHAR) ### question:How many departments does the college has?",SELECT COUNT(DISTINCT dept_name) FROM department How many courses are offered by the Computer Info. Systems department?,CREATE TABLE course (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR),"SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = ""Computer Info. Systems""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE course (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR) ### question:How many courses are offered by the Computer Info. Systems department?","SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = ""Computer Info. Systems""" How many sections does course ACCT-211 has?,"CREATE TABLE CLASS (class_section VARCHAR, crs_code VARCHAR)",SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (class_section VARCHAR, crs_code VARCHAR) ### question:How many sections does course ACCT-211 has?",SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211' Find the total credits of all classes offered by each department.,"CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER, crs_code VARCHAR)","SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER, crs_code VARCHAR) ### question:Find the total credits of all classes offered by each department.","SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code" Find the name of the department that offers the largest number of credits of all classes.,"CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR, crs_credit INTEGER)",SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR, crs_credit INTEGER) ### question:Find the name of the department that offers the largest number of credits of all classes.",SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1 How many students enrolled in class ACCT-211?,"CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR)",SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR) ### question:How many students enrolled in class ACCT-211?",SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211' What is the first name of each student enrolled in class ACCT-211?,"CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR)",SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR) ### question:What is the first name of each student enrolled in class ACCT-211?",SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' What is the first name of students enrolled in class ACCT-211 and got grade C?,"CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR, enroll_grade VARCHAR)",SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR, enroll_grade VARCHAR) ### question:What is the first name of students enrolled in class ACCT-211 and got grade C?",SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C' Find the total number of employees.,CREATE TABLE employee (Id VARCHAR),SELECT COUNT(*) FROM employee,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (Id VARCHAR) ### question:Find the total number of employees.",SELECT COUNT(*) FROM employee How many professors do have a Ph.D. degree?,CREATE TABLE professor (prof_high_degree VARCHAR),SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (prof_high_degree VARCHAR) ### question:How many professors do have a Ph.D. degree?",SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' How many students are enrolled in the class taught by some professor from the accounting department?,"CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR)",SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR) ### question:How many students are enrolled in the class taught by some professor from the accounting department?",SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting' What is the name of the department that has the largest number of students enrolled?,"CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)",SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) ### question:What is the name of the department that has the largest number of students enrolled?",SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1 list names of all departments ordered by their names.,CREATE TABLE department (dept_name VARCHAR),SELECT dept_name FROM department ORDER BY dept_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_name VARCHAR) ### question:list names of all departments ordered by their names.",SELECT dept_name FROM department ORDER BY dept_name List the codes of all courses that take place in room KLR209.,"CREATE TABLE CLASS (class_code VARCHAR, class_room VARCHAR)",SELECT class_code FROM CLASS WHERE class_room = 'KLR209',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (class_code VARCHAR, class_room VARCHAR) ### question:List the codes of all courses that take place in room KLR209.",SELECT class_code FROM CLASS WHERE class_room = 'KLR209' List the first name of all employees with job code PROF ordered by their date of birth.,"CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR, emp_dob VARCHAR)",SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR, emp_dob VARCHAR) ### question:List the first name of all employees with job code PROF ordered by their date of birth.",SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob Find the first names and offices of all professors sorted by alphabetical order of their first name.,"CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)","SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first names and offices of all professors sorted by alphabetical order of their first name.","SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname" What is the first and last name of the oldest employee?,"CREATE TABLE employee (emp_fname VARCHAR, emp_lname VARCHAR, emp_dob VARCHAR)","SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (emp_fname VARCHAR, emp_lname VARCHAR, emp_dob VARCHAR) ### question:What is the first and last name of the oldest employee?","SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1" "What is the first, last name, gpa of the youngest one among students whose GPA is above 3?","CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_gpa INTEGER, stu_dob VARCHAR)","SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_gpa INTEGER, stu_dob VARCHAR) ### question:What is the first, last name, gpa of the youngest one among students whose GPA is above 3?","SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1" What is the first name of students who got grade C in any class?,CREATE TABLE student (stu_num VARCHAR); CREATE TABLE enroll (stu_num VARCHAR),SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stu_num VARCHAR); CREATE TABLE enroll (stu_num VARCHAR) ### question:What is the first name of students who got grade C in any class?",SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C' What is the name of department where has the smallest number of professors?,"CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)",SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) ### question:What is the name of department where has the smallest number of professors?",SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) LIMIT 1 What is the name of department where has the largest number of professors with a Ph.D. degree?,"CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)","SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) ### question:What is the name of department where has the largest number of professors with a Ph.D. degree?","SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1" What are the first names of the professors who do not teach a class.,"CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)",SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:What are the first names of the professors who do not teach a class.",SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num What is the first names of the professors from the history department who do not teach a class.,"CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)",SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:What is the first names of the professors from the history department who do not teach a class.",SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num What is the last name and office of the professor from the history department?,"CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_num VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR)","SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_num VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR) ### question:What is the last name and office of the professor from the history department?","SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'" What is department name and office for the professor whose last name is Heffington?,"CREATE TABLE employee (emp_num VARCHAR, emp_lname VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR)","SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (emp_num VARCHAR, emp_lname VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR) ### question:What is department name and office for the professor whose last name is Heffington?","SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'" Find the last name and hire date of the professor who is in office DRE 102.,"CREATE TABLE professor (emp_num VARCHAR, prof_office VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_hiredate VARCHAR, emp_num VARCHAR)","SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (emp_num VARCHAR, prof_office VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_hiredate VARCHAR, emp_num VARCHAR) ### question:Find the last name and hire date of the professor who is in office DRE 102.","SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'" What is the code of the course which the student whose last name is Smithson took?,"CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR, class_code VARCHAR)",SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR, class_code VARCHAR) ### question:What is the code of the course which the student whose last name is Smithson took?",SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson' What are the description and credit of the course which the student whose last name is Smithson took?,"CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_credit VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR)","SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_credit VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR) ### question:What are the description and credit of the course which the student whose last name is Smithson took?","SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'" How many professors who has a either Ph.D. or MA degree?,CREATE TABLE professor (prof_high_degree VARCHAR),SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (prof_high_degree VARCHAR) ### question:How many professors who has a either Ph.D. or MA degree?",SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA' How many professors who are from either Accounting or Biology department?,"CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (dept_code VARCHAR)",SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (dept_code VARCHAR) ### question:How many professors who are from either Accounting or Biology department?",SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology' Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.,"CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)",SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.",SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261' Find the first name of student who is taking classes from accounting and Computer Info. Systems departments,"CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR)",SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR) ### question:Find the first name of student who is taking classes from accounting and Computer Info. Systems departments",SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems' What is the average gpa of the students enrolled in the course with code ACCT-211?,"CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, stu_num VARCHAR)",SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, stu_num VARCHAR) ### question:What is the average gpa of the students enrolled in the course with code ACCT-211?",SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' "What is the first name, gpa and phone number of the top 5 students with highest gpa?","CREATE TABLE student (stu_gpa VARCHAR, stu_phone VARCHAR, stu_fname VARCHAR)","SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stu_gpa VARCHAR, stu_phone VARCHAR, stu_fname VARCHAR) ### question:What is the first name, gpa and phone number of the top 5 students with highest gpa?","SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5" What is the department name of the students with lowest gpa belongs to?,"CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)",SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) ### question:What is the department name of the students with lowest gpa belongs to?",SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1 Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.,"CREATE TABLE student (stu_fname VARCHAR, stu_gpa INTEGER)","SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stu_fname VARCHAR, stu_gpa INTEGER) ### question:Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.","SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)" Find the name and address of the department that has the highest number of students.,"CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR)","SELECT T2.dept_name, T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR) ### question:Find the name and address of the department that has the highest number of students.","SELECT T2.dept_name, T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1" "Find the name, address, number of students in the departments that have the top 3 highest number of students.","CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR)","SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR) ### question:Find the name, address, number of students in the departments that have the top 3 highest number of students.","SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3" Find the first name and office of the professor who is in the history department and has a Ph.D. degree.,"CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)","SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first name and office of the professor who is in the history department and has a Ph.D. degree.","SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'" Find the first names of all instructors who have taught some course and the course code.,"CREATE TABLE CLASS (crs_code VARCHAR, prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)","SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (crs_code VARCHAR, prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first names of all instructors who have taught some course and the course code.","SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num" Find the first names of all instructors who have taught some course and the course description.,"CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)","SELECT T2.emp_fname, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first names of all instructors who have taught some course and the course description.","SELECT T2.emp_fname, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code" Find the first names and offices of all instructors who have taught some course and also find the course description.,"CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)","SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first names and offices of all instructors who have taught some course and also find the course description.","SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num" Find the first names and offices of all instructors who have taught some course and the course description and the department name.,"CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR)","SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR) ### question:Find the first names and offices of all instructors who have taught some course and the course description and the department name.","SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code" Find names of all students who took some course and the course description.,"CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR)","SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR) ### question:Find names of all students who took some course and the course description.","SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code" Find names of all students who took some course and got A or C.,"CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR)","SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR) ### question:Find names of all students who took some course and got A or C.","SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'" Find the first names of all professors in the Accounting department who is teaching some course and the class room.,"CREATE TABLE CLASS (class_room VARCHAR, prof_num VARCHAR); CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)","SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CLASS (class_room VARCHAR, prof_num VARCHAR); CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first names of all professors in the Accounting department who is teaching some course and the class room.","SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'" Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.,"CREATE TABLE professor (prof_high_degree VARCHAR, emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR)","SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE professor (prof_high_degree VARCHAR, emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR) ### question:Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.","SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'" What is the last name of the student who got a grade A in the class with code 10018.,"CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR, class_code VARCHAR); CREATE TABLE student (stu_lname VARCHAR, stu_num VARCHAR)",SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR, class_code VARCHAR); CREATE TABLE student (stu_lname VARCHAR, stu_num VARCHAR) ### question:What is the last name of the student who got a grade A in the class with code 10018.",SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018 Find the first name and office of history professor who did not get a Ph.D. degree.,"CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)","SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR) ### question:Find the first name and office of history professor who did not get a Ph.D. degree.","SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.'" Find the first names of professors who are teaching more than one class.,"CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR)",SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR) ### question:Find the first names of professors who are teaching more than one class.",SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1 Find the first names of students who took exactly one class.,"CREATE TABLE enroll (stu_num VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR)",SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (stu_num VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR) ### question:Find the first names of students who took exactly one class.",SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1 "Find the name of department that offers the class whose description has the word ""Statistics"".","CREATE TABLE course (dept_code VARCHAR, crs_description VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)",SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE course (dept_code VARCHAR, crs_description VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR) ### question:Find the name of department that offers the class whose description has the word ""Statistics"".",SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%' What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?,"CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR, stu_lname VARCHAR)",SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR, stu_lname VARCHAR) ### question:What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?",SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%' How many clubs are there?,CREATE TABLE club (Id VARCHAR),SELECT COUNT(*) FROM club,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (Id VARCHAR) ### question:How many clubs are there?",SELECT COUNT(*) FROM club List the distinct region of clubs in ascending alphabetical order.,CREATE TABLE club (Region VARCHAR),SELECT DISTINCT Region FROM club ORDER BY Region,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (Region VARCHAR) ### question:List the distinct region of clubs in ascending alphabetical order.",SELECT DISTINCT Region FROM club ORDER BY Region What is the average number of gold medals for clubs?,CREATE TABLE club_rank (Gold INTEGER),SELECT AVG(Gold) FROM club_rank,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club_rank (Gold INTEGER) ### question:What is the average number of gold medals for clubs?",SELECT AVG(Gold) FROM club_rank What are the types and countries of competitions?,"CREATE TABLE competition (Competition_type VARCHAR, Country VARCHAR)","SELECT Competition_type, Country FROM competition","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (Competition_type VARCHAR, Country VARCHAR) ### question:What are the types and countries of competitions?","SELECT Competition_type, Country FROM competition" "What are the distinct years in which the competitions type is not ""Tournament""?","CREATE TABLE competition (YEAR VARCHAR, Competition_type VARCHAR)","SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> ""Tournament""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (YEAR VARCHAR, Competition_type VARCHAR) ### question:What are the distinct years in which the competitions type is not ""Tournament""?","SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> ""Tournament""" What are the maximum and minimum number of silver medals for clubs.,CREATE TABLE club_rank (Silver INTEGER),"SELECT MAX(Silver), MIN(Silver) FROM club_rank","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club_rank (Silver INTEGER) ### question:What are the maximum and minimum number of silver medals for clubs.","SELECT MAX(Silver), MIN(Silver) FROM club_rank" How many clubs have total medals less than 10?,CREATE TABLE club_rank (Total INTEGER),SELECT COUNT(*) FROM club_rank WHERE Total < 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club_rank (Total INTEGER) ### question:How many clubs have total medals less than 10?",SELECT COUNT(*) FROM club_rank WHERE Total < 10 List all club names in ascending order of start year.,"CREATE TABLE club (name VARCHAR, Start_year VARCHAR)",SELECT name FROM club ORDER BY Start_year,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (name VARCHAR, Start_year VARCHAR) ### question:List all club names in ascending order of start year.",SELECT name FROM club ORDER BY Start_year List all club names in descending alphabetical order.,CREATE TABLE club (name VARCHAR),SELECT name FROM club ORDER BY name DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (name VARCHAR) ### question:List all club names in descending alphabetical order.",SELECT name FROM club ORDER BY name DESC Please show the names and the players of clubs.,"CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Player_id VARCHAR, Club_ID VARCHAR)","SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Player_id VARCHAR, Club_ID VARCHAR) ### question:Please show the names and the players of clubs.","SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID" "Show the names of clubs that have players with position ""Right Wing"".","CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Club_ID VARCHAR, Position VARCHAR)","SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = ""Right Wing""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Club_ID VARCHAR, Position VARCHAR) ### question:Show the names of clubs that have players with position ""Right Wing"".","SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = ""Right Wing""" "What is the average points of players from club with name ""AIB"".","CREATE TABLE player (Points INTEGER, Club_ID VARCHAR); CREATE TABLE club (Club_ID VARCHAR, name VARCHAR)","SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = ""AIB""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Points INTEGER, Club_ID VARCHAR); CREATE TABLE club (Club_ID VARCHAR, name VARCHAR) ### question:What is the average points of players from club with name ""AIB"".","SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = ""AIB""" List the position of players and the average number of points of players of each position.,"CREATE TABLE player (POSITION VARCHAR, Points INTEGER)","SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (POSITION VARCHAR, Points INTEGER) ### question:List the position of players and the average number of points of players of each position.","SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION" List the position of players with average number of points scored by players of that position bigger than 20.,"CREATE TABLE player (POSITION VARCHAR, name VARCHAR, Points INTEGER)",SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (POSITION VARCHAR, name VARCHAR, Points INTEGER) ### question:List the position of players with average number of points scored by players of that position bigger than 20.",SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20 List the types of competition and the number of competitions of each type.,CREATE TABLE competition (Competition_type VARCHAR),"SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (Competition_type VARCHAR) ### question:List the types of competition and the number of competitions of each type.","SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type" List the most common type of competition.,CREATE TABLE competition (Competition_type VARCHAR),SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (Competition_type VARCHAR) ### question:List the most common type of competition.",SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 List the types of competition that have at most five competitions of that type.,CREATE TABLE competition (Competition_type VARCHAR),SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (Competition_type VARCHAR) ### question:List the types of competition that have at most five competitions of that type.",SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5 List the names of clubs that do not have any players.,"CREATE TABLE player (name VARCHAR, Club_ID VARCHAR); CREATE TABLE CLub (name VARCHAR, Club_ID VARCHAR)",SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name VARCHAR, Club_ID VARCHAR); CREATE TABLE CLub (name VARCHAR, Club_ID VARCHAR) ### question:List the names of clubs that do not have any players.",SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player) What are the positions with both players having more than 20 points and less than 10 points.,"CREATE TABLE player (POSITION VARCHAR, Points INTEGER)",SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (POSITION VARCHAR, Points INTEGER) ### question:What are the positions with both players having more than 20 points and less than 10 points.",SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 Show total points of all players.,CREATE TABLE player (Points INTEGER),SELECT SUM(Points) FROM player,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Points INTEGER) ### question:Show total points of all players.",SELECT SUM(Points) FROM player how many different positions are there?,CREATE TABLE player (POSITION VARCHAR),SELECT COUNT(DISTINCT POSITION) FROM player,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (POSITION VARCHAR) ### question:how many different positions are there?",SELECT COUNT(DISTINCT POSITION) FROM player what are the name of players who get more than the average points.,"CREATE TABLE player (name VARCHAR, points INTEGER)",SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name VARCHAR, points INTEGER) ### question:what are the name of players who get more than the average points.",SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player) find the number of players whose points are lower than 30 in each position.,"CREATE TABLE player (POSITION VARCHAR, points INTEGER)","SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (POSITION VARCHAR, points INTEGER) ### question:find the number of players whose points are lower than 30 in each position.","SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION" which country did participated in the most number of Tournament competitions?,"CREATE TABLE competition (country VARCHAR, competition_type VARCHAR)",SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (country VARCHAR, competition_type VARCHAR) ### question:which country did participated in the most number of Tournament competitions?",SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 which countries did participated in both Friendly and Tournament type competitions.,"CREATE TABLE competition (country VARCHAR, competition_type VARCHAR)",SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (country VARCHAR, competition_type VARCHAR) ### question:which countries did participated in both Friendly and Tournament type competitions.",SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament' Find the countries that have never participated in any competition with Friendly type.,"CREATE TABLE competition (country VARCHAR, competition_type VARCHAR)",SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE competition (country VARCHAR, competition_type VARCHAR) ### question:Find the countries that have never participated in any competition with Friendly type.",SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly' How many furniture components are there in total?,CREATE TABLE furniture (num_of_component INTEGER),SELECT SUM(num_of_component) FROM furniture,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture (num_of_component INTEGER) ### question:How many furniture components are there in total?",SELECT SUM(num_of_component) FROM furniture Return the name and id of the furniture with the highest market rate.,"CREATE TABLE furniture (name VARCHAR, furniture_id VARCHAR, market_rate VARCHAR)","SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture (name VARCHAR, furniture_id VARCHAR, market_rate VARCHAR) ### question:Return the name and id of the furniture with the highest market rate.","SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1" find the total market rate of the furnitures that have the top 2 market shares.,CREATE TABLE furniture (market_rate INTEGER),SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture (market_rate INTEGER) ### question:find the total market rate of the furnitures that have the top 2 market shares.",SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2 Find the component amounts and names of all furnitures that have more than 10 components.,"CREATE TABLE furniture (Num_of_Component INTEGER, name VARCHAR)","SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture (Num_of_Component INTEGER, name VARCHAR) ### question:Find the component amounts and names of all furnitures that have more than 10 components.","SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10" Find the name and component amount of the least popular furniture.,"CREATE TABLE furniture (name VARCHAR, Num_of_Component VARCHAR, market_rate VARCHAR)","SELECT name, Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture (name VARCHAR, Num_of_Component VARCHAR, market_rate VARCHAR) ### question:Find the name and component amount of the least popular furniture.","SELECT name, Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1" Find the names of furnitures whose prices are lower than the highest price.,"CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, Price_in_Dollar INTEGER); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Price_in_Dollar INTEGER)",SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, Price_in_Dollar INTEGER); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Price_in_Dollar INTEGER) ### question:Find the names of furnitures whose prices are lower than the highest price.",SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte) Which manufacturer has the most number of shops? List its name and year of opening.,"CREATE TABLE manufacturer (open_year VARCHAR, name VARCHAR, num_of_shops VARCHAR)","SELECT open_year, name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturer (open_year VARCHAR, name VARCHAR, num_of_shops VARCHAR) ### question:Which manufacturer has the most number of shops? List its name and year of opening.","SELECT open_year, name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1" Find the average number of factories for the manufacturers that have more than 20 shops.,"CREATE TABLE manufacturer (Num_of_Factories INTEGER, num_of_shops INTEGER)",SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturer (Num_of_Factories INTEGER, num_of_shops INTEGER) ### question:Find the average number of factories for the manufacturers that have more than 20 shops.",SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20 List all manufacturer names and ids ordered by their opening year.,"CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR, open_year VARCHAR)","SELECT name, manufacturer_id FROM manufacturer ORDER BY open_year","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR, open_year VARCHAR) ### question:List all manufacturer names and ids ordered by their opening year.","SELECT name, manufacturer_id FROM manufacturer ORDER BY open_year" Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.,"CREATE TABLE manufacturer (name VARCHAR, open_year VARCHAR, num_of_shops VARCHAR, Num_of_Factories VARCHAR)","SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturer (name VARCHAR, open_year VARCHAR, num_of_shops VARCHAR, Num_of_Factories VARCHAR) ### question:Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.","SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10" what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.,"CREATE TABLE manufacturer (num_of_shops INTEGER, Num_of_Factories INTEGER, open_year INTEGER)","SELECT MAX(num_of_shops), AVG(Num_of_Factories) FROM manufacturer WHERE open_year < 1990","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturer (num_of_shops INTEGER, Num_of_Factories INTEGER, open_year INTEGER) ### question:what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.","SELECT MAX(num_of_shops), AVG(Num_of_Factories) FROM manufacturer WHERE open_year < 1990" Find the id and number of shops for the company that produces the most expensive furniture.,"CREATE TABLE manufacturer (manufacturer_id VARCHAR, num_of_shops VARCHAR); CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR, Price_in_Dollar VARCHAR)","SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturer (manufacturer_id VARCHAR, num_of_shops VARCHAR); CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR, Price_in_Dollar VARCHAR) ### question:Find the id and number of shops for the company that produces the most expensive furniture.","SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1" Find the number of funiture types produced by each manufacturer as well as the company names.,"CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR)","SELECT COUNT(*), t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture_manufacte (manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR) ### question:Find the number of funiture types produced by each manufacturer as well as the company names.","SELECT COUNT(*), t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id" Give me the names and prices of furnitures which some companies are manufacturing.,"CREATE TABLE furniture_manufacte (price_in_dollar VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR)","SELECT t1.name, t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture_manufacte (price_in_dollar VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture (name VARCHAR, Furniture_ID VARCHAR) ### question:Give me the names and prices of furnitures which some companies are manufacturing.","SELECT t1.name, t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID" Find the market shares and names of furnitures which no any company is producing in our records.,"CREATE TABLE furniture (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR)","SELECT Market_Rate, name FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR); CREATE TABLE furniture_manufacte (Market_Rate VARCHAR, name VARCHAR, Furniture_ID VARCHAR) ### question:Find the market shares and names of furnitures which no any company is producing in our records.","SELECT Market_Rate, name FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte)" Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.,"CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR); CREATE TABLE furniture (Furniture_ID VARCHAR, num_of_component INTEGER)",SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR, manufacturer_id VARCHAR); CREATE TABLE manufacturer (name VARCHAR, manufacturer_id VARCHAR); CREATE TABLE furniture (Furniture_ID VARCHAR, num_of_component INTEGER) ### question:Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.",SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10 Display the first name and department name for each employee.,"CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR)","SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR) ### question:Display the first name and department name for each employee.","SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id" "List the full name (first and last name), and salary for those employees who earn below 6000.","CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER)","SELECT first_name, last_name, salary FROM employees WHERE salary < 6000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER) ### question:List the full name (first and last name), and salary for those employees who earn below 6000.","SELECT first_name, last_name, salary FROM employees WHERE salary < 6000" "Display the first name, and department number for all employees whose last name is ""McEwen"".","CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR, last_name VARCHAR)","SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, department_id VARCHAR, last_name VARCHAR) ### question:Display the first name, and department number for all employees whose last name is ""McEwen"".","SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'" Return all the information for all employees without any department number.,CREATE TABLE employees (department_id VARCHAR),"SELECT * FROM employees WHERE department_id = ""null""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR) ### question:Return all the information for all employees without any department number.","SELECT * FROM employees WHERE department_id = ""null""" Display all the information about the department Marketing.,CREATE TABLE departments (department_name VARCHAR),SELECT * FROM departments WHERE department_name = 'Marketing',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_name VARCHAR) ### question:Display all the information about the department Marketing.",SELECT * FROM departments WHERE department_name = 'Marketing' when is the hire date for those employees whose first name does not containing the letter M?,"CREATE TABLE employees (hire_date VARCHAR, first_name VARCHAR)",SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (hire_date VARCHAR, first_name VARCHAR) ### question:when is the hire date for those employees whose first name does not containing the letter M?",SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%' "display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.","CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR)","SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR) ### question:display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.","SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'" "display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.","CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR)","SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' ORDER BY department_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR) ### question:display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.","SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' ORDER BY department_id" what is the phone number of employees whose salary is in the range of 8000 and 12000?,"CREATE TABLE employees (phone_number VARCHAR, salary INTEGER)",SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (phone_number VARCHAR, salary INTEGER) ### question:what is the phone number of employees whose salary is in the range of 8000 and 12000?",SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000 display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40.,"CREATE TABLE employees (department_id VARCHAR, salary VARCHAR, commission_pct VARCHAR)","SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> ""null"" OR department_id <> 40","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR, salary VARCHAR, commission_pct VARCHAR) ### question:display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40.","SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> ""null"" OR department_id <> 40" What are the full name (first and last name) and salary for all employees who does not have any value for commission?,"CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR, commission_pct VARCHAR)","SELECT first_name, last_name, salary FROM employees WHERE commission_pct = ""null""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR, commission_pct VARCHAR) ### question:What are the full name (first and last name) and salary for all employees who does not have any value for commission?","SELECT first_name, last_name, salary FROM employees WHERE commission_pct = ""null""" "Display the first and last name, and salary for those employees whose first name is ending with the letter m.","CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR)","SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR) ### question:Display the first and last name, and salary for those employees whose first name is ending with the letter m.","SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m'" "Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009.","CREATE TABLE employees (job_id VARCHAR, hire_date INTEGER)","SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (job_id VARCHAR, hire_date INTEGER) ### question:Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009.","SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'" What are the first and last name for those employees who works either in department 70 or 90?,"CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR)","SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR) ### question:What are the first and last name for those employees who works either in department 70 or 90?","SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90" Find the salary and manager number for those employees who is working under a manager.,"CREATE TABLE employees (salary VARCHAR, manager_id VARCHAR)","SELECT salary, manager_id FROM employees WHERE manager_id <> ""null""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (salary VARCHAR, manager_id VARCHAR) ### question:Find the salary and manager number for those employees who is working under a manager.","SELECT salary, manager_id FROM employees WHERE manager_id <> ""null""" display all the details from Employees table for those employees who was hired before 2002-06-21.,CREATE TABLE employees (hire_date INTEGER),SELECT * FROM employees WHERE hire_date < '2002-06-21',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (hire_date INTEGER) ### question:display all the details from Employees table for those employees who was hired before 2002-06-21.",SELECT * FROM employees WHERE hire_date < '2002-06-21' display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.,"CREATE TABLE employees (salary VARCHAR, first_name VARCHAR)",SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (salary VARCHAR, first_name VARCHAR) ### question:display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.",SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC "display those employees who joined after 7th September, 1987.",CREATE TABLE employees (hire_date INTEGER),SELECT * FROM employees WHERE hire_date > '1987-09-07',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (hire_date INTEGER) ### question:display those employees who joined after 7th September, 1987.",SELECT * FROM employees WHERE hire_date > '1987-09-07' display the job title of jobs which minimum salary is greater than 9000.,"CREATE TABLE jobs (job_title VARCHAR, min_salary INTEGER)",SELECT job_title FROM jobs WHERE min_salary > 9000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE jobs (job_title VARCHAR, min_salary INTEGER) ### question:display the job title of jobs which minimum salary is greater than 9000.",SELECT job_title FROM jobs WHERE min_salary > 9000 "display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.","CREATE TABLE jobs (job_title VARCHAR, max_salary INTEGER, min_salary VARCHAR)","SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE jobs (job_title VARCHAR, max_salary INTEGER, min_salary VARCHAR) ### question:display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.","SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000" display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.,"CREATE TABLE employees (email VARCHAR, department_id VARCHAR, commission_pct VARCHAR, salary VARCHAR)","SELECT email FROM employees WHERE commission_pct = ""null"" AND salary BETWEEN 7000 AND 12000 AND department_id = 50","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (email VARCHAR, department_id VARCHAR, commission_pct VARCHAR, salary VARCHAR) ### question:display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.","SELECT email FROM employees WHERE commission_pct = ""null"" AND salary BETWEEN 7000 AND 12000 AND department_id = 50" display the employee ID for each employee and the date on which he ended his previous job.,"CREATE TABLE job_history (employee_id VARCHAR, end_date INTEGER)","SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE job_history (employee_id VARCHAR, end_date INTEGER) ### question:display the employee ID for each employee and the date on which he ended his previous job.","SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id" display those departments where more than ten employees work who got a commission percentage.,"CREATE TABLE employees (department_id VARCHAR, commission_pct VARCHAR)",SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR, commission_pct VARCHAR) ### question:display those departments where more than ten employees work who got a commission percentage.",SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10 Find the ids of the departments where any manager is managing 4 or more employees.,"CREATE TABLE employees (department_id VARCHAR, manager_id VARCHAR, employee_id VARCHAR)","SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR, manager_id VARCHAR, employee_id VARCHAR) ### question:Find the ids of the departments where any manager is managing 4 or more employees.","SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4" display the average salary of employees for each department who gets a commission percentage.,"CREATE TABLE employees (department_id VARCHAR, salary INTEGER, commission_pct VARCHAR)","SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> ""null"" GROUP BY department_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR, salary INTEGER, commission_pct VARCHAR) ### question:display the average salary of employees for each department who gets a commission percentage.","SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> ""null"" GROUP BY department_id" display the country ID and number of cities for each country.,CREATE TABLE locations (country_id VARCHAR),"SELECT country_id, COUNT(*) FROM locations GROUP BY country_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE locations (country_id VARCHAR) ### question:display the country ID and number of cities for each country.","SELECT country_id, COUNT(*) FROM locations GROUP BY country_id" display job ID for those jobs that were done by two or more for more than 300 days.,"CREATE TABLE job_history (job_id VARCHAR, end_date VARCHAR, start_date VARCHAR)",SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE job_history (job_id VARCHAR, end_date VARCHAR, start_date VARCHAR) ### question:display job ID for those jobs that were done by two or more for more than 300 days.",SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2 display the ID for those employees who did two or more jobs in the past.,CREATE TABLE job_history (employee_id VARCHAR),SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE job_history (employee_id VARCHAR) ### question:display the ID for those employees who did two or more jobs in the past.",SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 Find employee with ID and name of the country presently where (s)he is working.,"CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, department_id VARCHAR)","SELECT T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, department_id VARCHAR) ### question:Find employee with ID and name of the country presently where (s)he is working.","SELECT T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id" display the department name and number of employees in each of the department.,"CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR)","SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR) ### question:display the department name and number of employees in each of the department.","SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name" Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000?,"CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR)",SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR) ### question:Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000?",SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000 display job title and average salary of employees.,"CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (job_id VARCHAR)","SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (job_id VARCHAR) ### question:display job title and average salary of employees.","SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title" What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?,"CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, employee_id VARCHAR)","SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, employee_id VARCHAR) ### question:What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?","SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)" return the smallest salary for every departments.,"CREATE TABLE employees (department_id VARCHAR, salary INTEGER)","SELECT MIN(salary), department_id FROM employees GROUP BY department_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR, salary INTEGER) ### question:return the smallest salary for every departments.","SELECT MIN(salary), department_id FROM employees GROUP BY department_id" Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.,"CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR, salary INTEGER)","SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR, salary INTEGER) ### question:Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.","SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)" Find the employee id for all employees who earn more than the average salary.,"CREATE TABLE employees (employee_id VARCHAR, salary INTEGER)",SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (employee_id VARCHAR, salary INTEGER) ### question:Find the employee id for all employees who earn more than the average salary.",SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) display the employee id and salary of all employees who report to Payam (first name).,"CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR, manager_id VARCHAR, first_name VARCHAR)","SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR, manager_id VARCHAR, first_name VARCHAR) ### question:display the employee id and salary of all employees who report to Payam (first name).","SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam')" find the name of all departments that do actually have one or more employees assigned to them.,"CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR)",SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR) ### question:find the name of all departments that do actually have one or more employees assigned to them.",SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id get the details of employees who manage a department.,"CREATE TABLE departments (department_id VARCHAR, manager_id VARCHAR); CREATE TABLE employees (department_id VARCHAR, employee_id VARCHAR)",SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_id VARCHAR, manager_id VARCHAR); CREATE TABLE employees (department_id VARCHAR, employee_id VARCHAR) ### question:get the details of employees who manage a department.",SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id Find the job ID for those jobs which average salary is above 8000.,"CREATE TABLE employees (job_id VARCHAR, salary INTEGER)",SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (job_id VARCHAR, salary INTEGER) ### question:Find the job ID for those jobs which average salary is above 8000.",SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000 display the employee ID and job name for all those jobs in department 80.,"CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, department_id VARCHAR)","SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, department_id VARCHAR) ### question:display the employee ID and job name for all those jobs in department 80.","SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80" What is the first name and job id for all employees in the Finance department?,"CREATE TABLE departments (department_id VARCHAR, department_name VARCHAR); CREATE TABLE employees (first_name VARCHAR, job_id VARCHAR, department_id VARCHAR)","SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_id VARCHAR, department_name VARCHAR); CREATE TABLE employees (first_name VARCHAR, job_id VARCHAR, department_id VARCHAR) ### question:What is the first name and job id for all employees in the Finance department?","SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'" display all the information of the employees whose salary if within the range of smallest salary and 2500.,CREATE TABLE employees (salary INTEGER),SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (salary INTEGER) ### question:display all the information of the employees whose salary if within the range of smallest salary and 2500.",SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500 Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.,"CREATE TABLE departments (department_id VARCHAR, manager_id INTEGER); CREATE TABLE employees (department_id VARCHAR, manager_id INTEGER)",SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_id VARCHAR, manager_id INTEGER); CREATE TABLE employees (department_id VARCHAR, manager_id INTEGER) ### question:Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.",SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200) display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.,"CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR)","SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = ""Clara"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR) ### question:display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.","SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = ""Clara"")" display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara.,"CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR)","SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = ""Clara"") AND first_name <> ""Clara""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, department_id VARCHAR) ### question:display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara.","SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = ""Clara"") AND first_name <> ""Clara""" display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a ’T’.,"CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, department_id VARCHAR)","SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, department_id VARCHAR) ### question:display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a ’T’.","SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')" "display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name.","CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR)","SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR) ### question:display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name.","SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%')" display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN.,"CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, salary INTEGER)","SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, salary INTEGER) ### question:display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN.","SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN')" "display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.","CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, job_id VARCHAR, salary INTEGER)","SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, job_id VARCHAR, salary INTEGER) ### question:display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.","SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN')" display the department id and the total salary for those departments which contains at least two employees.,"CREATE TABLE employees (department_id VARCHAR, salary INTEGER)","SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR, salary INTEGER) ### question:display the department id and the total salary for those departments which contains at least two employees.","SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2" display all the information of those employees who did not have any job in the past.,CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR),SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR) ### question:display all the information of those employees who did not have any job in the past.",SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history) "display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.","CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR)","SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, department_id VARCHAR) ### question:display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.","SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id" "display the first and last name, department, city, and state province for each employee.","CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR)","SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR) ### question:display the first and last name, department, city, and state province for each employee.","SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id" "display those employees who contain a letter z to their first name and also display their last name, city.","CREATE TABLE locations (city VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR)","SELECT T1.first_name, T1.last_name, T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE locations (city VARCHAR, location_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR) ### question:display those employees who contain a letter z to their first name and also display their last name, city.","SELECT T1.first_name, T1.last_name, T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'" "display the department name, city, and state province for each department.","CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, location_id VARCHAR)","SELECT T1.department_name, T2.city, T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE locations (city VARCHAR, state_province VARCHAR, location_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, location_id VARCHAR) ### question:display the department name, city, and state province for each department.","SELECT T1.department_name, T2.city, T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id" display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.,"CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, employee_id VARCHAR, department_id VARCHAR)","SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, employee_id VARCHAR, department_id VARCHAR) ### question:display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.","SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id" display the department name and number of employees in each of the department.,CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR),"SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR) ### question:display the department name and number of employees in each of the department.","SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name" "display the full name (first and last name), and salary of those employees who working in any department located in London.","CREATE TABLE locations (location_id VARCHAR, city VARCHAR); CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR)","SELECT first_name, last_name, salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE locations (location_id VARCHAR, city VARCHAR); CREATE TABLE employees (department_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR) ### question:display the full name (first and last name), and salary of those employees who working in any department located in London.","SELECT first_name, last_name, salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'" What is the name of the song that was released in the most recent year?,"CREATE TABLE song (song_name VARCHAR, releasedate VARCHAR)","SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, releasedate VARCHAR) ### question:What is the name of the song that was released in the most recent year?","SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1" What is the id of the longest song?,"CREATE TABLE files (f_id VARCHAR, duration VARCHAR)",SELECT f_id FROM files ORDER BY duration DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (f_id VARCHAR, duration VARCHAR) ### question:What is the id of the longest song?",SELECT f_id FROM files ORDER BY duration DESC LIMIT 1 Find the names of all English songs.,"CREATE TABLE song (song_name VARCHAR, languages VARCHAR)","SELECT song_name FROM song WHERE languages = ""english""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, languages VARCHAR) ### question:Find the names of all English songs.","SELECT song_name FROM song WHERE languages = ""english""" What are the id of songs whose format is mp3.,"CREATE TABLE files (f_id VARCHAR, formats VARCHAR)","SELECT f_id FROM files WHERE formats = ""mp3""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (f_id VARCHAR, formats VARCHAR) ### question:What are the id of songs whose format is mp3.","SELECT f_id FROM files WHERE formats = ""mp3""" List the name and country of origin for all singers who have produced songs with rating above 9.,"CREATE TABLE song (artist_name VARCHAR, rating INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)","SELECT DISTINCT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, rating INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR) ### question:List the name and country of origin for all singers who have produced songs with rating above 9.","SELECT DISTINCT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9" List the file size and format for all songs that have resolution lower than 800.,"CREATE TABLE song (f_id VARCHAR, resolution INTEGER); CREATE TABLE files (file_size VARCHAR, formats VARCHAR, f_id VARCHAR)","SELECT DISTINCT T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (f_id VARCHAR, resolution INTEGER); CREATE TABLE files (file_size VARCHAR, formats VARCHAR, f_id VARCHAR) ### question:List the file size and format for all songs that have resolution lower than 800.","SELECT DISTINCT T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800" What is the name of the artist who produced the shortest song?,"CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (artist_name VARCHAR, f_id VARCHAR)",SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (artist_name VARCHAR, f_id VARCHAR) ### question:What is the name of the artist who produced the shortest song?",SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1 What are the names and countries of origin for the artists who produced the top three highly rated songs.,"CREATE TABLE song (artist_name VARCHAR, rating VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)","SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, rating VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR) ### question:What are the names and countries of origin for the artists who produced the top three highly rated songs.","SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3" How many songs have 4 minute duration?,CREATE TABLE files (duration VARCHAR),"SELECT COUNT(*) FROM files WHERE duration LIKE ""4:%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (duration VARCHAR) ### question:How many songs have 4 minute duration?","SELECT COUNT(*) FROM files WHERE duration LIKE ""4:%""" How many artists are from Bangladesh?,CREATE TABLE artist (country VARCHAR),"SELECT COUNT(*) FROM artist WHERE country = ""Bangladesh""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (country VARCHAR) ### question:How many artists are from Bangladesh?","SELECT COUNT(*) FROM artist WHERE country = ""Bangladesh""" What is the average rating of songs produced by female artists?,"CREATE TABLE song (rating INTEGER, artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR)","SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = ""Female""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (rating INTEGER, artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR) ### question:What is the average rating of songs produced by female artists?","SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = ""Female""" What is the most popular file format?,CREATE TABLE files (formats VARCHAR),SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (formats VARCHAR) ### question:What is the most popular file format?",SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1 Find the names of the artists who are from UK and have produced English songs.,"CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, languages VARCHAR); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, languages VARCHAR)","SELECT artist_name FROM artist WHERE country = ""UK"" INTERSECT SELECT artist_name FROM song WHERE languages = ""english""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, languages VARCHAR); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, languages VARCHAR) ### question:Find the names of the artists who are from UK and have produced English songs.","SELECT artist_name FROM artist WHERE country = ""UK"" INTERSECT SELECT artist_name FROM song WHERE languages = ""english""" Find the id of songs that are available in mp4 format and have resolution lower than 1000.,"CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER)","SELECT f_id FROM files WHERE formats = ""mp4"" INTERSECT SELECT f_id FROM song WHERE resolution < 1000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER) ### question:Find the id of songs that are available in mp4 format and have resolution lower than 1000.","SELECT f_id FROM files WHERE formats = ""mp4"" INTERSECT SELECT f_id FROM song WHERE resolution < 1000" What is the country of origin of the artist who is female and produced a song in Bangla?,"CREATE TABLE artist (country VARCHAR, artist_name VARCHAR, gender VARCHAR); CREATE TABLE song (artist_name VARCHAR, languages VARCHAR)","SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = ""Female"" AND T2.languages = ""bangla""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (country VARCHAR, artist_name VARCHAR, gender VARCHAR); CREATE TABLE song (artist_name VARCHAR, languages VARCHAR) ### question:What is the country of origin of the artist who is female and produced a song in Bangla?","SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = ""Female"" AND T2.languages = ""bangla""" What is the average duration of songs that have mp3 format and resolution below 800?,"CREATE TABLE files (duration INTEGER, f_id VARCHAR, formats VARCHAR); CREATE TABLE song (f_id VARCHAR, resolution VARCHAR)","SELECT AVG(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = ""mp3"" AND T2.resolution < 800","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (duration INTEGER, f_id VARCHAR, formats VARCHAR); CREATE TABLE song (f_id VARCHAR, resolution VARCHAR) ### question:What is the average duration of songs that have mp3 format and resolution below 800?","SELECT AVG(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = ""mp3"" AND T2.resolution < 800" What is the number of artists for each gender?,CREATE TABLE artist (gender VARCHAR),"SELECT COUNT(*), gender FROM artist GROUP BY gender","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (gender VARCHAR) ### question:What is the number of artists for each gender?","SELECT COUNT(*), gender FROM artist GROUP BY gender" What is the average rating of songs for each language?,"CREATE TABLE song (languages VARCHAR, rating INTEGER)","SELECT AVG(rating), languages FROM song GROUP BY languages","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (languages VARCHAR, rating INTEGER) ### question:What is the average rating of songs for each language?","SELECT AVG(rating), languages FROM song GROUP BY languages" Return the gender and name of artist who produced the song with the lowest resolution.,"CREATE TABLE artist (gender VARCHAR, artist_name VARCHAR); CREATE TABLE song (artist_name VARCHAR, resolution VARCHAR)","SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (gender VARCHAR, artist_name VARCHAR); CREATE TABLE song (artist_name VARCHAR, resolution VARCHAR) ### question:Return the gender and name of artist who produced the song with the lowest resolution.","SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1" "For each file format, return the number of artists who released songs in that format.",CREATE TABLE files (formats VARCHAR),"SELECT COUNT(*), formats FROM files GROUP BY formats","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (formats VARCHAR) ### question:For each file format, return the number of artists who released songs in that format.","SELECT COUNT(*), formats FROM files GROUP BY formats" Find the distinct names of all songs that have a higher resolution than some songs in English.,"CREATE TABLE song (song_name VARCHAR, resolution INTEGER, languages VARCHAR)","SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT MIN(resolution) FROM song WHERE languages = ""english"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, resolution INTEGER, languages VARCHAR) ### question:Find the distinct names of all songs that have a higher resolution than some songs in English.","SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT MIN(resolution) FROM song WHERE languages = ""english"")" What are the names of all songs that have a lower rating than some song of blues genre?,"CREATE TABLE song (song_name VARCHAR, rating INTEGER, genre_is VARCHAR)","SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = ""blues"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, rating INTEGER, genre_is VARCHAR) ### question:What are the names of all songs that have a lower rating than some song of blues genre?","SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = ""blues"")" "What is the name and country of origin of the artist who released a song that has ""love"" in its title?","CREATE TABLE song (artist_name VARCHAR, song_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)","SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE ""%love%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, song_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR) ### question:What is the name and country of origin of the artist who released a song that has ""love"" in its title?","SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE ""%love%""" List the name and gender for all artists who released songs in March.,"CREATE TABLE song (artist_name VARCHAR, releasedate VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR)","SELECT T1.artist_name, T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE ""%Mar%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, releasedate VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR) ### question:List the name and gender for all artists who released songs in March.","SELECT T1.artist_name, T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE ""%Mar%""" "List the names of all genres in alphabetical oder, together with its ratings.","CREATE TABLE genre (g_name VARCHAR, rating VARCHAR)","SELECT g_name, rating FROM genre ORDER BY g_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE genre (g_name VARCHAR, rating VARCHAR) ### question:List the names of all genres in alphabetical oder, together with its ratings.","SELECT g_name, rating FROM genre ORDER BY g_name" Give me a list of the names of all songs ordered by their resolution.,"CREATE TABLE song (song_name VARCHAR, resolution VARCHAR)",SELECT song_name FROM song ORDER BY resolution,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, resolution VARCHAR) ### question:Give me a list of the names of all songs ordered by their resolution.",SELECT song_name FROM song ORDER BY resolution What are the ids of songs that are available in either mp4 format or have resolution above 720?,"CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER)","SELECT f_id FROM files WHERE formats = ""mp4"" UNION SELECT f_id FROM song WHERE resolution > 720","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER) ### question:What are the ids of songs that are available in either mp4 format or have resolution above 720?","SELECT f_id FROM files WHERE formats = ""mp4"" UNION SELECT f_id FROM song WHERE resolution > 720" List the names of all songs that have 4 minute duration or are in English.,"CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (song_name VARCHAR, f_id VARCHAR); CREATE TABLE song (song_name VARCHAR, languages VARCHAR)","SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE ""4:%"" UNION SELECT song_name FROM song WHERE languages = ""english""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (song_name VARCHAR, f_id VARCHAR); CREATE TABLE song (song_name VARCHAR, languages VARCHAR) ### question:List the names of all songs that have 4 minute duration or are in English.","SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE ""4:%"" UNION SELECT song_name FROM song WHERE languages = ""english""" What is the language used most often in the songs?,CREATE TABLE song (languages VARCHAR),SELECT languages FROM song GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (languages VARCHAR) ### question:What is the language used most often in the songs?",SELECT languages FROM song GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1 What is the language that was used most often in songs with resolution above 500?,"CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, resolution INTEGER)",SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, resolution INTEGER) ### question:What is the language that was used most often in songs with resolution above 500?",SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1 What are the names of artists who are Male and are from UK?,"CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, gender VARCHAR)","SELECT artist_name FROM artist WHERE country = ""UK"" AND gender = ""Male""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, gender VARCHAR) ### question:What are the names of artists who are Male and are from UK?","SELECT artist_name FROM artist WHERE country = ""UK"" AND gender = ""Male""" Find the names of songs whose genre is modern or language is English.,"CREATE TABLE song (song_name VARCHAR, genre_is VARCHAR, languages VARCHAR)","SELECT song_name FROM song WHERE genre_is = ""modern"" OR languages = ""english""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, genre_is VARCHAR, languages VARCHAR) ### question:Find the names of songs whose genre is modern or language is English.","SELECT song_name FROM song WHERE genre_is = ""modern"" OR languages = ""english""" Return the names of songs for which format is mp3 and resolution is below 1000.,"CREATE TABLE song (song_name VARCHAR, resolution INTEGER); CREATE TABLE song (song_name VARCHAR, f_id VARCHAR); CREATE TABLE files (f_id VARCHAR, formats VARCHAR)","SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = ""mp3"" INTERSECT SELECT song_name FROM song WHERE resolution < 1000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, resolution INTEGER); CREATE TABLE song (song_name VARCHAR, f_id VARCHAR); CREATE TABLE files (f_id VARCHAR, formats VARCHAR) ### question:Return the names of songs for which format is mp3 and resolution is below 1000.","SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = ""mp3"" INTERSECT SELECT song_name FROM song WHERE resolution < 1000" Return the names of singers who are from UK and released an English song.,"CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)","SELECT artist_name FROM artist WHERE country = ""UK"" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""english""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR) ### question:Return the names of singers who are from UK and released an English song.","SELECT artist_name FROM artist WHERE country = ""UK"" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""english""" What are the average rating and resolution of songs that are in Bangla?,"CREATE TABLE song (rating INTEGER, resolution INTEGER, languages VARCHAR)","SELECT AVG(rating), AVG(resolution) FROM song WHERE languages = ""bangla""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (rating INTEGER, resolution INTEGER, languages VARCHAR) ### question:What are the average rating and resolution of songs that are in Bangla?","SELECT AVG(rating), AVG(resolution) FROM song WHERE languages = ""bangla""" What are the maximum and minimum resolution of songs whose duration is 3 minutes?,"CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (resolution INTEGER, f_id VARCHAR)","SELECT MAX(T2.resolution), MIN(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE ""3:%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (resolution INTEGER, f_id VARCHAR) ### question:What are the maximum and minimum resolution of songs whose duration is 3 minutes?","SELECT MAX(T2.resolution), MIN(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE ""3:%""" What are the maximum duration and resolution of songs grouped and ordered by languages?,"CREATE TABLE song (languages VARCHAR, resolution INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR)","SELECT MAX(T1.duration), MAX(T2.resolution), T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (languages VARCHAR, resolution INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR) ### question:What are the maximum duration and resolution of songs grouped and ordered by languages?","SELECT MAX(T1.duration), MAX(T2.resolution), T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages" What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre?,"CREATE TABLE song (genre_is VARCHAR, rating INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR)","SELECT MIN(T1.duration), MIN(T2.rating), T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (genre_is VARCHAR, rating INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR) ### question:What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre?","SELECT MIN(T1.duration), MIN(T2.rating), T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is" Find the names and number of works of all artists who have at least one English songs.,"CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR)","SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""english"" GROUP BY T2.artist_name HAVING COUNT(*) >= 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR) ### question:Find the names and number of works of all artists who have at least one English songs.","SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""english"" GROUP BY T2.artist_name HAVING COUNT(*) >= 1" Find the name and country of origin for all artists who have release at least one song of resolution above 900.,"CREATE TABLE song (artist_name VARCHAR, resolution INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)","SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING COUNT(*) >= 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, resolution INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR) ### question:Find the name and country of origin for all artists who have release at least one song of resolution above 900.","SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING COUNT(*) >= 1" Find the names and number of works of the three artists who have produced the most songs.,CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR),"SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR) ### question:Find the names and number of works of the three artists who have produced the most songs.","SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3" Find the country of origin for the artist who made the least number of songs?,"CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (country VARCHAR, artist_name VARCHAR)",SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (country VARCHAR, artist_name VARCHAR) ### question:Find the country of origin for the artist who made the least number of songs?",SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) LIMIT 1 What are the names of the songs whose rating is below the rating of all songs in English?,"CREATE TABLE song (song_name VARCHAR, rating INTEGER, languages VARCHAR)",SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (song_name VARCHAR, rating INTEGER, languages VARCHAR) ### question:What are the names of the songs whose rating is below the rating of all songs in English?",SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english') What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?,"CREATE TABLE song (f_id VARCHAR, resolution INTEGER, rating INTEGER)",SELECT f_id FROM song WHERE resolution > (SELECT MAX(resolution) FROM song WHERE rating < 8),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (f_id VARCHAR, resolution INTEGER, rating INTEGER) ### question:What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?",SELECT f_id FROM song WHERE resolution > (SELECT MAX(resolution) FROM song WHERE rating < 8) What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?,"CREATE TABLE song (f_id VARCHAR, resolution INTEGER, genre_is VARCHAR)","SELECT f_id FROM song WHERE resolution > (SELECT AVG(resolution) FROM song WHERE genre_is = ""modern"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (f_id VARCHAR, resolution INTEGER, genre_is VARCHAR) ### question:What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?","SELECT f_id FROM song WHERE resolution > (SELECT AVG(resolution) FROM song WHERE genre_is = ""modern"")" Find the top 3 artists who have the largest number of songs works whose language is Bangla.,"CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR)","SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""bangla"" GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR) ### question:Find the top 3 artists who have the largest number of songs works whose language is Bangla.","SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""bangla"" GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3" "List the id, genre and artist name of English songs ordered by rating.","CREATE TABLE song (f_id VARCHAR, genre_is VARCHAR, artist_name VARCHAR, languages VARCHAR, rating VARCHAR)","SELECT f_id, genre_is, artist_name FROM song WHERE languages = ""english"" ORDER BY rating","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (f_id VARCHAR, genre_is VARCHAR, artist_name VARCHAR, languages VARCHAR, rating VARCHAR) ### question:List the id, genre and artist name of English songs ordered by rating.","SELECT f_id, genre_is, artist_name FROM song WHERE languages = ""english"" ORDER BY rating" "List the duration, file size and format of songs whose genre is pop, ordered by title?","CREATE TABLE song (f_id VARCHAR, genre_is VARCHAR, song_name VARCHAR); CREATE TABLE files (duration VARCHAR, file_size VARCHAR, formats VARCHAR, f_id VARCHAR)","SELECT T1.duration, T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = ""pop"" ORDER BY T2.song_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (f_id VARCHAR, genre_is VARCHAR, song_name VARCHAR); CREATE TABLE files (duration VARCHAR, file_size VARCHAR, formats VARCHAR, f_id VARCHAR) ### question:List the duration, file size and format of songs whose genre is pop, ordered by title?","SELECT T1.duration, T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = ""pop"" ORDER BY T2.song_name" Find the names of the artists who have produced English songs but have never received rating higher than 8.,"CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, rating INTEGER)","SELECT DISTINCT artist_name FROM song WHERE languages = ""english"" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, rating INTEGER) ### question:Find the names of the artists who have produced English songs but have never received rating higher than 8.","SELECT DISTINCT artist_name FROM song WHERE languages = ""english"" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8" Find the names of the artists who are from Bangladesh and have never received rating higher than 7.,"CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, rating INTEGER); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, rating INTEGER)","SELECT DISTINCT artist_name FROM artist WHERE country = ""Bangladesh"" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, rating INTEGER); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, rating INTEGER) ### question:Find the names of the artists who are from Bangladesh and have never received rating higher than 7.","SELECT DISTINCT artist_name FROM artist WHERE country = ""Bangladesh"" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7" what is the full name and id of the college with the largest number of baseball players?,"CREATE TABLE player_college (college_id VARCHAR); CREATE TABLE college (name_full VARCHAR, college_id VARCHAR)","SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player_college (college_id VARCHAR); CREATE TABLE college (name_full VARCHAR, college_id VARCHAR) ### question:what is the full name and id of the college with the largest number of baseball players?","SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1" What is average salary of the players in the team named 'Boston Red Stockings' ?,"CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)",SELECT AVG(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR) ### question:What is average salary of the players in the team named 'Boston Red Stockings' ?",SELECT AVG(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' What are first and last names of players participating in all star game in 1998?,CREATE TABLE all_star (player_id VARCHAR); CREATE TABLE player (player_id VARCHAR),"SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_star (player_id VARCHAR); CREATE TABLE player (player_id VARCHAR) ### question:What are first and last names of players participating in all star game in 1998?","SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998" "What are the first name, last name and id of the player with the most all star game experiences? Also list the count.","CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE all_star (player_id VARCHAR)","SELECT T1.name_first, T1.name_last, T1.player_id, COUNT(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE all_star (player_id VARCHAR) ### question:What are the first name, last name and id of the player with the most all star game experiences? Also list the count.","SELECT T1.name_first, T1.name_last, T1.player_id, COUNT(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 1" How many players enter hall of fame each year?,CREATE TABLE hall_of_fame (yearid VARCHAR),"SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE hall_of_fame (yearid VARCHAR) ### question:How many players enter hall of fame each year?","SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid" What is the average number of attendance at home games for each year?,"CREATE TABLE home_game (YEAR VARCHAR, attendance INTEGER)","SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE home_game (YEAR VARCHAR, attendance INTEGER) ### question:What is the average number of attendance at home games for each year?","SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR" "In 2014, what are the id and rank of the team that has the largest average number of attendance?","CREATE TABLE team (team_id VARCHAR, rank VARCHAR); CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance INTEGER)","SELECT T2.team_id, T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY AVG(T1.attendance) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE team (team_id VARCHAR, rank VARCHAR); CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance INTEGER) ### question:In 2014, what are the id and rank of the team that has the largest average number of attendance?","SELECT T2.team_id, T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY AVG(T1.attendance) DESC LIMIT 1" "What are the manager's first name, last name and id who won the most manager award?","CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE manager_award (player_id VARCHAR)","SELECT T1.name_first, T1.name_last, T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE manager_award (player_id VARCHAR) ### question:What are the manager's first name, last name and id who won the most manager award?","SELECT T1.name_first, T1.name_last, T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY COUNT(*) DESC LIMIT 1" How many parks are there in the state of NY?,CREATE TABLE park (state VARCHAR),SELECT COUNT(*) FROM park WHERE state = 'NY',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE park (state VARCHAR) ### question:How many parks are there in the state of NY?",SELECT COUNT(*) FROM park WHERE state = 'NY' Which 3 players won the most player awards? List their full name and id.,"CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE player_award (player_id VARCHAR)","SELECT T1.name_first, T1.name_last, T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE player_award (player_id VARCHAR) ### question:Which 3 players won the most player awards? List their full name and id.","SELECT T1.name_first, T1.name_last, T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 3" List three countries which are the origins of the least players.,CREATE TABLE player (birth_country VARCHAR),SELECT birth_country FROM player GROUP BY birth_country ORDER BY COUNT(*) LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (birth_country VARCHAR) ### question:List three countries which are the origins of the least players.",SELECT birth_country FROM player GROUP BY birth_country ORDER BY COUNT(*) LIMIT 3 Find all the players' first name and last name who have empty death record.,"CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, death_year VARCHAR)","SELECT name_first, name_last FROM player WHERE death_year = ''","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, death_year VARCHAR) ### question:Find all the players' first name and last name who have empty death record.","SELECT name_first, name_last FROM player WHERE death_year = ''" "How many players born in USA are right-handed batters? That is, have the batter value 'R'.","CREATE TABLE player (birth_country VARCHAR, bats VARCHAR)",SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (birth_country VARCHAR, bats VARCHAR) ### question:How many players born in USA are right-handed batters? That is, have the batter value 'R'.",SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R' What is the average height of the players from the college named 'Yale University'?,"CREATE TABLE player_college (player_id VARCHAR, college_id VARCHAR); CREATE TABLE player (height INTEGER, player_id VARCHAR); CREATE TABLE college (college_id VARCHAR, name_full VARCHAR)",SELECT AVG(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player_college (player_id VARCHAR, college_id VARCHAR); CREATE TABLE player (height INTEGER, player_id VARCHAR); CREATE TABLE college (college_id VARCHAR, name_full VARCHAR) ### question:What is the average height of the players from the college named 'Yale University'?",SELECT AVG(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University' "What is the highest salary among each team? List the team name, id and maximum salary.","CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (name VARCHAR, team_id VARCHAR)","SELECT T1.name, T1.team_id, MAX(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (name VARCHAR, team_id VARCHAR) ### question:What is the highest salary among each team? List the team name, id and maximum salary.","SELECT T1.name, T1.team_id, MAX(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id" What are the name and id of the team offering the lowest average salary?,"CREATE TABLE team (name VARCHAR, team_id VARCHAR); CREATE TABLE salary (team_id VARCHAR, salary INTEGER)","SELECT T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE team (name VARCHAR, team_id VARCHAR); CREATE TABLE salary (team_id VARCHAR, salary INTEGER) ### question:What are the name and id of the team offering the lowest average salary?","SELECT T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary) LIMIT 1" Find the players' first name and last name who won award both in 1960 and in 1961.,"CREATE TABLE player (name_first VARCHAR, name_last VARCHAR); CREATE TABLE player_award (year VARCHAR)","SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR); CREATE TABLE player_award (year VARCHAR) ### question:Find the players' first name and last name who won award both in 1960 and in 1961.","SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961" List players' first name and last name who have weight greater than 220 or height shorter than 75.,"CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, weight VARCHAR, height VARCHAR)","SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, weight VARCHAR, height VARCHAR) ### question:List players' first name and last name who have weight greater than 220 or height shorter than 75.","SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75" List the maximum scores of the team Boston Red Stockings when the team won in postseason?,"CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (wins INTEGER, team_id_winner VARCHAR)",SELECT MAX(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (wins INTEGER, team_id_winner VARCHAR) ### question:List the maximum scores of the team Boston Red Stockings when the team won in postseason?",SELECT MAX(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' How many times did Boston Red Stockings lose in 2009 postseason?,"CREATE TABLE postseason (team_id_loser VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)",SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE postseason (team_id_loser VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR) ### question:How many times did Boston Red Stockings lose in 2009 postseason?",SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009 What are the name and id of the team with the most victories in 2008 postseason?,"CREATE TABLE postseason (team_id_winner VARCHAR, year VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR)","SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE postseason (team_id_winner VARCHAR, year VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR) ### question:What are the name and id of the team with the most victories in 2008 postseason?","SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1" What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?,"CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (year VARCHAR, team_id_winner VARCHAR)","SELECT COUNT(*), T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (year VARCHAR, team_id_winner VARCHAR) ### question:What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?","SELECT COUNT(*), T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year" What is the total number of postseason games that team Boston Red Stockings participated in?,"CREATE TABLE postseason (team_id_winner VARCHAR, team_id_loser VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)",SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE postseason (team_id_winner VARCHAR, team_id_loser VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR) ### question:What is the total number of postseason games that team Boston Red Stockings participated in?",SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings') "How many games in 1885 postseason resulted in ties (that is, the value of ""ties"" is '1')?","CREATE TABLE postseason (YEAR VARCHAR, ties VARCHAR)",SELECT COUNT(*) FROM postseason WHERE YEAR = 1885 AND ties = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE postseason (YEAR VARCHAR, ties VARCHAR) ### question:How many games in 1885 postseason resulted in ties (that is, the value of ""ties"" is '1')?",SELECT COUNT(*) FROM postseason WHERE YEAR = 1885 AND ties = 1 What is the total salary paid by team Boston Red Stockings in 2010?,"CREATE TABLE salary (salary INTEGER, team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)",SELECT SUM(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE salary (salary INTEGER, team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR) ### question:What is the total salary paid by team Boston Red Stockings in 2010?",SELECT SUM(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010 How many players were in the team Boston Red Stockings in 2000?,"CREATE TABLE salary (team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)",SELECT COUNT(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE salary (team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR) ### question:How many players were in the team Boston Red Stockings in 2000?",SELECT COUNT(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000 List the 3 highest salaries of the players in 2001?,"CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR)",SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR) ### question:List the 3 highest salaries of the players in 2001?",SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3 What were all the salary values of players in 2010 and 2001?,"CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR)",SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR) ### question:What were all the salary values of players in 2010 and 2001?",SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001 In which year did the least people enter hall of fame?,CREATE TABLE hall_of_fame (yearid VARCHAR),SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE hall_of_fame (yearid VARCHAR) ### question:In which year did the least people enter hall of fame?",SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) LIMIT 1 How many parks are there in Atlanta city?,CREATE TABLE park (city VARCHAR),SELECT COUNT(*) FROM park WHERE city = 'Atlanta',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE park (city VARCHAR) ### question:How many parks are there in Atlanta city?",SELECT COUNT(*) FROM park WHERE city = 'Atlanta' "How many games were played in park ""Columbia Park"" in 1907?","CREATE TABLE park (park_id VARCHAR, park_name VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR)",SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE park (park_id VARCHAR, park_name VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR) ### question:How many games were played in park ""Columbia Park"" in 1907?",SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park' How many games were played in city Atlanta in 2000?,"CREATE TABLE park (park_id VARCHAR, city VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR)",SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE park (park_id VARCHAR, city VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR) ### question:How many games were played in city Atlanta in 2000?",SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta' What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?,"CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (attendance INTEGER, team_id VARCHAR, year VARCHAR)",SELECT SUM(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (attendance INTEGER, team_id VARCHAR, year VARCHAR) ### question:What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?",SELECT SUM(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010 How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?,"CREATE TABLE salary (salary INTEGER, player_id VARCHAR, year VARCHAR); CREATE TABLE player (player_id VARCHAR, name_first VARCHAR, name_last VARCHAR)",SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE salary (salary INTEGER, player_id VARCHAR, year VARCHAR); CREATE TABLE player (player_id VARCHAR, name_first VARCHAR, name_last VARCHAR) ### question:How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?",SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990 List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.,"CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE salary (player_id VARCHAR, team_id VARCHAR, year VARCHAR)","SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE salary (player_id VARCHAR, team_id VARCHAR, year VARCHAR) ### question:List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.","SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'" How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?,"CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (games INTEGER, team_id VARCHAR, year VARCHAR)",SELECT SUM(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (games INTEGER, team_id VARCHAR, year VARCHAR) ### question:How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?",SELECT SUM(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000 Which team had the least number of attendances in home games in 1980?,"CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR)",SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR) ### question:Which team had the least number of attendances in home games in 1980?",SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance LIMIT 1 List the names of states that have more than 2 parks.,CREATE TABLE park (state VARCHAR),SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE park (state VARCHAR) ### question:List the names of states that have more than 2 parks.",SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2 "How many team franchises are active, with active value 'Y'?",CREATE TABLE team_franchise (active VARCHAR),SELECT COUNT(*) FROM team_franchise WHERE active = 'Y',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE team_franchise (active VARCHAR) ### question:How many team franchises are active, with active value 'Y'?",SELECT COUNT(*) FROM team_franchise WHERE active = 'Y' Which cities have 2 to 4 parks?,CREATE TABLE park (city VARCHAR),SELECT city FROM park GROUP BY city HAVING COUNT(*) BETWEEN 2 AND 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE park (city VARCHAR) ### question:Which cities have 2 to 4 parks?",SELECT city FROM park GROUP BY city HAVING COUNT(*) BETWEEN 2 AND 4 Which park had most attendances in 2008?,"CREATE TABLE park (park_name VARCHAR, park_id VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR, attendance VARCHAR)",SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE park (park_name VARCHAR, park_id VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR, attendance VARCHAR) ### question:Which park had most attendances in 2008?",SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1 How many camera lenses have a focal length longer than 15 mm?,CREATE TABLE camera_lens (focal_length_mm INTEGER),SELECT COUNT(*) FROM camera_lens WHERE focal_length_mm > 15,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE camera_lens (focal_length_mm INTEGER) ### question:How many camera lenses have a focal length longer than 15 mm?",SELECT COUNT(*) FROM camera_lens WHERE focal_length_mm > 15 "Find the brand and name for each camera lens, and sort in descending order of maximum aperture.","CREATE TABLE camera_lens (brand VARCHAR, name VARCHAR, max_aperture VARCHAR)","SELECT brand, name FROM camera_lens ORDER BY max_aperture DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE camera_lens (brand VARCHAR, name VARCHAR, max_aperture VARCHAR) ### question:Find the brand and name for each camera lens, and sort in descending order of maximum aperture.","SELECT brand, name FROM camera_lens ORDER BY max_aperture DESC" "List the id, color scheme, and name for all the photos.","CREATE TABLE photos (id VARCHAR, color VARCHAR, name VARCHAR)","SELECT id, color, name FROM photos","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE photos (id VARCHAR, color VARCHAR, name VARCHAR) ### question:List the id, color scheme, and name for all the photos.","SELECT id, color, name FROM photos" What are the maximum and average height of the mountains?,CREATE TABLE mountain (height INTEGER),"SELECT MAX(height), AVG(height) FROM mountain","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mountain (height INTEGER) ### question:What are the maximum and average height of the mountains?","SELECT MAX(height), AVG(height) FROM mountain" What are the average prominence of the mountains in country 'Morocco'?,"CREATE TABLE mountain (prominence INTEGER, country VARCHAR)",SELECT AVG(prominence) FROM mountain WHERE country = 'Morocco',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mountain (prominence INTEGER, country VARCHAR) ### question:What are the average prominence of the mountains in country 'Morocco'?",SELECT AVG(prominence) FROM mountain WHERE country = 'Morocco' "What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?","CREATE TABLE mountain (name VARCHAR, height VARCHAR, prominence VARCHAR, range VARCHAR)","SELECT name, height, prominence FROM mountain WHERE range <> 'Aberdare Range'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mountain (name VARCHAR, height VARCHAR, prominence VARCHAR, range VARCHAR) ### question:What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?","SELECT name, height, prominence FROM mountain WHERE range <> 'Aberdare Range'" What are the id and name of the photos for mountains?,"CREATE TABLE photos (mountain_id VARCHAR); CREATE TABLE mountain (id VARCHAR, name VARCHAR, height INTEGER)","SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE photos (mountain_id VARCHAR); CREATE TABLE mountain (id VARCHAR, name VARCHAR, height INTEGER) ### question:What are the id and name of the photos for mountains?","SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000" What are the id and name of the mountains that have at least 2 photos?,"CREATE TABLE mountain (id VARCHAR, name VARCHAR); CREATE TABLE photos (mountain_id VARCHAR)","SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id GROUP BY T1.id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mountain (id VARCHAR, name VARCHAR); CREATE TABLE photos (mountain_id VARCHAR) ### question:What are the id and name of the mountains that have at least 2 photos?","SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id GROUP BY T1.id HAVING COUNT(*) >= 2" What are the names of the cameras that have taken picture of the most mountains?,"CREATE TABLE camera_lens (name VARCHAR, id VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR)",SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE camera_lens (name VARCHAR, id VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR) ### question:What are the names of the cameras that have taken picture of the most mountains?",SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1 What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?,"CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR, brand VARCHAR)",SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR, brand VARCHAR) ### question:What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?",SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' How many different kinds of lens brands are there?,CREATE TABLE camera_lens (brand VARCHAR),SELECT COUNT(DISTINCT brand) FROM camera_lens,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE camera_lens (brand VARCHAR) ### question:How many different kinds of lens brands are there?",SELECT COUNT(DISTINCT brand) FROM camera_lens How many camera lenses are not used in taking any photos?,"CREATE TABLE photos (id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE camera_lens (id VARCHAR, camera_lens_id VARCHAR)",SELECT COUNT(*) FROM camera_lens WHERE NOT id IN (SELECT camera_lens_id FROM photos),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE photos (id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE camera_lens (id VARCHAR, camera_lens_id VARCHAR) ### question:How many camera lenses are not used in taking any photos?",SELECT COUNT(*) FROM camera_lens WHERE NOT id IN (SELECT camera_lens_id FROM photos) How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?,"CREATE TABLE mountain (id VARCHAR, country VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR, mountain_id VARCHAR)",SELECT COUNT(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mountain (id VARCHAR, country VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR, mountain_id VARCHAR) ### question:How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?",SELECT COUNT(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia' List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif',"CREATE TABLE mountain (id VARCHAR, range VARCHAR); CREATE TABLE photos (mountain_id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE camera_lens (brand VARCHAR, id VARCHAR)",SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Lasta Massif',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mountain (id VARCHAR, range VARCHAR); CREATE TABLE photos (mountain_id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE camera_lens (brand VARCHAR, id VARCHAR) ### question:List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif'",SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Lasta Massif' Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.,"CREATE TABLE camera_lens (id VARCHAR, brand VARCHAR); CREATE TABLE mountain (name VARCHAR, prominence VARCHAR, id VARCHAR); CREATE TABLE photos (mountain_id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE mountain (name VARCHAR, prominence VARCHAR)","SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE camera_lens (id VARCHAR, brand VARCHAR); CREATE TABLE mountain (name VARCHAR, prominence VARCHAR, id VARCHAR); CREATE TABLE photos (mountain_id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE mountain (name VARCHAR, prominence VARCHAR) ### question:Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.","SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma'" "List the camera lens names containing substring ""Digital"".",CREATE TABLE camera_lens (name VARCHAR),"SELECT name FROM camera_lens WHERE name LIKE ""%Digital%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE camera_lens (name VARCHAR) ### question:List the camera lens names containing substring ""Digital"".","SELECT name FROM camera_lens WHERE name LIKE ""%Digital%""" What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.,"CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR)","SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR) ### question:What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.","SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*)" Find the names of channels that are not owned by CCTV.,"CREATE TABLE channel (name VARCHAR, OWNER VARCHAR)",SELECT name FROM channel WHERE OWNER <> 'CCTV',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (name VARCHAR, OWNER VARCHAR) ### question:Find the names of channels that are not owned by CCTV.",SELECT name FROM channel WHERE OWNER <> 'CCTV' List all channel names ordered by their rating in percent from big to small.,"CREATE TABLE channel (name VARCHAR, rating_in_percent VARCHAR)",SELECT name FROM channel ORDER BY rating_in_percent DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (name VARCHAR, rating_in_percent VARCHAR) ### question:List all channel names ordered by their rating in percent from big to small.",SELECT name FROM channel ORDER BY rating_in_percent DESC What is the owner of the channel that has the highest rating ratio?,"CREATE TABLE channel (OWNER VARCHAR, rating_in_percent VARCHAR)",SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (OWNER VARCHAR, rating_in_percent VARCHAR) ### question:What is the owner of the channel that has the highest rating ratio?",SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1 how many programs are there?,CREATE TABLE program (Id VARCHAR),SELECT COUNT(*) FROM program,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE program (Id VARCHAR) ### question:how many programs are there?",SELECT COUNT(*) FROM program "list all the names of programs, ordering by launch time.","CREATE TABLE program (name VARCHAR, launch VARCHAR)",SELECT name FROM program ORDER BY launch,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE program (name VARCHAR, launch VARCHAR) ### question:list all the names of programs, ordering by launch time.",SELECT name FROM program ORDER BY launch "List the name, origin and owner of each program.","CREATE TABLE program (name VARCHAR, origin VARCHAR, OWNER VARCHAR)","SELECT name, origin, OWNER FROM program","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE program (name VARCHAR, origin VARCHAR, OWNER VARCHAR) ### question:List the name, origin and owner of each program.","SELECT name, origin, OWNER FROM program" find the name of the program that was launched most recently.,"CREATE TABLE program (name VARCHAR, launch VARCHAR)",SELECT name FROM program ORDER BY launch DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE program (name VARCHAR, launch VARCHAR) ### question:find the name of the program that was launched most recently.",SELECT name FROM program ORDER BY launch DESC LIMIT 1 find the total percentage share of all channels owned by CCTV.,"CREATE TABLE channel (Share_in_percent INTEGER, OWNER VARCHAR)",SELECT SUM(Share_in_percent) FROM channel WHERE OWNER = 'CCTV',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (Share_in_percent INTEGER, OWNER VARCHAR) ### question:find the total percentage share of all channels owned by CCTV.",SELECT SUM(Share_in_percent) FROM channel WHERE OWNER = 'CCTV' Find the names of the channels that are broadcast in the morning.,"CREATE TABLE channel (name VARCHAR, channel_id VARCHAR); CREATE TABLE broadcast (channel_id VARCHAR, time_of_day VARCHAR)",SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (name VARCHAR, channel_id VARCHAR); CREATE TABLE broadcast (channel_id VARCHAR, time_of_day VARCHAR) ### question:Find the names of the channels that are broadcast in the morning.",SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' what are the names of the channels that broadcast in both morning and night?,"CREATE TABLE channel (name VARCHAR, channel_id VARCHAR); CREATE TABLE broadcast (channel_id VARCHAR, time_of_day VARCHAR)",SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (name VARCHAR, channel_id VARCHAR); CREATE TABLE broadcast (channel_id VARCHAR, time_of_day VARCHAR) ### question:what are the names of the channels that broadcast in both morning and night?",SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night' how many programs are broadcast in each time section of the day?,CREATE TABLE broadcast (time_of_day VARCHAR),"SELECT COUNT(*), time_of_day FROM broadcast GROUP BY time_of_day","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE broadcast (time_of_day VARCHAR) ### question:how many programs are broadcast in each time section of the day?","SELECT COUNT(*), time_of_day FROM broadcast GROUP BY time_of_day" find the number of different programs that are broadcast during night time.,"CREATE TABLE broadcast (program_id VARCHAR, time_of_day VARCHAR)",SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE broadcast (program_id VARCHAR, time_of_day VARCHAR) ### question:find the number of different programs that are broadcast during night time.",SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night' Find the names of programs that are never broadcasted in the morning.,"CREATE TABLE broadcast (program_id VARCHAR, Time_of_day VARCHAR); CREATE TABLE program (name VARCHAR, program_id VARCHAR); CREATE TABLE program (name VARCHAR)","SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Morning""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE broadcast (program_id VARCHAR, Time_of_day VARCHAR); CREATE TABLE program (name VARCHAR, program_id VARCHAR); CREATE TABLE program (name VARCHAR) ### question:Find the names of programs that are never broadcasted in the morning.","SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Morning""" find the program owners that have some programs in both morning and night time.,"CREATE TABLE broadcast (program_id VARCHAR, Time_of_day VARCHAR); CREATE TABLE program (owner VARCHAR, program_id VARCHAR)","SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Morning"" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Night""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE broadcast (program_id VARCHAR, Time_of_day VARCHAR); CREATE TABLE program (owner VARCHAR, program_id VARCHAR) ### question:find the program owners that have some programs in both morning and night time.","SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Morning"" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Night""" List all program origins in the alphabetical order.,CREATE TABLE program (origin VARCHAR),SELECT origin FROM program ORDER BY origin,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE program (origin VARCHAR) ### question:List all program origins in the alphabetical order.",SELECT origin FROM program ORDER BY origin what is the number of different channel owners?,CREATE TABLE channel (OWNER VARCHAR),SELECT COUNT(DISTINCT OWNER) FROM channel,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (OWNER VARCHAR) ### question:what is the number of different channel owners?",SELECT COUNT(DISTINCT OWNER) FROM channel find the names of programs whose origin is not in Beijing.,"CREATE TABLE program (name VARCHAR, origin VARCHAR)",SELECT name FROM program WHERE origin <> 'Beijing',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE program (name VARCHAR, origin VARCHAR) ### question:find the names of programs whose origin is not in Beijing.",SELECT name FROM program WHERE origin <> 'Beijing' What are the names of the channels owned by CCTV or HBS?,"CREATE TABLE channel (name VARCHAR, OWNER VARCHAR)",SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (name VARCHAR, OWNER VARCHAR) ### question:What are the names of the channels owned by CCTV or HBS?",SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS' Find the total rating ratio for each channel owner.,"CREATE TABLE channel (OWNER VARCHAR, Rating_in_percent INTEGER)","SELECT SUM(Rating_in_percent), OWNER FROM channel GROUP BY OWNER","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE channel (OWNER VARCHAR, Rating_in_percent INTEGER) ### question:Find the total rating ratio for each channel owner.","SELECT SUM(Rating_in_percent), OWNER FROM channel GROUP BY OWNER" Find the name of the program that is broadcast most frequently.,"CREATE TABLE program (name VARCHAR, program_id VARCHAR); CREATE TABLE broadcast (program_id VARCHAR)",SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE program (name VARCHAR, program_id VARCHAR); CREATE TABLE broadcast (program_id VARCHAR) ### question:Find the name of the program that is broadcast most frequently.",SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1 How many courses are there in total?,CREATE TABLE COURSES (Id VARCHAR),SELECT COUNT(*) FROM COURSES,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSES (Id VARCHAR) ### question:How many courses are there in total?",SELECT COUNT(*) FROM COURSES "What are the descriptions of the courses with name ""database""?","CREATE TABLE COURSES (course_description VARCHAR, course_name VARCHAR)","SELECT course_description FROM COURSES WHERE course_name = ""database""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSES (course_description VARCHAR, course_name VARCHAR) ### question:What are the descriptions of the courses with name ""database""?","SELECT course_description FROM COURSES WHERE course_name = ""database""" "What are the addresses of the course authors or tutors with personal name ""Cathrine""","CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR, personal_name VARCHAR)","SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name = ""Cathrine""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR, personal_name VARCHAR) ### question:What are the addresses of the course authors or tutors with personal name ""Cathrine""","SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name = ""Cathrine""" List the addresses of all the course authors or tutors.,CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR),SELECT address_line_1 FROM Course_Authors_and_Tutors,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR) ### question:List the addresses of all the course authors or tutors.",SELECT address_line_1 FROM Course_Authors_and_Tutors List all the login names and family names of course author and tutors.,"CREATE TABLE Course_Authors_and_Tutors (login_name VARCHAR, family_name VARCHAR)","SELECT login_name, family_name FROM Course_Authors_and_Tutors","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Course_Authors_and_Tutors (login_name VARCHAR, family_name VARCHAR) ### question:List all the login names and family names of course author and tutors.","SELECT login_name, family_name FROM Course_Authors_and_Tutors" List all the dates of enrollment and completion of students.,"CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR)","SELECT date_of_enrolment, date_of_completion FROM Student_Course_Enrolment","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR) ### question:List all the dates of enrollment and completion of students.","SELECT date_of_enrolment, date_of_completion FROM Student_Course_Enrolment" How many distinct students are enrolled in courses?,CREATE TABLE Student_Course_Enrolment (student_id VARCHAR),SELECT COUNT(DISTINCT student_id) FROM Student_Course_Enrolment,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (student_id VARCHAR) ### question:How many distinct students are enrolled in courses?",SELECT COUNT(DISTINCT student_id) FROM Student_Course_Enrolment How many distinct courses are enrolled in by students?,CREATE TABLE Student_Course_Enrolment (course_id VARCHAR),SELECT COUNT(course_id) FROM Student_Course_Enrolment,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (course_id VARCHAR) ### question:How many distinct courses are enrolled in by students?",SELECT COUNT(course_id) FROM Student_Course_Enrolment "Find the dates of the tests taken with result ""Pass"".","CREATE TABLE Student_Tests_Taken (date_test_taken VARCHAR, test_result VARCHAR)","SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = ""Pass""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Tests_Taken (date_test_taken VARCHAR, test_result VARCHAR) ### question:Find the dates of the tests taken with result ""Pass"".","SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = ""Pass""" "How many tests have result ""Fail""?",CREATE TABLE Student_Tests_Taken (test_result VARCHAR),"SELECT COUNT(*) FROM Student_Tests_Taken WHERE test_result = ""Fail""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Tests_Taken (test_result VARCHAR) ### question:How many tests have result ""Fail""?","SELECT COUNT(*) FROM Student_Tests_Taken WHERE test_result = ""Fail""" "What are the login names of the students with family name ""Ward""?","CREATE TABLE Students (login_name VARCHAR, family_name VARCHAR)","SELECT login_name FROM Students WHERE family_name = ""Ward""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (login_name VARCHAR, family_name VARCHAR) ### question:What are the login names of the students with family name ""Ward""?","SELECT login_name FROM Students WHERE family_name = ""Ward""" "What are the dates of the latest logon of the students with family name ""Jaskolski"" or ""Langosh""?","CREATE TABLE Students (date_of_latest_logon VARCHAR, family_name VARCHAR)","SELECT date_of_latest_logon FROM Students WHERE family_name = ""Jaskolski"" OR family_name = ""Langosh""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (date_of_latest_logon VARCHAR, family_name VARCHAR) ### question:What are the dates of the latest logon of the students with family name ""Jaskolski"" or ""Langosh""?","SELECT date_of_latest_logon FROM Students WHERE family_name = ""Jaskolski"" OR family_name = ""Langosh""" "How many students have personal names that contain the word ""son""?",CREATE TABLE Students (personal_name VARCHAR),"SELECT COUNT(*) FROM Students WHERE personal_name LIKE ""%son%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (personal_name VARCHAR) ### question:How many students have personal names that contain the word ""son""?","SELECT COUNT(*) FROM Students WHERE personal_name LIKE ""%son%""" List all the subject names.,CREATE TABLE SUBJECTS (subject_name VARCHAR),SELECT subject_name FROM SUBJECTS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE SUBJECTS (subject_name VARCHAR) ### question:List all the subject names.",SELECT subject_name FROM SUBJECTS List all the information about course authors and tutors in alphabetical order of the personal name.,CREATE TABLE Course_Authors_and_Tutors (personal_name VARCHAR),SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Course_Authors_and_Tutors (personal_name VARCHAR) ### question:List all the information about course authors and tutors in alphabetical order of the personal name.",SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name List the personal names and family names of all the students in alphabetical order of family name.,"CREATE TABLE Students (personal_name VARCHAR, family_name VARCHAR)","SELECT personal_name, family_name FROM Students ORDER BY family_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (personal_name VARCHAR, family_name VARCHAR) ### question:List the personal names and family names of all the students in alphabetical order of family name.","SELECT personal_name, family_name FROM Students ORDER BY family_name" List each test result and its count in descending order of count.,CREATE TABLE Student_Tests_Taken (test_result VARCHAR),"SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Tests_Taken (test_result VARCHAR) ### question:List each test result and its count in descending order of count.","SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC" "Find the login name of the course author that teaches the course with name ""advanced database"".","CREATE TABLE Courses (author_id VARCHAR, course_name VARCHAR); CREATE TABLE Course_Authors_and_Tutors (login_name VARCHAR, author_id VARCHAR)","SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = ""advanced database""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (author_id VARCHAR, course_name VARCHAR); CREATE TABLE Course_Authors_and_Tutors (login_name VARCHAR, author_id VARCHAR) ### question:Find the login name of the course author that teaches the course with name ""advanced database"".","SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = ""advanced database""" "Find the addresses of the course authors who teach the course with name ""operating system"" or ""data structure"".","CREATE TABLE Courses (author_id VARCHAR, course_name VARCHAR); CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR, author_id VARCHAR)","SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = ""operating system"" OR T2.course_name = ""data structure""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (author_id VARCHAR, course_name VARCHAR); CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR, author_id VARCHAR) ### question:Find the addresses of the course authors who teach the course with name ""operating system"" or ""data structure"".","SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = ""operating system"" OR T2.course_name = ""data structure""" "Find the personal name, family name, and author ID of the course author that teaches the most courses.","CREATE TABLE Courses (author_id VARCHAR); CREATE TABLE Course_Authors_and_Tutors (personal_name VARCHAR, family_name VARCHAR, author_id VARCHAR)","SELECT T1.personal_name, T1.family_name, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (author_id VARCHAR); CREATE TABLE Course_Authors_and_Tutors (personal_name VARCHAR, family_name VARCHAR, author_id VARCHAR) ### question:Find the personal name, family name, and author ID of the course author that teaches the most courses.","SELECT T1.personal_name, T1.family_name, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1" Find the addresses and author IDs of the course authors that teach at least two courses.,"CREATE TABLE Courses (author_id VARCHAR); CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR, author_id VARCHAR)","SELECT T1.address_line_1, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (author_id VARCHAR); CREATE TABLE Course_Authors_and_Tutors (address_line_1 VARCHAR, author_id VARCHAR) ### question:Find the addresses and author IDs of the course authors that teach at least two courses.","SELECT T1.address_line_1, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2" "Find the names of courses taught by the tutor who has personal name ""Julio"".","CREATE TABLE Course_Authors_and_Tutors (author_id VARCHAR, personal_name VARCHAR); CREATE TABLE Courses (course_name VARCHAR, author_id VARCHAR)","SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = ""Julio""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Course_Authors_and_Tutors (author_id VARCHAR, personal_name VARCHAR); CREATE TABLE Courses (course_name VARCHAR, author_id VARCHAR) ### question:Find the names of courses taught by the tutor who has personal name ""Julio"".","SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = ""Julio""" "Find the names and descriptions of courses that belong to the subject named ""Computer Science"".","CREATE TABLE Courses (course_name VARCHAR, course_description VARCHAR, subject_id VARCHAR); CREATE TABLE Subjects (subject_id VARCHAR, subject_name VARCHAR)","SELECT T1.course_name, T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = ""Computer Science""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (course_name VARCHAR, course_description VARCHAR, subject_id VARCHAR); CREATE TABLE Subjects (subject_id VARCHAR, subject_name VARCHAR) ### question:Find the names and descriptions of courses that belong to the subject named ""Computer Science"".","SELECT T1.course_name, T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = ""Computer Science""" "Find the subject ID, subject name, and the corresponding number of available courses for each subject.","CREATE TABLE Courses (subject_id VARCHAR); CREATE TABLE Subjects (subject_name VARCHAR, subject_id VARCHAR)","SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (subject_id VARCHAR); CREATE TABLE Subjects (subject_name VARCHAR, subject_id VARCHAR) ### question:Find the subject ID, subject name, and the corresponding number of available courses for each subject.","SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id" "Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order.","CREATE TABLE Courses (subject_id VARCHAR); CREATE TABLE Subjects (subject_name VARCHAR, subject_id VARCHAR)","SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (subject_id VARCHAR); CREATE TABLE Subjects (subject_name VARCHAR, subject_id VARCHAR) ### question:Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order.","SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*)" "What is the date of enrollment of the course named ""Spanish""?","CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, course_id VARCHAR); CREATE TABLE Courses (course_id VARCHAR, course_name VARCHAR)","SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = ""Spanish""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, course_id VARCHAR); CREATE TABLE Courses (course_id VARCHAR, course_name VARCHAR) ### question:What is the date of enrollment of the course named ""Spanish""?","SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = ""Spanish""" What is the name of the course that has the most student enrollment?,"CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR)",SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR) ### question:What is the name of the course that has the most student enrollment?",SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 What are the names of the courses that have exactly 1 student enrollment?,"CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR)",SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR) ### question:What are the names of the courses that have exactly 1 student enrollment?",SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1 What are the descriptions and names of the courses that have student enrollment bigger than 2?,"CREATE TABLE Student_Course_Enrolment (course_id VARCHAR); CREATE TABLE Courses (course_description VARCHAR, course_name VARCHAR, course_id VARCHAR)","SELECT T1.course_description, T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (course_id VARCHAR); CREATE TABLE Courses (course_description VARCHAR, course_name VARCHAR, course_id VARCHAR) ### question:What are the descriptions and names of the courses that have student enrollment bigger than 2?","SELECT T1.course_description, T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2" What is the name of each course and the corresponding number of student enrollment?,"CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR)","SELECT T1.course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR) ### question:What is the name of each course and the corresponding number of student enrollment?","SELECT T1.course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name" "What are the enrollment dates of all the tests that have result ""Pass""?","CREATE TABLE Student_Tests_Taken (registration_id VARCHAR, test_result VARCHAR); CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, registration_id VARCHAR)","SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = ""Pass""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Tests_Taken (registration_id VARCHAR, test_result VARCHAR); CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, registration_id VARCHAR) ### question:What are the enrollment dates of all the tests that have result ""Pass""?","SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = ""Pass""" "What are the completion dates of all the tests that have result ""Fail""?","CREATE TABLE Student_Tests_Taken (registration_id VARCHAR, test_result VARCHAR); CREATE TABLE Student_Course_Enrolment (date_of_completion VARCHAR, registration_id VARCHAR)","SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = ""Fail""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Tests_Taken (registration_id VARCHAR, test_result VARCHAR); CREATE TABLE Student_Course_Enrolment (date_of_completion VARCHAR, registration_id VARCHAR) ### question:What are the completion dates of all the tests that have result ""Fail""?","SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = ""Fail""" "List the dates of enrollment and completion of the student with personal name ""Karson"".","CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, personal_name VARCHAR)","SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = ""Karson""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, personal_name VARCHAR) ### question:List the dates of enrollment and completion of the student with personal name ""Karson"".","SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = ""Karson""" "List the dates of enrollment and completion of the student with family name ""Zieme"" and personal name ""Bernie"".","CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, family_name VARCHAR, personal_name VARCHAR)","SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = ""Zieme"" AND T2.personal_name = ""Bernie""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, family_name VARCHAR, personal_name VARCHAR) ### question:List the dates of enrollment and completion of the student with family name ""Zieme"" and personal name ""Bernie"".","SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = ""Zieme"" AND T2.personal_name = ""Bernie""" Find the student ID and login name of the student with the most course enrollments,"CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (login_name VARCHAR, student_id VARCHAR)","SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (login_name VARCHAR, student_id VARCHAR) ### question:Find the student ID and login name of the student with the most course enrollments","SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1" Find the student ID and personal name of the student with at least two enrollments.,"CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (personal_name VARCHAR, student_id VARCHAR)","SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (personal_name VARCHAR, student_id VARCHAR) ### question:Find the student ID and personal name of the student with at least two enrollments.","SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2" Find the student ID and middle name for all the students with at most two enrollments.,"CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (middle_name VARCHAR, student_id VARCHAR)","SELECT T1.student_id, T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (middle_name VARCHAR, student_id VARCHAR) ### question:Find the student ID and middle name for all the students with at most two enrollments.","SELECT T1.student_id, T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2" Find the personal names of students not enrolled in any course.,"CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (personal_name VARCHAR); CREATE TABLE Students (personal_name VARCHAR, student_id VARCHAR)",SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (personal_name VARCHAR); CREATE TABLE Students (personal_name VARCHAR, student_id VARCHAR) ### question:Find the personal names of students not enrolled in any course.",SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id How many students did not have any course enrollment?,CREATE TABLE Students (student_id VARCHAR); CREATE TABLE Student_Course_Enrolment (student_id VARCHAR),SELECT COUNT(*) FROM Students WHERE NOT student_id IN (SELECT student_id FROM Student_Course_Enrolment),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Students (student_id VARCHAR); CREATE TABLE Student_Course_Enrolment (student_id VARCHAR) ### question:How many students did not have any course enrollment?",SELECT COUNT(*) FROM Students WHERE NOT student_id IN (SELECT student_id FROM Student_Course_Enrolment) Find the common login name of course authors and students.,CREATE TABLE Course_Authors_and_Tutors (login_name VARCHAR); CREATE TABLE Students (login_name VARCHAR),SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Course_Authors_and_Tutors (login_name VARCHAR); CREATE TABLE Students (login_name VARCHAR) ### question:Find the common login name of course authors and students.",SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students Find the common personal name of course authors and students.,CREATE TABLE Course_Authors_and_Tutors (personal_name VARCHAR); CREATE TABLE Students (personal_name VARCHAR),SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Course_Authors_and_Tutors (personal_name VARCHAR); CREATE TABLE Students (personal_name VARCHAR) ### question:Find the common personal name of course authors and students.",SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id.,"CREATE TABLE Settlements (Claim_id VARCHAR); CREATE TABLE Claims (Amount_Claimed INTEGER); CREATE TABLE Claims (Date_Claim_Made VARCHAR, Claim_id VARCHAR, Amount_Claimed INTEGER)","SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING COUNT(*) > 2 UNION SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = (SELECT MAX(Amount_Claimed) FROM Claims)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Settlements (Claim_id VARCHAR); CREATE TABLE Claims (Amount_Claimed INTEGER); CREATE TABLE Claims (Date_Claim_Made VARCHAR, Claim_id VARCHAR, Amount_Claimed INTEGER) ### question:Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id.","SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING COUNT(*) > 2 UNION SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = (SELECT MAX(Amount_Claimed) FROM Claims)" Which customer had at least 2 policies but did not file any claims? List the customer details and id.,"CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR, Customer_id VARCHAR); CREATE TABLE Customer_Policies (customer_id VARCHAR, policy_id VARCHAR); CREATE TABLE Claims (policy_id VARCHAR)","SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR, Customer_id VARCHAR); CREATE TABLE Customer_Policies (customer_id VARCHAR, policy_id VARCHAR); CREATE TABLE Claims (policy_id VARCHAR) ### question:Which customer had at least 2 policies but did not file any claims? List the customer details and id.","SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id" "List the method, date and amount of all the payments, in ascending order of date.","CREATE TABLE Payments (Payment_Method_Code VARCHAR, Date_Payment_Made VARCHAR, Amount_Payment VARCHAR)","SELECT Payment_Method_Code, Date_Payment_Made, Amount_Payment FROM Payments ORDER BY Date_Payment_Made","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Payments (Payment_Method_Code VARCHAR, Date_Payment_Made VARCHAR, Amount_Payment VARCHAR) ### question:List the method, date and amount of all the payments, in ascending order of date.","SELECT Payment_Method_Code, Date_Payment_Made, Amount_Payment FROM Payments ORDER BY Date_Payment_Made" "Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.","CREATE TABLE Claims (Amount_Settled VARCHAR, Amount_Claimed VARCHAR)","SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (Amount_Settled VARCHAR, Amount_Claimed VARCHAR) ### question:Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.","SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1" "Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount.","CREATE TABLE Claims (Amount_Settled VARCHAR, Amount_Claimed VARCHAR)","SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Settled LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (Amount_Settled VARCHAR, Amount_Claimed VARCHAR) ### question:Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount.","SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Settled LIMIT 1" "Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.","CREATE TABLE Claims (Date_Claim_Made VARCHAR, Date_Claim_Settled VARCHAR, Amount_Claimed INTEGER)","SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (Date_Claim_Made VARCHAR, Date_Claim_Settled VARCHAR, Amount_Claimed INTEGER) ### question:Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.","SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims)" "Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.","CREATE TABLE Claims (Date_Claim_Made VARCHAR, Amount_Settled INTEGER)",SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (Date_Claim_Made VARCHAR, Amount_Settled INTEGER) ### question:Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.",SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) How many settlements does each claim correspond to? List the claim id and the number of settlements.,"CREATE TABLE Settlements (claim_id VARCHAR); CREATE TABLE Claims (Claim_id VARCHAR, claim_id VARCHAR)","SELECT T1.Claim_id, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Settlements (claim_id VARCHAR); CREATE TABLE Claims (Claim_id VARCHAR, claim_id VARCHAR) ### question:How many settlements does each claim correspond to? List the claim id and the number of settlements.","SELECT T1.Claim_id, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id" "Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number.","CREATE TABLE Claims (claim_id VARCHAR, date_claim_made VARCHAR); CREATE TABLE Settlements (claim_id VARCHAR)","SELECT T1.claim_id, T1.date_claim_made, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (claim_id VARCHAR, date_claim_made VARCHAR); CREATE TABLE Settlements (claim_id VARCHAR) ### question:Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number.","SELECT T1.claim_id, T1.date_claim_made, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY COUNT(*) DESC LIMIT 1" How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.,"CREATE TABLE Settlements (claim_id VARCHAR); CREATE TABLE Claims (claim_id VARCHAR, Date_Claim_Settled VARCHAR)","SELECT COUNT(*), T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Settlements (claim_id VARCHAR); CREATE TABLE Claims (claim_id VARCHAR, Date_Claim_Settled VARCHAR) ### question:How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.","SELECT COUNT(*), T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1" "Of all the claims, what was the earliest date when any claim was made?",CREATE TABLE Claims (Date_Claim_Made VARCHAR),SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (Date_Claim_Made VARCHAR) ### question:Of all the claims, what was the earliest date when any claim was made?",SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made LIMIT 1 What is the total amount of settlement made for all the settlements?,CREATE TABLE Settlements (Amount_Settled INTEGER),SELECT SUM(Amount_Settled) FROM Settlements,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Settlements (Amount_Settled INTEGER) ### question:What is the total amount of settlement made for all the settlements?",SELECT SUM(Amount_Settled) FROM Settlements Who are the customers that had more than 1 policy? List the customer details and id.,"CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR, Customer_id VARCHAR); CREATE TABLE Customer_Policies (Customer_id VARCHAR)","SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR, Customer_id VARCHAR); CREATE TABLE Customer_Policies (Customer_id VARCHAR) ### question:Who are the customers that had more than 1 policy? List the customer details and id.","SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 1" What are the claim dates and settlement dates of all the settlements?,"CREATE TABLE Settlements (Date_Claim_Made VARCHAR, Date_Claim_Settled VARCHAR)","SELECT Date_Claim_Made, Date_Claim_Settled FROM Settlements","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Settlements (Date_Claim_Made VARCHAR, Date_Claim_Settled VARCHAR) ### question:What are the claim dates and settlement dates of all the settlements?","SELECT Date_Claim_Made, Date_Claim_Settled FROM Settlements" What is the most popular payment method?,CREATE TABLE Payments (Payment_Method_Code VARCHAR),SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Payments (Payment_Method_Code VARCHAR) ### question:What is the most popular payment method?",SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) DESC LIMIT 1 With which kind of payment method were the least number of payments processed?,CREATE TABLE Payments (Payment_Method_Code VARCHAR),SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Payments (Payment_Method_Code VARCHAR) ### question:With which kind of payment method were the least number of payments processed?",SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) LIMIT 1 What is the total amount of payment?,CREATE TABLE Payments (Amount_Payment INTEGER),SELECT SUM(Amount_Payment) FROM Payments,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Payments (Amount_Payment INTEGER) ### question:What is the total amount of payment?",SELECT SUM(Amount_Payment) FROM Payments What are all the distinct details of the customers?,CREATE TABLE Customers (customer_details VARCHAR),SELECT DISTINCT customer_details FROM Customers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_details VARCHAR) ### question:What are all the distinct details of the customers?",SELECT DISTINCT customer_details FROM Customers Which kind of policy type was chosen by the most customers?,CREATE TABLE Customer_Policies (Policy_Type_Code VARCHAR),SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customer_Policies (Policy_Type_Code VARCHAR) ### question:Which kind of policy type was chosen by the most customers?",SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 How many settlements are there in total?,CREATE TABLE Settlements (Id VARCHAR),SELECT COUNT(*) FROM Settlements,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Settlements (Id VARCHAR) ### question:How many settlements are there in total?",SELECT COUNT(*) FROM Settlements "Which Payments were processed with Visa? List the payment Id, the date and the amount.","CREATE TABLE Payments (Payment_ID VARCHAR, Date_Payment_Made VARCHAR, Amount_Payment VARCHAR, Payment_Method_Code VARCHAR)","SELECT Payment_ID, Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Payments (Payment_ID VARCHAR, Date_Payment_Made VARCHAR, Amount_Payment VARCHAR, Payment_Method_Code VARCHAR) ### question:Which Payments were processed with Visa? List the payment Id, the date and the amount.","SELECT Payment_ID, Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'" List the details of the customers who do not have any policies.,"CREATE TABLE Customer_Policies (customer_id VARCHAR); CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR); CREATE TABLE Customers (customer_details VARCHAR)",SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customer_Policies (customer_id VARCHAR); CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR); CREATE TABLE Customers (customer_details VARCHAR) ### question:List the details of the customers who do not have any policies.",SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id "List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.","CREATE TABLE Claims (claim_id VARCHAR, date_claim_made VARCHAR, Date_Claim_Settled VARCHAR, Claim_id VARCHAR); CREATE TABLE Settlements (Claim_id VARCHAR)","SELECT T1.claim_id, T1.date_claim_made, T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING COUNT(*) = 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (claim_id VARCHAR, date_claim_made VARCHAR, Date_Claim_Settled VARCHAR, Claim_id VARCHAR); CREATE TABLE Settlements (Claim_id VARCHAR) ### question:List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.","SELECT T1.claim_id, T1.date_claim_made, T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING COUNT(*) = 1" Find the total claimed amount of all the claims.,CREATE TABLE Claims (Amount_Claimed INTEGER),SELECT SUM(Amount_Claimed) FROM Claims,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Claims (Amount_Claimed INTEGER) ### question:Find the total claimed amount of all the claims.",SELECT SUM(Amount_Claimed) FROM Claims Which department has the largest number of employees?,"CREATE TABLE department (name VARCHAR, departmentID VARCHAR)",SELECT name FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (name VARCHAR, departmentID VARCHAR) ### question:Which department has the largest number of employees?",SELECT name FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) DESC LIMIT 1 What is the employee id of the head whose department has the least number of employees?,"CREATE TABLE department (head VARCHAR, departmentID VARCHAR)",SELECT head FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (head VARCHAR, departmentID VARCHAR) ### question:What is the employee id of the head whose department has the least number of employees?",SELECT head FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) LIMIT 1 what is the name and position of the head whose department has least number of employees?,"CREATE TABLE department (head VARCHAR); CREATE TABLE physician (name VARCHAR, position VARCHAR, EmployeeID VARCHAR)","SELECT T2.name, T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY COUNT(departmentID) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (head VARCHAR); CREATE TABLE physician (name VARCHAR, position VARCHAR, EmployeeID VARCHAR) ### question:what is the name and position of the head whose department has least number of employees?","SELECT T2.name, T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY COUNT(departmentID) LIMIT 1" What are names of patients who made an appointment?,CREATE TABLE appointment (patient VARCHAR); CREATE TABLE patient (ssn VARCHAR),SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE appointment (patient VARCHAR); CREATE TABLE patient (ssn VARCHAR) ### question:What are names of patients who made an appointment?",SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn what are name and phone number of patients who had more than one appointment?,CREATE TABLE appointment (patient VARCHAR); CREATE TABLE patient (ssn VARCHAR),"SELECT name, phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE appointment (patient VARCHAR); CREATE TABLE patient (ssn VARCHAR) ### question:what are name and phone number of patients who had more than one appointment?","SELECT name, phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1" Find the id of the appointment with the most recent start date?,"CREATE TABLE appointment (appointmentid VARCHAR, START VARCHAR)",SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE appointment (appointmentid VARCHAR, START VARCHAR) ### question:Find the id of the appointment with the most recent start date?",SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1 List the name of physicians who took some appointment.,"CREATE TABLE appointment (Physician VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR)",SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE appointment (Physician VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) ### question:List the name of physicians who took some appointment.",SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID List the name of physicians who never took any appointment.,"CREATE TABLE physician (name VARCHAR); CREATE TABLE appointment (Physician VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR)",SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE physician (name VARCHAR); CREATE TABLE appointment (Physician VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) ### question:List the name of physicians who never took any appointment.",SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID Find the names of all physicians and their primary affiliated departments' names.,"CREATE TABLE department (name VARCHAR, DepartmentID VARCHAR); CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, PrimaryAffiliation VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR)","SELECT T1.name, T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department (name VARCHAR, DepartmentID VARCHAR); CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, PrimaryAffiliation VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) ### question:Find the names of all physicians and their primary affiliated departments' names.","SELECT T1.name, T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1" What is the name of the patient who made the most recent appointment?,"CREATE TABLE patient (name VARCHAR, ssn VARCHAR); CREATE TABLE appointment (patient VARCHAR, start VARCHAR)",SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE patient (name VARCHAR, ssn VARCHAR); CREATE TABLE appointment (patient VARCHAR, start VARCHAR) ### question:What is the name of the patient who made the most recent appointment?",SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1 How many patients stay in room 112?,"CREATE TABLE stay (patient VARCHAR, room VARCHAR)",SELECT COUNT(patient) FROM stay WHERE room = 112,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stay (patient VARCHAR, room VARCHAR) ### question:How many patients stay in room 112?",SELECT COUNT(patient) FROM stay WHERE room = 112 How many patients' prescriptions are made by physician John Dorian?,"CREATE TABLE patient (SSN VARCHAR); CREATE TABLE prescribes (patient VARCHAR, physician VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR)","SELECT COUNT(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = ""John Dorian""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE patient (SSN VARCHAR); CREATE TABLE prescribes (patient VARCHAR, physician VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR) ### question:How many patients' prescriptions are made by physician John Dorian?","SELECT COUNT(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = ""John Dorian""" Find the name of medication used on the patient who stays in room 111?,"CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR); CREATE TABLE Medication (name VARCHAR, Code VARCHAR); CREATE TABLE patient (SSN VARCHAR); CREATE TABLE stay (Patient VARCHAR)",SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR); CREATE TABLE Medication (name VARCHAR, Code VARCHAR); CREATE TABLE patient (SSN VARCHAR); CREATE TABLE stay (Patient VARCHAR) ### question:Find the name of medication used on the patient who stays in room 111?",SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111 Find the patient who most recently stayed in room 111.,"CREATE TABLE stay (patient VARCHAR, room VARCHAR, staystart VARCHAR)",SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stay (patient VARCHAR, room VARCHAR, staystart VARCHAR) ### question:Find the patient who most recently stayed in room 111.",SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1 What is the name of the nurse has the most appointments?,"CREATE TABLE nurse (name VARCHAR, employeeid VARCHAR); CREATE TABLE appointment (prepnurse VARCHAR)",SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE nurse (name VARCHAR, employeeid VARCHAR); CREATE TABLE appointment (prepnurse VARCHAR) ### question:What is the name of the nurse has the most appointments?",SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1 How many patients do each physician take care of? List their names and number of patients they take care of.,"CREATE TABLE patient (PCP VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR)","SELECT T1.name, COUNT(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE patient (PCP VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR) ### question:How many patients do each physician take care of? List their names and number of patients they take care of.","SELECT T1.name, COUNT(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid" Find the name of physicians who are in charge of more than one patient.,"CREATE TABLE patient (PCP VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR)",SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE patient (PCP VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR) ### question:Find the name of physicians who are in charge of more than one patient.",SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING COUNT(*) > 1 Find the number of rooms located on each block floor.,"CREATE TABLE room (blockfloor VARCHAR, blockcode VARCHAR); CREATE TABLE BLOCK (blockfloor VARCHAR, blockcode VARCHAR)","SELECT COUNT(*), T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE room (blockfloor VARCHAR, blockcode VARCHAR); CREATE TABLE BLOCK (blockfloor VARCHAR, blockcode VARCHAR) ### question:Find the number of rooms located on each block floor.","SELECT COUNT(*), T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor" Find the number of rooms for different block code?,"CREATE TABLE room (blockfloor VARCHAR, blockcode VARCHAR); CREATE TABLE BLOCK (blockcode VARCHAR, blockfloor VARCHAR)","SELECT COUNT(*), T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE room (blockfloor VARCHAR, blockcode VARCHAR); CREATE TABLE BLOCK (blockcode VARCHAR, blockfloor VARCHAR) ### question:Find the number of rooms for different block code?","SELECT COUNT(*), T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode" What are the unique block codes that have available rooms?,"CREATE TABLE room (blockcode VARCHAR, unavailable VARCHAR)",SELECT DISTINCT blockcode FROM room WHERE unavailable = 0,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE room (blockcode VARCHAR, unavailable VARCHAR) ### question:What are the unique block codes that have available rooms?",SELECT DISTINCT blockcode FROM room WHERE unavailable = 0 How many different types of rooms are there?,CREATE TABLE room (roomtype VARCHAR),SELECT COUNT(DISTINCT roomtype) FROM room,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE room (roomtype VARCHAR) ### question:How many different types of rooms are there?",SELECT COUNT(DISTINCT roomtype) FROM room What is the names of the physicians who prescribe medication Thesisin?,"CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR); CREATE TABLE medication (code VARCHAR, name VARCHAR)","SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = ""Thesisin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR); CREATE TABLE medication (code VARCHAR, name VARCHAR) ### question:What is the names of the physicians who prescribe medication Thesisin?","SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = ""Thesisin""" Find the name and position of physicians who prescribe some medication whose brand is X?,"CREATE TABLE medication (code VARCHAR, Brand VARCHAR); CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR); CREATE TABLE physician (name VARCHAR, position VARCHAR, employeeid VARCHAR)","SELECT DISTINCT T1.name, T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = ""X""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE medication (code VARCHAR, Brand VARCHAR); CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR); CREATE TABLE physician (name VARCHAR, position VARCHAR, employeeid VARCHAR) ### question:Find the name and position of physicians who prescribe some medication whose brand is X?","SELECT DISTINCT T1.name, T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = ""X""" Find the number of medications prescribed for each brand.,"CREATE TABLE medication (name VARCHAR, brand VARCHAR, code VARCHAR); CREATE TABLE prescribes (medication VARCHAR)","SELECT COUNT(*), T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE medication (name VARCHAR, brand VARCHAR, code VARCHAR); CREATE TABLE prescribes (medication VARCHAR) ### question:Find the number of medications prescribed for each brand.","SELECT COUNT(*), T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand" Find the name of physicians whose position title contains the word 'senior'.,"CREATE TABLE physician (name VARCHAR, POSITION VARCHAR)",SELECT name FROM physician WHERE POSITION LIKE '%senior%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE physician (name VARCHAR, POSITION VARCHAR) ### question:Find the name of physicians whose position title contains the word 'senior'.",SELECT name FROM physician WHERE POSITION LIKE '%senior%' Find the patient who has the most recent undergoing treatment?,"CREATE TABLE undergoes (patient VARCHAR, dateundergoes VARCHAR)",SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE undergoes (patient VARCHAR, dateundergoes VARCHAR) ### question:Find the patient who has the most recent undergoing treatment?",SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1 Find the names of all patients who have an undergoing treatment and are staying in room 111.,"CREATE TABLE undergoes (patient VARCHAR, Stay VARCHAR); CREATE TABLE stay (StayID VARCHAR, room VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR)",SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE undergoes (patient VARCHAR, Stay VARCHAR); CREATE TABLE stay (StayID VARCHAR, room VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR) ### question:Find the names of all patients who have an undergoing treatment and are staying in room 111.",SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111 List the names of all distinct nurses ordered by alphabetical order?,CREATE TABLE nurse (name VARCHAR),SELECT DISTINCT name FROM nurse ORDER BY name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE nurse (name VARCHAR) ### question:List the names of all distinct nurses ordered by alphabetical order?",SELECT DISTINCT name FROM nurse ORDER BY name Find the names of nurses who are nursing an undergoing treatment.,"CREATE TABLE undergoes (AssistingNurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR)",SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE undergoes (AssistingNurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR) ### question:Find the names of nurses who are nursing an undergoing treatment.",SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID "List the names of all distinct medications, ordered in an alphabetical order.",CREATE TABLE medication (name VARCHAR),SELECT DISTINCT name FROM medication ORDER BY name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE medication (name VARCHAR) ### question:List the names of all distinct medications, ordered in an alphabetical order.",SELECT DISTINCT name FROM medication ORDER BY name What are the names of the physician who prescribed the highest dose?,"CREATE TABLE prescribes (physician VARCHAR, dose VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR)",SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE prescribes (physician VARCHAR, dose VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR) ### question:What are the names of the physician who prescribed the highest dose?",SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1 List the physicians' employee ids together with their primary affiliation departments' ids.,"CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, primaryaffiliation VARCHAR)","SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, primaryaffiliation VARCHAR) ### question:List the physicians' employee ids together with their primary affiliation departments' ids.","SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1" List the names of departments where some physicians are primarily affiliated with.,"CREATE TABLE affiliated_with (department VARCHAR); CREATE TABLE department (name VARCHAR, departmentid VARCHAR)",SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affiliated_with (department VARCHAR); CREATE TABLE department (name VARCHAR, departmentid VARCHAR) ### question:List the names of departments where some physicians are primarily affiliated with.",SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1 What nurses are on call with block floor 1 and block code 1? Tell me their names.,"CREATE TABLE on_call (nurse VARCHAR, blockfloor VARCHAR, blockcode VARCHAR)",SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE on_call (nurse VARCHAR, blockfloor VARCHAR, blockcode VARCHAR) ### question:What nurses are on call with block floor 1 and block code 1? Tell me their names.",SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 "What are the highest cost, lowest cost and average cost of procedures?",CREATE TABLE procedures (cost INTEGER),"SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE procedures (cost INTEGER) ### question:What are the highest cost, lowest cost and average cost of procedures?","SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures" List the name and cost of all procedures sorted by the cost from the highest to the lowest.,"CREATE TABLE procedures (name VARCHAR, cost VARCHAR)","SELECT name, cost FROM procedures ORDER BY cost DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE procedures (name VARCHAR, cost VARCHAR) ### question:List the name and cost of all procedures sorted by the cost from the highest to the lowest.","SELECT name, cost FROM procedures ORDER BY cost DESC" Find the three most expensive procedures.,"CREATE TABLE procedures (name VARCHAR, cost VARCHAR)",SELECT name FROM procedures ORDER BY cost LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE procedures (name VARCHAR, cost VARCHAR) ### question:Find the three most expensive procedures.",SELECT name FROM procedures ORDER BY cost LIMIT 3 Find the physicians who are trained in a procedure that costs more than 5000.,"CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost INTEGER)",SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost INTEGER) ### question:Find the physicians who are trained in a procedure that costs more than 5000.",SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000 Find the physician who was trained in the most expensive procedure?,"CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost VARCHAR)",SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost VARCHAR) ### question:Find the physician who was trained in the most expensive procedure?",SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1 What is the average cost of procedures that physician John Wen was trained in?,"CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (cost INTEGER, code VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR)","SELECT AVG(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (cost INTEGER, code VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR) ### question:What is the average cost of procedures that physician John Wen was trained in?","SELECT AVG(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""" Find the names of procedures which physician John Wen was trained in.,"CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR)","SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) ### question:Find the names of procedures which physician John Wen was trained in.","SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""" Find all procedures which cost more than 1000 or which physician John Wen was trained in.,"CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR)","SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) ### question:Find all procedures which cost more than 1000 or which physician John Wen was trained in.","SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""" Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?,"CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR)","SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) ### question:Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?","SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""" Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in.,"CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR)","SELECT name FROM procedures WHERE cost < 5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) ### question:Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in.","SELECT name FROM procedures WHERE cost < 5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = ""John Wen""" Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.,"CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR)",SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Psychiatry',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) ### question:Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.",SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Psychiatry' Find the name of physicians who are affiliated with Surgery or Psychiatry department.,"CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR)",SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' OR T3.name = 'Psychiatry',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) ### question:Find the name of physicians who are affiliated with Surgery or Psychiatry department.",SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' OR T3.name = 'Psychiatry' Find the names of patients who are not using the medication of Procrastin-X.,"CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR); CREATE TABLE patient (name VARCHAR)",SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR); CREATE TABLE patient (name VARCHAR) ### question:Find the names of patients who are not using the medication of Procrastin-X.",SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X' Find the number of patients who are not using the medication of Procrastin-X.,"CREATE TABLE Prescribes (patient VARCHAR, Medication VARCHAR); CREATE TABLE patient (SSN VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR)",SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Prescribes (patient VARCHAR, Medication VARCHAR); CREATE TABLE patient (SSN VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR) ### question:Find the number of patients who are not using the medication of Procrastin-X.",SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X') How many appointments are there?,CREATE TABLE appointment (Id VARCHAR),SELECT COUNT(*) FROM appointment,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE appointment (Id VARCHAR) ### question:How many appointments are there?",SELECT COUNT(*) FROM appointment Find the names of nurses who are on call.,"CREATE TABLE on_call (nurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR)",SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE on_call (nurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR) ### question:Find the names of nurses who are on call.",SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse How many ships are there?,CREATE TABLE ship (Id VARCHAR),SELECT COUNT(*) FROM ship,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (Id VARCHAR) ### question:How many ships are there?",SELECT COUNT(*) FROM ship List the name of ships in ascending order of tonnage.,"CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR)",SELECT Name FROM ship ORDER BY Tonnage,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR) ### question:List the name of ships in ascending order of tonnage.",SELECT Name FROM ship ORDER BY Tonnage What are the type and nationality of ships?,"CREATE TABLE ship (TYPE VARCHAR, Nationality VARCHAR)","SELECT TYPE, Nationality FROM ship","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (TYPE VARCHAR, Nationality VARCHAR) ### question:What are the type and nationality of ships?","SELECT TYPE, Nationality FROM ship" "List the name of ships whose nationality is not ""United States"".","CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR)","SELECT Name FROM ship WHERE Nationality <> ""United States""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR) ### question:List the name of ships whose nationality is not ""United States"".","SELECT Name FROM ship WHERE Nationality <> ""United States""" Show the name of ships whose nationality is either United States or United Kingdom.,"CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR)","SELECT Name FROM ship WHERE Nationality = ""United States"" OR Nationality = ""United Kingdom""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR) ### question:Show the name of ships whose nationality is either United States or United Kingdom.","SELECT Name FROM ship WHERE Nationality = ""United States"" OR Nationality = ""United Kingdom""" What is the name of the ship with the largest tonnage?,"CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR)",SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR) ### question:What is the name of the ship with the largest tonnage?",SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1 Show different types of ships and the number of ships of each type.,CREATE TABLE ship (TYPE VARCHAR),"SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (TYPE VARCHAR) ### question:Show different types of ships and the number of ships of each type.","SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE" Please show the most common type of ships.,CREATE TABLE ship (TYPE VARCHAR),SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (TYPE VARCHAR) ### question:Please show the most common type of ships.",SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 List the nations that have more than two ships.,CREATE TABLE ship (Nationality VARCHAR),SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (Nationality VARCHAR) ### question:List the nations that have more than two ships.",SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2 Show different types of ships and the average tonnage of ships of each type.,"CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER)","SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER) ### question:Show different types of ships and the average tonnage of ships of each type.","SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE" "Show codes and fates of missions, and names of ships involved.","CREATE TABLE mission (Code VARCHAR, Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR)","SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mission (Code VARCHAR, Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) ### question:Show codes and fates of missions, and names of ships involved.","SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID" Show names of ships involved in a mission launched after 1928.,"CREATE TABLE mission (Ship_ID VARCHAR, Launched_Year INTEGER); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR)",SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mission (Ship_ID VARCHAR, Launched_Year INTEGER); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) ### question:Show names of ships involved in a mission launched after 1928.",SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928 "Show the distinct fate of missions that involve ships with nationality ""United States""","CREATE TABLE mission (Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Ship_ID VARCHAR, Nationality VARCHAR)","SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = ""United States""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mission (Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Ship_ID VARCHAR, Nationality VARCHAR) ### question:Show the distinct fate of missions that involve ships with nationality ""United States""","SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = ""United States""" List the name of ships that are not involved in any mission,"CREATE TABLE mission (Name VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR)",SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mission (Name VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) ### question:List the name of ships that are not involved in any mission",SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission) Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.,"CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER)",SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER) ### question:Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.",SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000 Find the number of students in total.,CREATE TABLE list (Id VARCHAR),SELECT COUNT(*) FROM list,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (Id VARCHAR) ### question:Find the number of students in total.",SELECT COUNT(*) FROM list Find the last names of students studying in room 111.,"CREATE TABLE list (lastname VARCHAR, classroom VARCHAR)",SELECT lastname FROM list WHERE classroom = 111,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (lastname VARCHAR, classroom VARCHAR) ### question:Find the last names of students studying in room 111.",SELECT lastname FROM list WHERE classroom = 111 Find the first names of students studying in room 108.,"CREATE TABLE list (firstname VARCHAR, classroom VARCHAR)",SELECT firstname FROM list WHERE classroom = 108,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (firstname VARCHAR, classroom VARCHAR) ### question:Find the first names of students studying in room 108.",SELECT firstname FROM list WHERE classroom = 108 What are the first names of students studying in room 107?,"CREATE TABLE list (firstname VARCHAR, classroom VARCHAR)",SELECT DISTINCT firstname FROM list WHERE classroom = 107,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (firstname VARCHAR, classroom VARCHAR) ### question:What are the first names of students studying in room 107?",SELECT DISTINCT firstname FROM list WHERE classroom = 107 For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.,"CREATE TABLE list (classroom VARCHAR, grade VARCHAR)","SELECT DISTINCT classroom, grade FROM list","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR, grade VARCHAR) ### question:For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.","SELECT DISTINCT classroom, grade FROM list" Which grade is studying in classroom 103?,"CREATE TABLE list (grade VARCHAR, classroom VARCHAR)",SELECT DISTINCT grade FROM list WHERE classroom = 103,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (grade VARCHAR, classroom VARCHAR) ### question:Which grade is studying in classroom 103?",SELECT DISTINCT grade FROM list WHERE classroom = 103 Find the grade studying in room 105.,"CREATE TABLE list (grade VARCHAR, classroom VARCHAR)",SELECT DISTINCT grade FROM list WHERE classroom = 105,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (grade VARCHAR, classroom VARCHAR) ### question:Find the grade studying in room 105.",SELECT DISTINCT grade FROM list WHERE classroom = 105 Which classrooms are used by grade 4?,"CREATE TABLE list (classroom VARCHAR, grade VARCHAR)",SELECT DISTINCT classroom FROM list WHERE grade = 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR, grade VARCHAR) ### question:Which classrooms are used by grade 4?",SELECT DISTINCT classroom FROM list WHERE grade = 4 Which classrooms are used by grade 5?,"CREATE TABLE list (classroom VARCHAR, grade VARCHAR)",SELECT DISTINCT classroom FROM list WHERE grade = 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR, grade VARCHAR) ### question:Which classrooms are used by grade 5?",SELECT DISTINCT classroom FROM list WHERE grade = 5 Find the last names of the teachers that teach fifth grade.,"CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR)",SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR) ### question:Find the last names of the teachers that teach fifth grade.",SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5 Find the first names of the teachers that teach first grade.,"CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR)",SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR) ### question:Find the first names of the teachers that teach first grade.",SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1 Find the first names of all the teachers that teach in classroom 110.,"CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR)",SELECT firstname FROM teachers WHERE classroom = 110,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR) ### question:Find the first names of all the teachers that teach in classroom 110.",SELECT firstname FROM teachers WHERE classroom = 110 Find the last names of teachers teaching in classroom 109.,"CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR)",SELECT lastname FROM teachers WHERE classroom = 109,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR) ### question:Find the last names of teachers teaching in classroom 109.",SELECT lastname FROM teachers WHERE classroom = 109 Report the first name and last name of all the teachers.,"CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR)","SELECT DISTINCT firstname, lastname FROM teachers","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR) ### question:Report the first name and last name of all the teachers.","SELECT DISTINCT firstname, lastname FROM teachers" Report the first name and last name of all the students.,"CREATE TABLE list (firstname VARCHAR, lastname VARCHAR)","SELECT DISTINCT firstname, lastname FROM list","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (firstname VARCHAR, lastname VARCHAR) ### question:Report the first name and last name of all the students.","SELECT DISTINCT firstname, lastname FROM list" Find all students taught by OTHA MOYER. Output the first and last names of the students.,"CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""OTHA"" AND T2.lastname = ""MOYER""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:Find all students taught by OTHA MOYER. Output the first and last names of the students.","SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""OTHA"" AND T2.lastname = ""MOYER""" Find all students taught by MARROTTE KIRK. Output first and last names of students.,"CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""MARROTTE"" AND T2.lastname = ""KIRK""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:Find all students taught by MARROTTE KIRK. Output first and last names of students.","SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""MARROTTE"" AND T2.lastname = ""KIRK""" Find the first and last name of all the teachers that teach EVELINA BROMLEY.,"CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""EVELINA"" AND T1.lastname = ""BROMLEY""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:Find the first and last name of all the teachers that teach EVELINA BROMLEY.","SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""EVELINA"" AND T1.lastname = ""BROMLEY""" Find the last names of all the teachers that teach GELL TAMI.,"CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""GELL"" AND T1.lastname = ""TAMI""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:Find the last names of all the teachers that teach GELL TAMI.","SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""GELL"" AND T1.lastname = ""TAMI""" How many students does LORIA ONDERSMA teaches?,"CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""LORIA"" AND T2.lastname = ""ONDERSMA""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:How many students does LORIA ONDERSMA teaches?","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""LORIA"" AND T2.lastname = ""ONDERSMA""" How many students does KAWA GORDON teaches?,"CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""KAWA"" AND T2.lastname = ""GORDON""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:How many students does KAWA GORDON teaches?","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""KAWA"" AND T2.lastname = ""GORDON""" Find the number of students taught by TARRING LEIA.,"CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""TARRING"" AND T2.lastname = ""LEIA""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:Find the number of students taught by TARRING LEIA.","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""TARRING"" AND T2.lastname = ""LEIA""" How many teachers does the student named CHRISSY NABOZNY have?,"CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""CHRISSY"" AND T1.lastname = ""NABOZNY""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:How many teachers does the student named CHRISSY NABOZNY have?","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""CHRISSY"" AND T1.lastname = ""NABOZNY""" How many teachers does the student named MADLOCK RAY have?,"CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""MADLOCK"" AND T1.lastname = ""RAY""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:How many teachers does the student named MADLOCK RAY have?","SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""MADLOCK"" AND T1.lastname = ""RAY""" Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.,"CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)","SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""OTHA"" AND T2.lastname = ""MOYER""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) ### question:Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.","SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""OTHA"" AND T2.lastname = ""MOYER""" Find the last names of the students in third grade that are not taught by COVIN JEROME.,"CREATE TABLE list (lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, lastname VARCHAR, firstname VARCHAR)","SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> ""COVIN"" AND T2.lastname <> ""JEROME""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, lastname VARCHAR, firstname VARCHAR) ### question:Find the last names of the students in third grade that are not taught by COVIN JEROME.","SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> ""COVIN"" AND T2.lastname <> ""JEROME""" "For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.","CREATE TABLE list (grade VARCHAR, classroom VARCHAR)","SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (grade VARCHAR, classroom VARCHAR) ### question:For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.","SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade" "For each classroom, report the classroom number and the number of grades using it.","CREATE TABLE list (classroom VARCHAR, grade VARCHAR)","SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR, grade VARCHAR) ### question:For each classroom, report the classroom number and the number of grades using it.","SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom" Which classroom has the most students?,CREATE TABLE list (classroom VARCHAR),SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR) ### question:Which classroom has the most students?",SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1 Report the number of students in each classroom.,CREATE TABLE list (classroom VARCHAR),"SELECT classroom, COUNT(*) FROM list GROUP BY classroom","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR) ### question:Report the number of students in each classroom.","SELECT classroom, COUNT(*) FROM list GROUP BY classroom" "For each grade 0 classroom, report the total number of students.","CREATE TABLE list (classroom VARCHAR, grade VARCHAR)","SELECT classroom, COUNT(*) FROM list WHERE grade = ""0"" GROUP BY classroom","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR, grade VARCHAR) ### question:For each grade 0 classroom, report the total number of students.","SELECT classroom, COUNT(*) FROM list WHERE grade = ""0"" GROUP BY classroom" Report the total number of students for each fourth-grade classroom.,"CREATE TABLE list (classroom VARCHAR, grade VARCHAR)","SELECT classroom, COUNT(*) FROM list WHERE grade = ""4"" GROUP BY classroom","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR, grade VARCHAR) ### question:Report the total number of students for each fourth-grade classroom.","SELECT classroom, COUNT(*) FROM list WHERE grade = ""4"" GROUP BY classroom" Find the name of the teacher who teaches the largest number of students.,"CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR)","SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname, T2.lastname ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR) ### question:Find the name of the teacher who teaches the largest number of students.","SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname, T2.lastname ORDER BY COUNT(*) DESC LIMIT 1" Find the number of students in one classroom.,CREATE TABLE list (classroom VARCHAR),"SELECT COUNT(*), classroom FROM list GROUP BY classroom","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE list (classroom VARCHAR) ### question:Find the number of students in one classroom.","SELECT COUNT(*), classroom FROM list GROUP BY classroom" How many companies are headquartered in the US?,CREATE TABLE company (Headquarters VARCHAR),SELECT COUNT(*) FROM company WHERE Headquarters = 'USA',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Headquarters VARCHAR) ### question:How many companies are headquartered in the US?",SELECT COUNT(*) FROM company WHERE Headquarters = 'USA' List the names of companies by ascending number of sales.,"CREATE TABLE company (Name VARCHAR, Sales_in_Billion VARCHAR)",SELECT Name FROM company ORDER BY Sales_in_Billion,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Name VARCHAR, Sales_in_Billion VARCHAR) ### question:List the names of companies by ascending number of sales.",SELECT Name FROM company ORDER BY Sales_in_Billion What are the headquarters and industries of all companies?,"CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR)","SELECT Headquarters, Industry FROM company","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR) ### question:What are the headquarters and industries of all companies?","SELECT Headquarters, Industry FROM company" Show the names of companies in the banking or retailing industry?,"CREATE TABLE company (Name VARCHAR, Industry VARCHAR)","SELECT Name FROM company WHERE Industry = ""Banking"" OR Industry = ""Retailing""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Name VARCHAR, Industry VARCHAR) ### question:Show the names of companies in the banking or retailing industry?","SELECT Name FROM company WHERE Industry = ""Banking"" OR Industry = ""Retailing""" What is the maximum and minimum market value of companies?,CREATE TABLE company (Market_Value_in_Billion INTEGER),"SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Market_Value_in_Billion INTEGER) ### question:What is the maximum and minimum market value of companies?","SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company" What is the headquarter of the company with the largest sales?,"CREATE TABLE company (Headquarters VARCHAR, Sales_in_Billion VARCHAR)",SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Headquarters VARCHAR, Sales_in_Billion VARCHAR) ### question:What is the headquarter of the company with the largest sales?",SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1 Show the different headquarters and number of companies at each headquarter.,CREATE TABLE company (Headquarters VARCHAR),"SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Headquarters VARCHAR) ### question:Show the different headquarters and number of companies at each headquarter.","SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters" Show the most common headquarter for companies.,CREATE TABLE company (Headquarters VARCHAR),SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Headquarters VARCHAR) ### question:Show the most common headquarter for companies.",SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1 Show the headquarters that have at least two companies.,CREATE TABLE company (Headquarters VARCHAR),SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Headquarters VARCHAR) ### question:Show the headquarters that have at least two companies.",SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2 Show the headquarters that have both companies in banking industry and companies in oil and gas industry.,"CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR)","SELECT Headquarters FROM company WHERE Industry = ""Banking"" INTERSECT SELECT Headquarters FROM company WHERE Industry = ""Oil and gas""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR) ### question:Show the headquarters that have both companies in banking industry and companies in oil and gas industry.","SELECT Headquarters FROM company WHERE Industry = ""Banking"" INTERSECT SELECT Headquarters FROM company WHERE Industry = ""Oil and gas""" Show the names of companies and of employees.,"CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)","SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:Show the names of companies and of employees.","SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID" Show names of companies and that of employees in descending order of number of years working for that employee.,"CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR, Year_working VARCHAR)","SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR, Year_working VARCHAR) ### question:Show names of companies and that of employees in descending order of number of years working for that employee.","SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working" Show the names of employees that work for companies with sales bigger than 200.,"CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE company (Company_ID VARCHAR, Sales_in_Billion INTEGER); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)",SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE company (Company_ID VARCHAR, Sales_in_Billion INTEGER); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:Show the names of employees that work for companies with sales bigger than 200.",SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200 Show the names of companies and the number of employees they have,"CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR)","SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR) ### question:Show the names of companies and the number of employees they have","SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name" List the names of people that are not employed by any company,"CREATE TABLE employment (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)",SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE employment (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:List the names of people that are not employed by any company",SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment) list the names of the companies with more than 200 sales in the descending order of sales and profits.,"CREATE TABLE company (name VARCHAR, Sales_in_Billion INTEGER, Profits_in_Billion VARCHAR)","SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion, Profits_in_Billion DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE company (name VARCHAR, Sales_in_Billion INTEGER, Profits_in_Billion VARCHAR) ### question:list the names of the companies with more than 200 sales in the descending order of sales and profits.","SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion, Profits_in_Billion DESC" How many film are there?,CREATE TABLE film (Id VARCHAR),SELECT COUNT(*) FROM film,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Id VARCHAR) ### question:How many film are there?",SELECT COUNT(*) FROM film List the distinct director of all films.,CREATE TABLE film (Director VARCHAR),SELECT DISTINCT Director FROM film,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Director VARCHAR) ### question:List the distinct director of all films.",SELECT DISTINCT Director FROM film What is the average ticket sales gross in dollars of films?,CREATE TABLE film (Gross_in_dollar INTEGER),SELECT AVG(Gross_in_dollar) FROM film,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Gross_in_dollar INTEGER) ### question:What is the average ticket sales gross in dollars of films?",SELECT AVG(Gross_in_dollar) FROM film What are the low and high estimates of film markets?,"CREATE TABLE film_market_estimation (Low_Estimate VARCHAR, High_Estimate VARCHAR)","SELECT Low_Estimate, High_Estimate FROM film_market_estimation","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_market_estimation (Low_Estimate VARCHAR, High_Estimate VARCHAR) ### question:What are the low and high estimates of film markets?","SELECT Low_Estimate, High_Estimate FROM film_market_estimation" What are the types of film market estimations in year 1995?,"CREATE TABLE film_market_estimation (TYPE VARCHAR, YEAR VARCHAR)",SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_market_estimation (TYPE VARCHAR, YEAR VARCHAR) ### question:What are the types of film market estimations in year 1995?",SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995 What are the maximum and minimum number of cities in all markets.,CREATE TABLE market (Number_cities INTEGER),"SELECT MAX(Number_cities), MIN(Number_cities) FROM market","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE market (Number_cities INTEGER) ### question:What are the maximum and minimum number of cities in all markets.","SELECT MAX(Number_cities), MIN(Number_cities) FROM market" How many markets have number of cities smaller than 300?,CREATE TABLE market (Number_cities INTEGER),SELECT COUNT(*) FROM market WHERE Number_cities < 300,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE market (Number_cities INTEGER) ### question:How many markets have number of cities smaller than 300?",SELECT COUNT(*) FROM market WHERE Number_cities < 300 List all countries of markets in ascending alphabetical order.,CREATE TABLE market (Country VARCHAR),SELECT Country FROM market ORDER BY Country,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE market (Country VARCHAR) ### question:List all countries of markets in ascending alphabetical order.",SELECT Country FROM market ORDER BY Country List all countries of markets in descending order of number of cities.,"CREATE TABLE market (Country VARCHAR, Number_cities VARCHAR)",SELECT Country FROM market ORDER BY Number_cities DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE market (Country VARCHAR, Number_cities VARCHAR) ### question:List all countries of markets in descending order of number of cities.",SELECT Country FROM market ORDER BY Number_cities DESC Please show the titles of films and the types of market estimations.,"CREATE TABLE film (Title VARCHAR, Film_ID VARCHAR); CREATE TABLE film_market_estimation (Type VARCHAR, Film_ID VARCHAR)","SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Title VARCHAR, Film_ID VARCHAR); CREATE TABLE film_market_estimation (Type VARCHAR, Film_ID VARCHAR) ### question:Please show the titles of films and the types of market estimations.","SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID" Show the distinct director of films with market estimation in the year of 1995.,"CREATE TABLE film (Director VARCHAR, Film_ID VARCHAR); CREATE TABLE film_market_estimation (Film_ID VARCHAR, Year VARCHAR)",SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Director VARCHAR, Film_ID VARCHAR); CREATE TABLE film_market_estimation (Film_ID VARCHAR, Year VARCHAR) ### question:Show the distinct director of films with market estimation in the year of 1995.",SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995 What is the average number of cities of markets with low film market estimate bigger than 10000?,"CREATE TABLE market (Number_cities INTEGER, Market_ID VARCHAR); CREATE TABLE film_market_estimation (Market_ID VARCHAR, Low_Estimate INTEGER)",SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE market (Number_cities INTEGER, Market_ID VARCHAR); CREATE TABLE film_market_estimation (Market_ID VARCHAR, Low_Estimate INTEGER) ### question:What is the average number of cities of markets with low film market estimate bigger than 10000?",SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000 Please list the countries and years of film market estimations.,"CREATE TABLE film_market_estimation (Year VARCHAR, Market_ID VARCHAR); CREATE TABLE market (Country VARCHAR, Market_ID VARCHAR)","SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_market_estimation (Year VARCHAR, Market_ID VARCHAR); CREATE TABLE market (Country VARCHAR, Market_ID VARCHAR) ### question:Please list the countries and years of film market estimations.","SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID" "Please list the years of film market estimations when the market is in country ""Japan"" in descending order.","CREATE TABLE film_market_estimation (Year VARCHAR, Market_ID VARCHAR); CREATE TABLE market (Market_ID VARCHAR, Country VARCHAR)","SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = ""Japan"" ORDER BY T1.Year DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_market_estimation (Year VARCHAR, Market_ID VARCHAR); CREATE TABLE market (Market_ID VARCHAR, Country VARCHAR) ### question:Please list the years of film market estimations when the market is in country ""Japan"" in descending order.","SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = ""Japan"" ORDER BY T1.Year DESC" List the studios of each film and the number of films produced by that studio.,CREATE TABLE film (Studio VARCHAR),"SELECT Studio, COUNT(*) FROM film GROUP BY Studio","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Studio VARCHAR) ### question:List the studios of each film and the number of films produced by that studio.","SELECT Studio, COUNT(*) FROM film GROUP BY Studio" List the name of film studio that have the most number of films.,CREATE TABLE film (Studio VARCHAR),SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Studio VARCHAR) ### question:List the name of film studio that have the most number of films.",SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1 List the names of studios that have at least two films.,CREATE TABLE film (Studio VARCHAR),SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Studio VARCHAR) ### question:List the names of studios that have at least two films.",SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2 List the title of films that do not have any market estimation.,"CREATE TABLE film_market_estimation (Title VARCHAR, Film_ID VARCHAR); CREATE TABLE film (Title VARCHAR, Film_ID VARCHAR)",SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_market_estimation (Title VARCHAR, Film_ID VARCHAR); CREATE TABLE film (Title VARCHAR, Film_ID VARCHAR) ### question:List the title of films that do not have any market estimation.",SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation) "Show the studios that have produced films with director ""Nicholas Meyer"" and ""Walter Hill"".","CREATE TABLE film (Studio VARCHAR, Director VARCHAR)","SELECT Studio FROM film WHERE Director = ""Nicholas Meyer"" INTERSECT SELECT Studio FROM film WHERE Director = ""Walter Hill""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Studio VARCHAR, Director VARCHAR) ### question:Show the studios that have produced films with director ""Nicholas Meyer"" and ""Walter Hill"".","SELECT Studio FROM film WHERE Director = ""Nicholas Meyer"" INTERSECT SELECT Studio FROM film WHERE Director = ""Walter Hill""" "Find the titles and studios of the films that are produced by some film studios that contained the word ""Universal"".","CREATE TABLE film (title VARCHAR, Studio VARCHAR)","SELECT title, Studio FROM film WHERE Studio LIKE ""%Universal%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, Studio VARCHAR) ### question:Find the titles and studios of the films that are produced by some film studios that contained the word ""Universal"".","SELECT title, Studio FROM film WHERE Studio LIKE ""%Universal%""" "Show the studios that have not produced films with director ""Walter Hill"".","CREATE TABLE film (Studio VARCHAR, Director VARCHAR)","SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = ""Walter Hill""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Studio VARCHAR, Director VARCHAR) ### question:Show the studios that have not produced films with director ""Walter Hill"".","SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = ""Walter Hill""" List the studios which average gross is above 4500000.,"CREATE TABLE film (Studio VARCHAR, Gross_in_dollar INTEGER)",SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (Studio VARCHAR, Gross_in_dollar INTEGER) ### question:List the studios which average gross is above 4500000.",SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000 What is the title of the film that has the highest high market estimation.,CREATE TABLE film_market_estimation (Film_ID VARCHAR); CREATE TABLE film (Film_ID VARCHAR),SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film_market_estimation (Film_ID VARCHAR); CREATE TABLE film (Film_ID VARCHAR) ### question:What is the title of the film that has the highest high market estimation.",SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1 What are the titles and directors of the films were never presented in China?,"CREATE TABLE film (title VARCHAR, director VARCHAR, film_id VARCHAR, country VARCHAR); CREATE TABLE market (Market_ID VARCHAR); CREATE TABLE film_market_estimation (market_id VARCHAR)","SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE film (title VARCHAR, director VARCHAR, film_id VARCHAR, country VARCHAR); CREATE TABLE market (Market_ID VARCHAR); CREATE TABLE film_market_estimation (market_id VARCHAR) ### question:What are the titles and directors of the films were never presented in China?","SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')" How many calendar items do we have?,CREATE TABLE Ref_calendar (Id VARCHAR),SELECT COUNT(*) FROM Ref_calendar,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_calendar (Id VARCHAR) ### question:How many calendar items do we have?",SELECT COUNT(*) FROM Ref_calendar Show all calendar dates and day Numbers.,"CREATE TABLE Ref_calendar (calendar_date VARCHAR, day_Number VARCHAR)","SELECT calendar_date, day_Number FROM Ref_calendar","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_calendar (calendar_date VARCHAR, day_Number VARCHAR) ### question:Show all calendar dates and day Numbers.","SELECT calendar_date, day_Number FROM Ref_calendar" Show the number of document types.,CREATE TABLE Ref_document_types (Id VARCHAR),SELECT COUNT(*) FROM Ref_document_types,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (Id VARCHAR) ### question:Show the number of document types.",SELECT COUNT(*) FROM Ref_document_types List all document type codes and document type names.,"CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR)","SELECT document_type_code, document_type_name FROM Ref_document_types","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR) ### question:List all document type codes and document type names.","SELECT document_type_code, document_type_name FROM Ref_document_types" What is the name and description for document type code RV?,"CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type_description VARCHAR, document_type_code VARCHAR)","SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = ""RV""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type_description VARCHAR, document_type_code VARCHAR) ### question:What is the name and description for document type code RV?","SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = ""RV""" "What is the document type code for document type ""Paper""?","CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR)","SELECT document_type_code FROM Ref_document_types WHERE document_type_name = ""Paper""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR) ### question:What is the document type code for document type ""Paper""?","SELECT document_type_code FROM Ref_document_types WHERE document_type_name = ""Paper""" Show the number of documents with document type code CV or BK.,CREATE TABLE All_documents (document_type_code VARCHAR),"SELECT COUNT(*) FROM All_documents WHERE document_type_code = ""CV"" OR document_type_code = ""BK""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE All_documents (document_type_code VARCHAR) ### question:Show the number of documents with document type code CV or BK.","SELECT COUNT(*) FROM All_documents WHERE document_type_code = ""CV"" OR document_type_code = ""BK""" "What is the date when the document ""Marry CV"" was stored?","CREATE TABLE All_documents (date_stored VARCHAR, Document_name VARCHAR)","SELECT date_stored FROM All_documents WHERE Document_name = ""Marry CV""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE All_documents (date_stored VARCHAR, Document_name VARCHAR) ### question:What is the date when the document ""Marry CV"" was stored?","SELECT date_stored FROM All_documents WHERE Document_name = ""Marry CV""" What is the day Number and date of all the documents?,"CREATE TABLE All_documents (Date_Stored VARCHAR, date_stored VARCHAR); CREATE TABLE Ref_calendar (day_Number VARCHAR, calendar_date VARCHAR)","SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE All_documents (Date_Stored VARCHAR, date_stored VARCHAR); CREATE TABLE Ref_calendar (day_Number VARCHAR, calendar_date VARCHAR) ### question:What is the day Number and date of all the documents?","SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date" "What is the document type name for the document with name ""How to read a book""?","CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type_code VARCHAR); CREATE TABLE All_documents (document_type_code VARCHAR, document_name VARCHAR)","SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = ""How to read a book""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type_code VARCHAR); CREATE TABLE All_documents (document_type_code VARCHAR, document_name VARCHAR) ### question:What is the document type name for the document with name ""How to read a book""?","SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = ""How to read a book""" Show the number of locations.,CREATE TABLE Ref_locations (Id VARCHAR),SELECT COUNT(*) FROM Ref_locations,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_locations (Id VARCHAR) ### question:Show the number of locations.",SELECT COUNT(*) FROM Ref_locations List all location codes and location names.,"CREATE TABLE Ref_locations (location_code VARCHAR, location_name VARCHAR)","SELECT location_code, location_name FROM Ref_locations","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_locations (location_code VARCHAR, location_name VARCHAR) ### question:List all location codes and location names.","SELECT location_code, location_name FROM Ref_locations" What are the name and description for location code x?,"CREATE TABLE Ref_locations (location_name VARCHAR, location_description VARCHAR, location_code VARCHAR)","SELECT location_name, location_description FROM Ref_locations WHERE location_code = ""x""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_locations (location_name VARCHAR, location_description VARCHAR, location_code VARCHAR) ### question:What are the name and description for location code x?","SELECT location_name, location_description FROM Ref_locations WHERE location_code = ""x""" "What is the location code for the country ""Canada""?","CREATE TABLE Ref_locations (location_code VARCHAR, location_name VARCHAR)","SELECT location_code FROM Ref_locations WHERE location_name = ""Canada""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_locations (location_code VARCHAR, location_name VARCHAR) ### question:What is the location code for the country ""Canada""?","SELECT location_code FROM Ref_locations WHERE location_name = ""Canada""" How many roles are there?,CREATE TABLE ROLES (Id VARCHAR),SELECT COUNT(*) FROM ROLES,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (Id VARCHAR) ### question:How many roles are there?",SELECT COUNT(*) FROM ROLES "List all role codes, role names, and role descriptions.","CREATE TABLE ROLES (role_code VARCHAR, role_name VARCHAR, role_description VARCHAR)","SELECT role_code, role_name, role_description FROM ROLES","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_code VARCHAR, role_name VARCHAR, role_description VARCHAR) ### question:List all role codes, role names, and role descriptions.","SELECT role_code, role_name, role_description FROM ROLES" "What are the name and description for role code ""MG""?","CREATE TABLE ROLES (role_name VARCHAR, role_description VARCHAR, role_code VARCHAR)","SELECT role_name, role_description FROM ROLES WHERE role_code = ""MG""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_name VARCHAR, role_description VARCHAR, role_code VARCHAR) ### question:What are the name and description for role code ""MG""?","SELECT role_name, role_description FROM ROLES WHERE role_code = ""MG""" "Show the description for role name ""Proof Reader"".","CREATE TABLE ROLES (role_description VARCHAR, role_name VARCHAR)","SELECT role_description FROM ROLES WHERE role_name = ""Proof Reader""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_description VARCHAR, role_name VARCHAR) ### question:Show the description for role name ""Proof Reader"".","SELECT role_description FROM ROLES WHERE role_name = ""Proof Reader""" "Show the name, role code, and date of birth for the employee with name 'Armani'.","CREATE TABLE Employees (employee_name VARCHAR, role_code VARCHAR, date_of_birth VARCHAR, employee_Name VARCHAR)","SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (employee_name VARCHAR, role_code VARCHAR, date_of_birth VARCHAR, employee_Name VARCHAR) ### question:Show the name, role code, and date of birth for the employee with name 'Armani'.","SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'" What is the id for the employee called Ebba?,"CREATE TABLE Employees (employee_ID VARCHAR, employee_name VARCHAR)","SELECT employee_ID FROM Employees WHERE employee_name = ""Ebba""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (employee_ID VARCHAR, employee_name VARCHAR) ### question:What is the id for the employee called Ebba?","SELECT employee_ID FROM Employees WHERE employee_name = ""Ebba""" "Show the names of all the employees with role ""HR"".","CREATE TABLE Employees (employee_name VARCHAR, role_code VARCHAR)","SELECT employee_name FROM Employees WHERE role_code = ""HR""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (employee_name VARCHAR, role_code VARCHAR) ### question:Show the names of all the employees with role ""HR"".","SELECT employee_name FROM Employees WHERE role_code = ""HR""" Show all role codes and the number of employees in each role.,CREATE TABLE Employees (role_code VARCHAR),"SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (role_code VARCHAR) ### question:Show all role codes and the number of employees in each role.","SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code" What is the role code with the largest number of employees?,CREATE TABLE Employees (role_code VARCHAR),SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (role_code VARCHAR) ### question:What is the role code with the largest number of employees?",SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 Show all role codes with at least 3 employees.,CREATE TABLE Employees (role_code VARCHAR),SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (role_code VARCHAR) ### question:Show all role codes with at least 3 employees.",SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3 Show the role code with the least employees.,CREATE TABLE Employees (role_code VARCHAR),SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (role_code VARCHAR) ### question:Show the role code with the least employees.",SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) LIMIT 1 What is the role name and role description for employee called Ebba?,"CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR); CREATE TABLE ROLES (role_name VARCHAR, role_description VARCHAR, role_code VARCHAR)","SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = ""Ebba""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR); CREATE TABLE ROLES (role_name VARCHAR, role_description VARCHAR, role_code VARCHAR) ### question:What is the role name and role description for employee called Ebba?","SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = ""Ebba""" Show the names of employees with role name Editor.,"CREATE TABLE ROLES (role_code VARCHAR, role_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR, role_code VARCHAR)","SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = ""Editor""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ROLES (role_code VARCHAR, role_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR, role_code VARCHAR) ### question:Show the names of employees with role name Editor.","SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = ""Editor""" "Show the employee ids for all employees with role name ""Human Resource"" or ""Manager"".","CREATE TABLE Employees (employee_id VARCHAR, role_code VARCHAR); CREATE TABLE ROLES (role_code VARCHAR, role_name VARCHAR)","SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = ""Human Resource"" OR T2.role_name = ""Manager""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (employee_id VARCHAR, role_code VARCHAR); CREATE TABLE ROLES (role_code VARCHAR, role_name VARCHAR) ### question:Show the employee ids for all employees with role name ""Human Resource"" or ""Manager"".","SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = ""Human Resource"" OR T2.role_name = ""Manager""" What are the different location codes for documents?,CREATE TABLE Document_locations (location_code VARCHAR),SELECT DISTINCT location_code FROM Document_locations,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_locations (location_code VARCHAR) ### question:What are the different location codes for documents?",SELECT DISTINCT location_code FROM Document_locations "Show the location name for document ""Robin CV"".","CREATE TABLE Ref_locations (location_name VARCHAR, location_code VARCHAR); CREATE TABLE All_documents (document_id VARCHAR, document_name VARCHAR); CREATE TABLE Document_locations (document_id VARCHAR, location_code VARCHAR)","SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = ""Robin CV""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_locations (location_name VARCHAR, location_code VARCHAR); CREATE TABLE All_documents (document_id VARCHAR, document_name VARCHAR); CREATE TABLE Document_locations (document_id VARCHAR, location_code VARCHAR) ### question:Show the location name for document ""Robin CV"".","SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = ""Robin CV""" "Show the location code, the starting date and ending data in that location for all the documents.","CREATE TABLE Document_locations (location_code VARCHAR, date_in_location_from VARCHAR, date_in_locaton_to VARCHAR)","SELECT location_code, date_in_location_from, date_in_locaton_to FROM Document_locations","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_locations (location_code VARCHAR, date_in_location_from VARCHAR, date_in_locaton_to VARCHAR) ### question:Show the location code, the starting date and ending data in that location for all the documents.","SELECT location_code, date_in_location_from, date_in_locaton_to FROM Document_locations" "What is ""the date in location from"" and ""the date in location to"" for the document with name ""Robin CV""?","CREATE TABLE All_documents (document_id VARCHAR, document_name VARCHAR); CREATE TABLE Document_locations (date_in_location_from VARCHAR, date_in_locaton_to VARCHAR, document_id VARCHAR)","SELECT T1.date_in_location_from, T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = ""Robin CV""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE All_documents (document_id VARCHAR, document_name VARCHAR); CREATE TABLE Document_locations (date_in_location_from VARCHAR, date_in_locaton_to VARCHAR, document_id VARCHAR) ### question:What is ""the date in location from"" and ""the date in location to"" for the document with name ""Robin CV""?","SELECT T1.date_in_location_from, T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = ""Robin CV""" Show the location codes and the number of documents in each location.,CREATE TABLE Document_locations (location_code VARCHAR),"SELECT location_code, COUNT(*) FROM Document_locations GROUP BY location_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_locations (location_code VARCHAR) ### question:Show the location codes and the number of documents in each location.","SELECT location_code, COUNT(*) FROM Document_locations GROUP BY location_code" What is the location code with the most documents?,CREATE TABLE Document_locations (location_code VARCHAR),SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_locations (location_code VARCHAR) ### question:What is the location code with the most documents?",SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY COUNT(*) DESC LIMIT 1 Show the location codes with at least 3 documents.,CREATE TABLE Document_locations (location_code VARCHAR),SELECT location_code FROM Document_locations GROUP BY location_code HAVING COUNT(*) >= 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_locations (location_code VARCHAR) ### question:Show the location codes with at least 3 documents.",SELECT location_code FROM Document_locations GROUP BY location_code HAVING COUNT(*) >= 3 Show the location name and code with the least documents.,"CREATE TABLE Document_locations (location_code VARCHAR); CREATE TABLE Ref_locations (location_name VARCHAR, location_code VARCHAR)","SELECT T2.location_name, T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY COUNT(*) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_locations (location_code VARCHAR); CREATE TABLE Ref_locations (location_name VARCHAR, location_code VARCHAR) ### question:Show the location name and code with the least documents.","SELECT T2.location_name, T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY COUNT(*) LIMIT 1" What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?,"CREATE TABLE Employees (employee_name VARCHAR, employee_id VARCHAR); CREATE TABLE Documents_to_be_destroyed (Destruction_Authorised_by_Employee_ID VARCHAR, Destroyed_by_Employee_ID VARCHAR)","SELECT T2.employee_name, T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (employee_name VARCHAR, employee_id VARCHAR); CREATE TABLE Documents_to_be_destroyed (Destruction_Authorised_by_Employee_ID VARCHAR, Destroyed_by_Employee_ID VARCHAR) ### question:What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?","SELECT T2.employee_name, T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id" Show the id of each employee and the number of document destruction authorised by that employee.,CREATE TABLE Documents_to_be_destroyed (Destruction_Authorised_by_Employee_ID VARCHAR),"SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_to_be_destroyed (Destruction_Authorised_by_Employee_ID VARCHAR) ### question:Show the id of each employee and the number of document destruction authorised by that employee.","SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID" Show the employee ids and the number of documents destroyed by each employee.,CREATE TABLE Documents_to_be_destroyed (Destroyed_by_Employee_ID VARCHAR),"SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_to_be_destroyed (Destroyed_by_Employee_ID VARCHAR) ### question:Show the employee ids and the number of documents destroyed by each employee.","SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID" Show the ids of the employees who don't authorize destruction for any document.,"CREATE TABLE Documents_to_be_destroyed (employee_id VARCHAR, Destruction_Authorised_by_Employee_ID VARCHAR); CREATE TABLE Employees (employee_id VARCHAR, Destruction_Authorised_by_Employee_ID VARCHAR)",SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_to_be_destroyed (employee_id VARCHAR, Destruction_Authorised_by_Employee_ID VARCHAR); CREATE TABLE Employees (employee_id VARCHAR, Destruction_Authorised_by_Employee_ID VARCHAR) ### question:Show the ids of the employees who don't authorize destruction for any document.",SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed Show the ids of all employees who have authorized destruction.,CREATE TABLE Documents_to_be_destroyed (Destruction_Authorised_by_Employee_ID VARCHAR),SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_to_be_destroyed (Destruction_Authorised_by_Employee_ID VARCHAR) ### question:Show the ids of all employees who have authorized destruction.",SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed Show the ids of all employees who have destroyed a document.,CREATE TABLE Documents_to_be_destroyed (Destroyed_by_Employee_ID VARCHAR),SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_to_be_destroyed (Destroyed_by_Employee_ID VARCHAR) ### question:Show the ids of all employees who have destroyed a document.",SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed Show the ids of all employees who don't destroy any document.,"CREATE TABLE Employees (employee_id VARCHAR, Destroyed_by_Employee_ID VARCHAR); CREATE TABLE Documents_to_be_destroyed (employee_id VARCHAR, Destroyed_by_Employee_ID VARCHAR)",SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Employees (employee_id VARCHAR, Destroyed_by_Employee_ID VARCHAR); CREATE TABLE Documents_to_be_destroyed (employee_id VARCHAR, Destroyed_by_Employee_ID VARCHAR) ### question:Show the ids of all employees who don't destroy any document.",SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed Show the ids of all employees who have either destroyed a document or made an authorization to do this.,"CREATE TABLE Documents_to_be_destroyed (Destroyed_by_Employee_ID VARCHAR, Destruction_Authorised_by_Employee_ID VARCHAR)",SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_to_be_destroyed (Destroyed_by_Employee_ID VARCHAR, Destruction_Authorised_by_Employee_ID VARCHAR) ### question:Show the ids of all employees who have either destroyed a document or made an authorization to do this.",SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed What are the names of all clubs?,CREATE TABLE club (clubname VARCHAR),SELECT clubname FROM club,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubname VARCHAR) ### question:What are the names of all clubs?",SELECT clubname FROM club How many students are there?,CREATE TABLE student (Id VARCHAR),SELECT COUNT(*) FROM student,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (Id VARCHAR) ### question:How many students are there?",SELECT COUNT(*) FROM student What are the first names of all the students?,CREATE TABLE student (fname VARCHAR),SELECT DISTINCT fname FROM student,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR) ### question:What are the first names of all the students?",SELECT DISTINCT fname FROM student "Find the last names of the members of the club ""Bootup Baltimore"".","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:Find the last names of the members of the club ""Bootup Baltimore"".","SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore""" "Who are the members of the club named ""Hopkins Student Enterprises""? Show the last name.","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:Who are the members of the club named ""Hopkins Student Enterprises""? Show the last name.","SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises""" "How many members does the club ""Tennis Club"" has?","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE student (stuid VARCHAR)","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Tennis Club""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE student (stuid VARCHAR) ### question:How many members does the club ""Tennis Club"" has?","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Tennis Club""" "Find the number of members of club ""Pen and Paper Gaming"".","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE student (stuid VARCHAR)","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Pen and Paper Gaming""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE student (stuid VARCHAR) ### question:Find the number of members of club ""Pen and Paper Gaming"".","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Pen and Paper Gaming""" "How many clubs does ""Linda Smith"" belong to?","CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubid VARCHAR)","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Linda"" AND t3.lname = ""Smith""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubid VARCHAR) ### question:How many clubs does ""Linda Smith"" belong to?","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Linda"" AND t3.lname = ""Smith""" "Find the number of clubs where ""Tracy Kim"" is a member.","CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubid VARCHAR)","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Tracy"" AND t3.lname = ""Kim""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubid VARCHAR) ### question:Find the number of clubs where ""Tracy Kim"" is a member.","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Tracy"" AND t3.lname = ""Kim""" "Find all the female members of club ""Bootup Baltimore"". Show the first name and last name.","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR, sex VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.sex = ""F""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR, sex VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:Find all the female members of club ""Bootup Baltimore"". Show the first name and last name.","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.sex = ""F""" "Find all the male members of club ""Hopkins Student Enterprises"". Show the first name and last name.","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR, sex VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises"" AND t3.sex = ""M""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR, sex VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:Find all the male members of club ""Hopkins Student Enterprises"". Show the first name and last name.","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises"" AND t3.sex = ""M""" "Find all members of ""Bootup Baltimore"" whose major is ""600"". Show the first name and last name.","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR, major VARCHAR)","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.major = ""600""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR, major VARCHAR) ### question:Find all members of ""Bootup Baltimore"" whose major is ""600"". Show the first name and last name.","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.major = ""600""" "Which club has the most members majoring in ""600""?","CREATE TABLE student (stuid VARCHAR, major VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR)","SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = ""600"" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, major VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR) ### question:Which club has the most members majoring in ""600""?","SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = ""600"" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1" Find the name of the club that has the most female students.,"CREATE TABLE student (stuid VARCHAR, sex VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR)","SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = ""F"" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, sex VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR) ### question:Find the name of the club that has the most female students.","SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = ""F"" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1" "What is the description of the club named ""Tennis Club""?","CREATE TABLE club (clubdesc VARCHAR, clubname VARCHAR)","SELECT clubdesc FROM club WHERE clubname = ""Tennis Club""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubdesc VARCHAR, clubname VARCHAR) ### question:What is the description of the club named ""Tennis Club""?","SELECT clubdesc FROM club WHERE clubname = ""Tennis Club""" "Find the description of the club ""Pen and Paper Gaming"".","CREATE TABLE club (clubdesc VARCHAR, clubname VARCHAR)","SELECT clubdesc FROM club WHERE clubname = ""Pen and Paper Gaming""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubdesc VARCHAR, clubname VARCHAR) ### question:Find the description of the club ""Pen and Paper Gaming"".","SELECT clubdesc FROM club WHERE clubname = ""Pen and Paper Gaming""" "What is the location of the club named ""Tennis Club""?","CREATE TABLE club (clublocation VARCHAR, clubname VARCHAR)","SELECT clublocation FROM club WHERE clubname = ""Tennis Club""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clublocation VARCHAR, clubname VARCHAR) ### question:What is the location of the club named ""Tennis Club""?","SELECT clublocation FROM club WHERE clubname = ""Tennis Club""" "Find the location of the club ""Pen and Paper Gaming"".","CREATE TABLE club (clublocation VARCHAR, clubname VARCHAR)","SELECT clublocation FROM club WHERE clubname = ""Pen and Paper Gaming""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clublocation VARCHAR, clubname VARCHAR) ### question:Find the location of the club ""Pen and Paper Gaming"".","SELECT clublocation FROM club WHERE clubname = ""Pen and Paper Gaming""" "Where is the club ""Hopkins Student Enterprises"" located?","CREATE TABLE club (clublocation VARCHAR, clubname VARCHAR)","SELECT clublocation FROM club WHERE clubname = ""Hopkins Student Enterprises""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clublocation VARCHAR, clubname VARCHAR) ### question:Where is the club ""Hopkins Student Enterprises"" located?","SELECT clublocation FROM club WHERE clubname = ""Hopkins Student Enterprises""" "Find the name of all the clubs at ""AKW"".","CREATE TABLE club (clubname VARCHAR, clublocation VARCHAR)","SELECT clubname FROM club WHERE clublocation = ""AKW""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubname VARCHAR, clublocation VARCHAR) ### question:Find the name of all the clubs at ""AKW"".","SELECT clubname FROM club WHERE clublocation = ""AKW""" "How many clubs are located at ""HHH""?",CREATE TABLE club (clublocation VARCHAR),"SELECT COUNT(*) FROM club WHERE clublocation = ""HHH""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clublocation VARCHAR) ### question:How many clubs are located at ""HHH""?","SELECT COUNT(*) FROM club WHERE clublocation = ""HHH""" "What are the first and last name of the president of the club ""Bootup Baltimore""?","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR, position VARCHAR)","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t2.position = ""President""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR, position VARCHAR) ### question:What are the first and last name of the president of the club ""Bootup Baltimore""?","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t2.position = ""President""" "Who is the ""CTO"" of club ""Hopkins Student Enterprises""? Show the first name and last name.","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR, position VARCHAR)","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises"" AND t2.position = ""CTO""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR, position VARCHAR) ### question:Who is the ""CTO"" of club ""Hopkins Student Enterprises""? Show the first name and last name.","SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises"" AND t2.position = ""CTO""" "How many different roles are there in the club ""Bootup Baltimore""?","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (position VARCHAR, clubid VARCHAR)","SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = ""Bootup Baltimore""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE member_of_club (position VARCHAR, clubid VARCHAR) ### question:How many different roles are there in the club ""Bootup Baltimore""?","SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = ""Bootup Baltimore""" "How many members of ""Bootup Baltimore"" are older than 18?","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (stuid VARCHAR, age VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.age > 18","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (stuid VARCHAR, age VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:How many members of ""Bootup Baltimore"" are older than 18?","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.age > 18" "How many members of club ""Bootup Baltimore"" are younger than 18?","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (stuid VARCHAR, age VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.age < 18","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (stuid VARCHAR, age VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:How many members of club ""Bootup Baltimore"" are younger than 18?","SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.age < 18" "Find the names of all the clubs that have at least a member from the city with city code ""BAL"".","CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR); CREATE TABLE student (stuid VARCHAR, city_code VARCHAR)","SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = ""BAL""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR); CREATE TABLE student (stuid VARCHAR, city_code VARCHAR) ### question:Find the names of all the clubs that have at least a member from the city with city code ""BAL"".","SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = ""BAL""" "Find the names of the clubs that have at least a member from the city with city code ""HOU"".","CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR); CREATE TABLE student (stuid VARCHAR, city_code VARCHAR)","SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = ""HOU""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR); CREATE TABLE student (stuid VARCHAR, city_code VARCHAR) ### question:Find the names of the clubs that have at least a member from the city with city code ""HOU"".","SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = ""HOU""" "How many clubs does the student named ""Eric Tai"" belong to?","CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR)","SELECT COUNT(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Eric"" AND t3.lname = ""Tai""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR) ### question:How many clubs does the student named ""Eric Tai"" belong to?","SELECT COUNT(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Eric"" AND t3.lname = ""Tai""" "List the clubs having ""Davis Steven"" as a member.","CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR)","SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Davis"" AND t3.lname = ""Steven""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR) ### question:List the clubs having ""Davis Steven"" as a member.","SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Davis"" AND t3.lname = ""Steven""" "List the clubs that have at least a member with advisor ""1121"".","CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR); CREATE TABLE student (stuid VARCHAR, advisor VARCHAR)",SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR); CREATE TABLE club (clubname VARCHAR, clubid VARCHAR); CREATE TABLE student (stuid VARCHAR, advisor VARCHAR) ### question:List the clubs that have at least a member with advisor ""1121"".",SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121 "What is the average age of the members of the club ""Bootup Baltimore""?","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:What is the average age of the members of the club ""Bootup Baltimore""?","SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore""" "Find the average age of members of the club ""Hopkins Student Enterprises"".","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:Find the average age of members of the club ""Hopkins Student Enterprises"".","SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises""" "Retrieve the average age of members of the club ""Tennis Club"".","CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)","SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Tennis Club""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE club (clubid VARCHAR, clubname VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR) ### question:Retrieve the average age of members of the club ""Tennis Club"".","SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Tennis Club""" What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'?,"CREATE TABLE grants (grant_amount VARCHAR, grant_end_date INTEGER); CREATE TABLE Grants (grant_amount VARCHAR, grant_id VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, sent_date INTEGER)",SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE grants (grant_amount VARCHAR, grant_end_date INTEGER); CREATE TABLE Grants (grant_amount VARCHAR, grant_id VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, sent_date INTEGER) ### question:What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'?",SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16' List the project details of the project both producing patent and paper as outcomes.,"CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)",SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) ### question:List the project details of the project both producing patent and paper as outcomes.",SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent' What is the total grant amount of the organisations described as research?,"CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (organisation_id VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR)",SELECT SUM(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (organisation_id VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR) ### question:What is the total grant amount of the organisations described as research?",SELECT SUM(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research' List from which date and to which date these staff work: project staff of the project which hires the most staffs,"CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, project_id VARCHAR, role_code VARCHAR)","SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, project_id VARCHAR, role_code VARCHAR) ### question:List from which date and to which date these staff work: project staff of the project which hires the most staffs","SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'" Find the organisation ids and details of the organisations which are involved in,"CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_details VARCHAR)","SELECT T2.organisation_id, T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING SUM(T1.grant_amount) > 6000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_details VARCHAR) ### question:Find the organisation ids and details of the organisations which are involved in","SELECT T2.organisation_id, T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING SUM(T1.grant_amount) > 6000" What is the organisation type and id of the organisation which has the most number of research staff?,"CREATE TABLE Research_Staff (employer_organisation_id VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR, organisation_id VARCHAR)","SELECT T1.organisation_type, T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Research_Staff (employer_organisation_id VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR, organisation_id VARCHAR) ### question:What is the organisation type and id of the organisation which has the most number of research staff?","SELECT T1.organisation_type, T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1" Which organisation type hires most research staff?,"CREATE TABLE Research_Staff (employer_organisation_id VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR, organisation_id VARCHAR)",SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Research_Staff (employer_organisation_id VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR, organisation_id VARCHAR) ### question:Which organisation type hires most research staff?",SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) DESC LIMIT 1 Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described,"CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, organisation_id VARCHAR, grant_amount VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR); CREATE TABLE documents (sent_date VARCHAR, grant_id VARCHAR)",SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, organisation_id VARCHAR, grant_amount VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR); CREATE TABLE documents (sent_date VARCHAR, grant_id VARCHAR) ### question:Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described",SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research' What are the response received dates for the documents described as 'Regular' or granted with more than 100?,"CREATE TABLE Documents (response_received_date VARCHAR, document_type_code VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, grant_amount VARCHAR)",SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (response_received_date VARCHAR, document_type_code VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, grant_amount VARCHAR) ### question:What are the response received dates for the documents described as 'Regular' or granted with more than 100?",SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100 List the project details of the projects which did not hire any staff for a researcher role.,"CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR); CREATE TABLE Project_Staff (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR)",SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR); CREATE TABLE Project_Staff (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR) ### question:List the project details of the projects which did not hire any staff for a researcher role.",SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher') "What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?","CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Tasks (task_details VARCHAR, task_id VARCHAR, project_id VARCHAR)","SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Tasks (task_details VARCHAR, task_id VARCHAR, project_id VARCHAR) ### question:What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?","SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2" "When do all the researcher role staff start to work, and when do they stop working?","CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, role_code VARCHAR)","SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, role_code VARCHAR) ### question:When do all the researcher role staff start to work, and when do they stop working?","SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'" How many kinds of roles are there for the staff?,CREATE TABLE Project_Staff (role_code VARCHAR),SELECT COUNT(DISTINCT role_code) FROM Project_Staff,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (role_code VARCHAR) ### question:How many kinds of roles are there for the staff?",SELECT COUNT(DISTINCT role_code) FROM Project_Staff What is the total amount of grants given by each organisations? Also list the organisation id.,"CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER)","SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER) ### question:What is the total amount of grants given by each organisations? Also list the organisation id.","SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id" List the project details of the projects with the research outcome described with the substring 'Published'.,"CREATE TABLE Research_outcomes (outcome_code VARCHAR, outcome_description VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)",SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Research_outcomes (outcome_code VARCHAR, outcome_description VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) ### question:List the project details of the projects with the research outcome described with the substring 'Published'.",SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%' How many staff does each project has? List the project id and the number in an ascending order.,CREATE TABLE Project_Staff (project_id VARCHAR); CREATE TABLE Projects (project_id VARCHAR),"SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (project_id VARCHAR); CREATE TABLE Projects (project_id VARCHAR) ### question:How many staff does each project has? List the project id and the number in an ascending order.","SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*)" What is the complete description of the researcher role.,"CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR)",SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR) ### question:What is the complete description of the researcher role.",SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher' When did the first staff for the projects started working?,CREATE TABLE Project_Staff (date_from VARCHAR),SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (date_from VARCHAR) ### question:When did the first staff for the projects started working?",SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1 Which project made the most number of outcomes? List the project details and the project id.,"CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)","SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) ### question:Which project made the most number of outcomes? List the project details and the project id.","SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1" Which projects have no outcome? List the project details.,"CREATE TABLE Project_outcomes (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)",SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_outcomes (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) ### question:Which projects have no outcome? List the project details.",SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes) "Which organisation hired the most number of research staff? List the organisation id, type and detail.","CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE Research_Staff (employer_organisation_id VARCHAR)","SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE Research_Staff (employer_organisation_id VARCHAR) ### question:Which organisation hired the most number of research staff? List the organisation id, type and detail.","SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1" Show the role description and the id of the project staff involved in most number of project outcomes?,"CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Project_Staff (staff_id VARCHAR, role_code VARCHAR, project_id VARCHAR); CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR)","SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Project_Staff (staff_id VARCHAR, role_code VARCHAR, project_id VARCHAR); CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR) ### question:Show the role description and the id of the project staff involved in most number of project outcomes?","SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1" Which document type is described with the prefix 'Initial'?,"CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR)",SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR) ### question:Which document type is described with the prefix 'Initial'?",SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%' "For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.","CREATE TABLE Grants (grant_start_date VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, document_type_code VARCHAR)",SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Grants (grant_start_date VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, document_type_code VARCHAR) ### question:For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.",SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application' How many documents can one grant have at most? List the grant id and number.,CREATE TABLE Documents (grant_id VARCHAR),"SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (grant_id VARCHAR) ### question:How many documents can one grant have at most? List the grant id and number.","SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1" Find the organisation type description of the organisation detailed as 'quo'.,"CREATE TABLE Organisations (organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE organisation_Types (organisation_type_description VARCHAR, organisation_type VARCHAR)",SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Organisations (organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE organisation_Types (organisation_type_description VARCHAR, organisation_type VARCHAR) ### question:Find the organisation type description of the organisation detailed as 'quo'.",SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo' What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.,"CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR)",SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR) ### question:What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.",SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details How many Patent outcomes are generated from all the projects?,CREATE TABLE Project_outcomes (outcome_code VARCHAR),SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_outcomes (outcome_code VARCHAR) ### question:How many Patent outcomes are generated from all the projects?",SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent' How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?,"CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR)",SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR) ### question:How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?",SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54' What is the last date of the staff leaving the projects?,CREATE TABLE Project_Staff (date_to VARCHAR),SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (date_to VARCHAR) ### question:What is the last date of the staff leaving the projects?",SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1 What are the result description of the project whose detail is 'sint'?,"CREATE TABLE Project_outcomes (outcome_code VARCHAR, project_id VARCHAR); CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR)",SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_outcomes (outcome_code VARCHAR, project_id VARCHAR); CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) ### question:What are the result description of the project whose detail is 'sint'?",SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint' "List the organisation id with the maximum outcome count, and the count.","CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (organisation_id VARCHAR, project_id VARCHAR)","SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (organisation_id VARCHAR, project_id VARCHAR) ### question:List the organisation id with the maximum outcome count, and the count.","SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1" List the project details of the projects launched by the organisation,"CREATE TABLE Projects (project_details VARCHAR, organisation_id VARCHAR)",SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (project_details VARCHAR, organisation_id VARCHAR) ### question:List the project details of the projects launched by the organisation",SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1) "List the research staff details, and order in ascending order.",CREATE TABLE Research_Staff (staff_details VARCHAR),SELECT staff_details FROM Research_Staff ORDER BY staff_details,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Research_Staff (staff_details VARCHAR) ### question:List the research staff details, and order in ascending order.",SELECT staff_details FROM Research_Staff ORDER BY staff_details How many tasks are there in total?,CREATE TABLE Tasks (Id VARCHAR),SELECT COUNT(*) FROM Tasks,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Tasks (Id VARCHAR) ### question:How many tasks are there in total?",SELECT COUNT(*) FROM Tasks How many tasks does each project have? List the task count and the project detail.,"CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Tasks (project_id VARCHAR)","SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Tasks (project_id VARCHAR) ### question:How many tasks does each project have? List the task count and the project detail.","SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id" What are the staff roles of the staff who,"CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR, date_to VARCHAR)",SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR, date_to VARCHAR) ### question:What are the staff roles of the staff who",SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18' What are the descriptions of all the project outcomes?,"CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Project_outcomes (outcome_code VARCHAR)",SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Project_outcomes (outcome_code VARCHAR) ### question:What are the descriptions of all the project outcomes?",SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code Which role is most common for the staff?,CREATE TABLE Project_Staff (role_code VARCHAR),SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Project_Staff (role_code VARCHAR) ### question:Which role is most common for the staff?",SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 How many friends does Dan have?,"CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR)",SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR) ### question:How many friends does Dan have?",SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan' How many females does this network has?,CREATE TABLE Person (gender VARCHAR),SELECT COUNT(*) FROM Person WHERE gender = 'female',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (gender VARCHAR) ### question:How many females does this network has?",SELECT COUNT(*) FROM Person WHERE gender = 'female' What is the average age for all person?,CREATE TABLE Person (age INTEGER),SELECT AVG(age) FROM Person,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (age INTEGER) ### question:What is the average age for all person?",SELECT AVG(age) FROM Person How many different cities are they from?,CREATE TABLE Person (city VARCHAR),SELECT COUNT(DISTINCT city) FROM Person,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (city VARCHAR) ### question:How many different cities are they from?",SELECT COUNT(DISTINCT city) FROM Person How many type of jobs do they have?,CREATE TABLE Person (job VARCHAR),SELECT COUNT(DISTINCT job) FROM Person,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (job VARCHAR) ### question:How many type of jobs do they have?",SELECT COUNT(DISTINCT job) FROM Person Who is the oldest person?,"CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, age INTEGER)",SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, age INTEGER) ### question:Who is the oldest person?",SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person) Who is the oldest person whose job is student?,"CREATE TABLE person (name VARCHAR, job VARCHAR, age INTEGER); CREATE TABLE Person (name VARCHAR, job VARCHAR, age INTEGER)",SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE person (name VARCHAR, job VARCHAR, age INTEGER); CREATE TABLE Person (name VARCHAR, job VARCHAR, age INTEGER) ### question:Who is the oldest person whose job is student?",SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student') Who is the youngest male?,"CREATE TABLE Person (name VARCHAR, gender VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, gender VARCHAR, age INTEGER)",SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, gender VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, gender VARCHAR, age INTEGER) ### question:Who is the youngest male?",SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male') How old is the doctor named Zach?,"CREATE TABLE Person (age VARCHAR, job VARCHAR, name VARCHAR)",SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (age VARCHAR, job VARCHAR, name VARCHAR) ### question:How old is the doctor named Zach?",SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach' Who is the person whose age is below 30?,"CREATE TABLE Person (name VARCHAR, age INTEGER)",SELECT name FROM Person WHERE age < 30,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age INTEGER) ### question:Who is the person whose age is below 30?",SELECT name FROM Person WHERE age < 30 How many people whose age is greater 30 and job is engineer?,"CREATE TABLE Person (age VARCHAR, job VARCHAR)",SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (age VARCHAR, job VARCHAR) ### question:How many people whose age is greater 30 and job is engineer?",SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer' What is the average age for each gender?,"CREATE TABLE Person (gender VARCHAR, age INTEGER)","SELECT AVG(age), gender FROM Person GROUP BY gender","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (gender VARCHAR, age INTEGER) ### question:What is the average age for each gender?","SELECT AVG(age), gender FROM Person GROUP BY gender" What is average age for different job title?,"CREATE TABLE Person (job VARCHAR, age INTEGER)","SELECT AVG(age), job FROM Person GROUP BY job","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (job VARCHAR, age INTEGER) ### question:What is average age for different job title?","SELECT AVG(age), job FROM Person GROUP BY job" What is average age of male for different job title?,"CREATE TABLE Person (job VARCHAR, age INTEGER, gender VARCHAR)","SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (job VARCHAR, age INTEGER, gender VARCHAR) ### question:What is average age of male for different job title?","SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job" What is minimum age for different job title?,"CREATE TABLE Person (job VARCHAR, age INTEGER)","SELECT MIN(age), job FROM Person GROUP BY job","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (job VARCHAR, age INTEGER) ### question:What is minimum age for different job title?","SELECT MIN(age), job FROM Person GROUP BY job" Find the number of people who is under 40 for each gender.,"CREATE TABLE Person (gender VARCHAR, age INTEGER)","SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (gender VARCHAR, age INTEGER) ### question:Find the number of people who is under 40 for each gender.","SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender" Find the name of people whose age is greater than any engineer sorted by their age.,"CREATE TABLE Person (name VARCHAR, age INTEGER, job VARCHAR); CREATE TABLE person (name VARCHAR, age INTEGER, job VARCHAR)",SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age INTEGER, job VARCHAR); CREATE TABLE person (name VARCHAR, age INTEGER, job VARCHAR) ### question:Find the name of people whose age is greater than any engineer sorted by their age.",SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age Find the number of people whose age is greater than all engineers.,"CREATE TABLE Person (age INTEGER, job VARCHAR); CREATE TABLE person (age INTEGER, job VARCHAR)",SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (age INTEGER, job VARCHAR); CREATE TABLE person (age INTEGER, job VARCHAR) ### question:Find the number of people whose age is greater than all engineers.",SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer') "list the name, job title of all people ordered by their names.","CREATE TABLE Person (name VARCHAR, job VARCHAR)","SELECT name, job FROM Person ORDER BY name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, job VARCHAR) ### question:list the name, job title of all people ordered by their names.","SELECT name, job FROM Person ORDER BY name" Find the names of all person sorted in the descending order using age.,"CREATE TABLE Person (name VARCHAR, age VARCHAR)",SELECT name FROM Person ORDER BY age DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age VARCHAR) ### question:Find the names of all person sorted in the descending order using age.",SELECT name FROM Person ORDER BY age DESC Find the name and age of all males in order of their age.,"CREATE TABLE Person (name VARCHAR, gender VARCHAR, age VARCHAR)",SELECT name FROM Person WHERE gender = 'male' ORDER BY age,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, gender VARCHAR, age VARCHAR) ### question:Find the name and age of all males in order of their age.",SELECT name FROM Person WHERE gender = 'male' ORDER BY age Find the name and age of the person who is a friend of both Dan and Alice.,"CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)","SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) ### question:Find the name and age of the person who is a friend of both Dan and Alice.","SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'" Find the name and age of the person who is a friend of Dan or Alice.,"CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)","SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) ### question:Find the name and age of the person who is a friend of Dan or Alice.","SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'" Find the name of the person who has friends with age above 40 and under age 30?,"CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) ### question:Find the name of the person who has friends with age above 40 and under age 30?",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) Find the name of the person who has friends with age above 40 but not under age 30?,"CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) ### question:Find the name of the person who has friends with age above 40 but not under age 30?",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) Find the name of the person who has no student friends.,"CREATE TABLE Person (name VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE person (name VARCHAR)",SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE person (name VARCHAR) ### question:Find the name of the person who has no student friends.",SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student' Find the person who has exactly one friend.,CREATE TABLE PersonFriend (name VARCHAR),SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR) ### question:Find the person who has exactly one friend.",SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1 Who are the friends of Bob?,"CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR)",SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR) ### question:Who are the friends of Bob?",SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob' Find the name of persons who are friends with Bob.,"CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) ### question:Find the name of persons who are friends with Bob.",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob' Find the names of females who are friends with Zach,"CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR)",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) ### question:Find the names of females who are friends with Zach",SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female' Find the female friends of Alice.,"CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR)",SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) ### question:Find the female friends of Alice.",SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female' Find the male friend of Alice whose job is a doctor?,"CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, job VARCHAR, gender VARCHAR)",SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, job VARCHAR, gender VARCHAR) ### question:Find the male friend of Alice whose job is a doctor?",SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor' Who has a friend that is from new york city?,"CREATE TABLE Person (name VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)",SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Person (name VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) ### question:Who has a friend that is from new york city?",SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city' Who has friends that are younger than the average age?,"CREATE TABLE person (age INTEGER); CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)",SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE person (age INTEGER); CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) ### question:Who has friends that are younger than the average age?",SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person) Who has friends that are older than the average age? Print their friends and their ages as well,"CREATE TABLE person (age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR)","SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE person (age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR) ### question:Who has friends that are older than the average age? Print their friends and their ages as well","SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person)" Who is the friend of Zach with longest year relationship?,"CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, YEAR INTEGER)",SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, YEAR INTEGER) ### question:Who is the friend of Zach with longest year relationship?",SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach') What is the age of the friend of Zach with longest year relationship?,"CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, year VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, name VARCHAR); CREATE TABLE Person (age VARCHAR, name VARCHAR)",SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, year VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, name VARCHAR); CREATE TABLE Person (age VARCHAR, name VARCHAR) ### question:What is the age of the friend of Zach with longest year relationship?",SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach') Find the name of persons who are friends with Alice for the shortest years.,"CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, YEAR INTEGER)",SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, YEAR INTEGER) ### question:Find the name of persons who are friends with Alice for the shortest years.",SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice') "Find the name, age, and job title of persons who are friends with Alice for the longest years.","CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, year VARCHAR); CREATE TABLE Person (name VARCHAR, age VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, friend VARCHAR)","SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, year VARCHAR); CREATE TABLE Person (name VARCHAR, age VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, friend VARCHAR) ### question:Find the name, age, and job title of persons who are friends with Alice for the longest years.","SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice')" Who is the person that has no friend?,CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE person (name VARCHAR),SELECT name FROM person EXCEPT SELECT name FROM PersonFriend,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE person (name VARCHAR) ### question:Who is the person that has no friend?",SELECT name FROM person EXCEPT SELECT name FROM PersonFriend Which person whose friends have the oldest average age?,"CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR)","SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR) ### question:Which person whose friends have the oldest average age?","SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1" What is the total number of people who has no friend living in the city of Austin.,"CREATE TABLE person (name VARCHAR, friend VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, city VARCHAR)",SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE person (name VARCHAR, friend VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, city VARCHAR) ### question:What is the total number of people who has no friend living in the city of Austin.",SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin') Find Alice's friends of friends.,"CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)",SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) ### question:Find Alice's friends of friends.",SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice' How many members are there?,CREATE TABLE member (Id VARCHAR),SELECT COUNT(*) FROM member,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Id VARCHAR) ### question:How many members are there?",SELECT COUNT(*) FROM member List the names of members in ascending alphabetical order.,CREATE TABLE member (Name VARCHAR),SELECT Name FROM member ORDER BY Name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR) ### question:List the names of members in ascending alphabetical order.",SELECT Name FROM member ORDER BY Name What are the names and countries of members?,"CREATE TABLE member (Name VARCHAR, Country VARCHAR)","SELECT Name, Country FROM member","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR, Country VARCHAR) ### question:What are the names and countries of members?","SELECT Name, Country FROM member" "Show the names of members whose country is ""United States"" or ""Canada"".","CREATE TABLE member (Name VARCHAR, Country VARCHAR)","SELECT Name FROM member WHERE Country = ""United States"" OR Country = ""Canada""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR, Country VARCHAR) ### question:Show the names of members whose country is ""United States"" or ""Canada"".","SELECT Name FROM member WHERE Country = ""United States"" OR Country = ""Canada""" Show the different countries and the number of members from each.,CREATE TABLE member (Country VARCHAR),"SELECT Country, COUNT(*) FROM member GROUP BY Country","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Country VARCHAR) ### question:Show the different countries and the number of members from each.","SELECT Country, COUNT(*) FROM member GROUP BY Country" Show the most common country across members.,CREATE TABLE member (Country VARCHAR),SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Country VARCHAR) ### question:Show the most common country across members.",SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 Which countries have more than two members?,CREATE TABLE member (Country VARCHAR),SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Country VARCHAR) ### question:Which countries have more than two members?",SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2 Show the leader names and locations of colleges.,"CREATE TABLE college (Leader_Name VARCHAR, College_Location VARCHAR)","SELECT Leader_Name, College_Location FROM college","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (Leader_Name VARCHAR, College_Location VARCHAR) ### question:Show the leader names and locations of colleges.","SELECT Leader_Name, College_Location FROM college" Show the names of members and names of colleges they go to.,"CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (Name VARCHAR, College_ID VARCHAR)","SELECT T2.Name, T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (Name VARCHAR, College_ID VARCHAR) ### question:Show the names of members and names of colleges they go to.","SELECT T2.Name, T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID" Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.,"CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (College_Location VARCHAR, College_ID VARCHAR)","SELECT T2.Name, T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (College_Location VARCHAR, College_ID VARCHAR) ### question:Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.","SELECT T2.Name, T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name" "Show the distinct leader names of colleges associated with members from country ""Canada"".","CREATE TABLE college (Leader_Name VARCHAR, College_ID VARCHAR); CREATE TABLE member (College_ID VARCHAR, Country VARCHAR)","SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = ""Canada""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (Leader_Name VARCHAR, College_ID VARCHAR); CREATE TABLE member (College_ID VARCHAR, Country VARCHAR) ### question:Show the distinct leader names of colleges associated with members from country ""Canada"".","SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = ""Canada""" Show the names of members and the decoration themes they have.,"CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Decoration_Theme VARCHAR, Member_ID VARCHAR)","SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Decoration_Theme VARCHAR, Member_ID VARCHAR) ### question:Show the names of members and the decoration themes they have.","SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID" Show the names of members that have a rank in round higher than 3.,"CREATE TABLE round (Member_ID VARCHAR, Rank_in_Round INTEGER); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR)",SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE round (Member_ID VARCHAR, Rank_in_Round INTEGER); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR) ### question:Show the names of members that have a rank in round higher than 3.",SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3 Show the names of members in ascending order of their rank in rounds.,"CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Member_ID VARCHAR)",SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Member_ID VARCHAR) ### question:Show the names of members in ascending order of their rank in rounds.",SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round List the names of members who did not participate in any round.,"CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Name VARCHAR, Member_ID VARCHAR)",SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Name VARCHAR, Member_ID VARCHAR) ### question:List the names of members who did not participate in any round.",SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round) "Find the name and access counts of all documents, in alphabetic order of the document name.","CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR)","SELECT document_name, access_count FROM documents ORDER BY document_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR) ### question:Find the name and access counts of all documents, in alphabetic order of the document name.","SELECT document_name, access_count FROM documents ORDER BY document_name" "Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?","CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR)","SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR) ### question:Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?","SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1" Find the types of documents with more than 4 documents.,CREATE TABLE documents (document_type_code VARCHAR),SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_type_code VARCHAR) ### question:Find the types of documents with more than 4 documents.",SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4 Find the total access count of all documents in the most popular document type.,"CREATE TABLE documents (access_count INTEGER, document_type_code VARCHAR)",SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (access_count INTEGER, document_type_code VARCHAR) ### question:Find the total access count of all documents in the most popular document type.",SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 What is the average access count of documents?,CREATE TABLE documents (access_count INTEGER),SELECT AVG(access_count) FROM documents,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (access_count INTEGER) ### question:What is the average access count of documents?",SELECT AVG(access_count) FROM documents What is the structure of the document with the least number of accesses?,"CREATE TABLE document_structures (document_structure_description VARCHAR, document_structure_code VARCHAR); CREATE TABLE documents (document_structure_code VARCHAR)",SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE document_structures (document_structure_description VARCHAR, document_structure_code VARCHAR); CREATE TABLE documents (document_structure_code VARCHAR) ### question:What is the structure of the document with the least number of accesses?",SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1 "What is the type of the document named ""David CV""?","CREATE TABLE documents (document_type_code VARCHAR, document_name VARCHAR)","SELECT document_type_code FROM documents WHERE document_name = ""David CV""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_type_code VARCHAR, document_name VARCHAR) ### question:What is the type of the document named ""David CV""?","SELECT document_type_code FROM documents WHERE document_name = ""David CV""" Find the list of documents that are both in the most three popular type and have the most three popular structure.,"CREATE TABLE documents (document_name VARCHAR, document_type_code VARCHAR, document_structure_code VARCHAR)",SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_name VARCHAR, document_type_code VARCHAR, document_structure_code VARCHAR) ### question:Find the list of documents that are both in the most three popular type and have the most three popular structure.",SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3 What document types do have more than 10000 total access number.,"CREATE TABLE documents (document_type_code VARCHAR, access_count INTEGER)",SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_type_code VARCHAR, access_count INTEGER) ### question:What document types do have more than 10000 total access number.",SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000 "What are all the section titles of the document named ""David CV""?","CREATE TABLE documents (document_code VARCHAR, document_name VARCHAR); CREATE TABLE document_sections (section_title VARCHAR, document_code VARCHAR)","SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = ""David CV""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_code VARCHAR, document_name VARCHAR); CREATE TABLE document_sections (section_title VARCHAR, document_code VARCHAR) ### question:What are all the section titles of the document named ""David CV""?","SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = ""David CV""" Find all the name of documents without any sections.,"CREATE TABLE document_sections (document_name VARCHAR, document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR)",SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE document_sections (document_name VARCHAR, document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR) ### question:Find all the name of documents without any sections.",SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections) List all the username and passwords of users with the most popular role.,"CREATE TABLE users (user_name VARCHAR, password VARCHAR, role_code VARCHAR)","SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE users (user_name VARCHAR, password VARCHAR, role_code VARCHAR) ### question:List all the username and passwords of users with the most popular role.","SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1" "Find the average access counts of documents with functional area ""Acknowledgement"".","CREATE TABLE document_functional_areas (document_code VARCHAR, functional_area_code VARCHAR); CREATE TABLE documents (access_count INTEGER, document_code VARCHAR); CREATE TABLE functional_areas (functional_area_code VARCHAR, functional_area_description VARCHAR)","SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = ""Acknowledgement""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE document_functional_areas (document_code VARCHAR, functional_area_code VARCHAR); CREATE TABLE documents (access_count INTEGER, document_code VARCHAR); CREATE TABLE functional_areas (functional_area_code VARCHAR, functional_area_description VARCHAR) ### question:Find the average access counts of documents with functional area ""Acknowledgement"".","SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = ""Acknowledgement""" Find names of the document without any images.,"CREATE TABLE document_sections_images (section_id VARCHAR); CREATE TABLE documents (document_name VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR); CREATE TABLE document_sections (document_code VARCHAR, section_id VARCHAR)",SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE document_sections_images (section_id VARCHAR); CREATE TABLE documents (document_name VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR); CREATE TABLE document_sections (document_code VARCHAR, section_id VARCHAR) ### question:Find names of the document without any images.",SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id What is the name of the document with the most number of sections?,"CREATE TABLE document_sections (document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR)",SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE document_sections (document_code VARCHAR); CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR) ### question:What is the name of the document with the most number of sections?",SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY COUNT(*) DESC LIMIT 1 "List all the document names which contains ""CV"".",CREATE TABLE documents (document_name VARCHAR),"SELECT document_name FROM documents WHERE document_name LIKE ""%CV%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_name VARCHAR) ### question:List all the document names which contains ""CV"".","SELECT document_name FROM documents WHERE document_name LIKE ""%CV%""" How many users are logged in?,CREATE TABLE users (user_login VARCHAR),SELECT COUNT(*) FROM users WHERE user_login = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE users (user_login VARCHAR) ### question:How many users are logged in?",SELECT COUNT(*) FROM users WHERE user_login = 1 Find the description of the most popular role among the users that have logged in.,"CREATE TABLE users (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR); CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR)",SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE users (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR); CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR, user_login VARCHAR) ### question:Find the description of the most popular role among the users that have logged in.",SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1) Find the average access count of documents with the least popular structure.,"CREATE TABLE documents (access_count INTEGER, document_structure_code VARCHAR)",SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (access_count INTEGER, document_structure_code VARCHAR) ### question:Find the average access count of documents with the least popular structure.",SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) LIMIT 1 List all the image name and URLs in the order of their names.,"CREATE TABLE images (image_name VARCHAR, image_url VARCHAR)","SELECT image_name, image_url FROM images ORDER BY image_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE images (image_name VARCHAR, image_url VARCHAR) ### question:List all the image name and URLs in the order of their names.","SELECT image_name, image_url FROM images ORDER BY image_name" Find the number of users in each role.,CREATE TABLE users (role_code VARCHAR),"SELECT COUNT(*), role_code FROM users GROUP BY role_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE users (role_code VARCHAR) ### question:Find the number of users in each role.","SELECT COUNT(*), role_code FROM users GROUP BY role_code" What document types have more than 2 corresponding documents?,CREATE TABLE documents (document_type_code VARCHAR),SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE documents (document_type_code VARCHAR) ### question:What document types have more than 2 corresponding documents?",SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2 How many companies are there?,CREATE TABLE Companies (Id VARCHAR),SELECT COUNT(*) FROM Companies,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Id VARCHAR) ### question:How many companies are there?",SELECT COUNT(*) FROM Companies List the names of companies in descending order of market value.,"CREATE TABLE Companies (name VARCHAR, Market_Value_billion VARCHAR)",SELECT name FROM Companies ORDER BY Market_Value_billion DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (name VARCHAR, Market_Value_billion VARCHAR) ### question:List the names of companies in descending order of market value.",SELECT name FROM Companies ORDER BY Market_Value_billion DESC "What are the names of companies whose headquarters are not ""USA""?","CREATE TABLE Companies (name VARCHAR, Headquarters VARCHAR)",SELECT name FROM Companies WHERE Headquarters <> 'USA',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (name VARCHAR, Headquarters VARCHAR) ### question:What are the names of companies whose headquarters are not ""USA""?",SELECT name FROM Companies WHERE Headquarters <> 'USA' "What are the name and assets of each company, sorted in ascending order of company name?","CREATE TABLE Companies (name VARCHAR, Assets_billion VARCHAR)","SELECT name, Assets_billion FROM Companies ORDER BY name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (name VARCHAR, Assets_billion VARCHAR) ### question:What are the name and assets of each company, sorted in ascending order of company name?","SELECT name, Assets_billion FROM Companies ORDER BY name" What are the average profits of companies?,CREATE TABLE Companies (Profits_billion INTEGER),SELECT AVG(Profits_billion) FROM Companies,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Profits_billion INTEGER) ### question:What are the average profits of companies?",SELECT AVG(Profits_billion) FROM Companies "What are the maximum and minimum sales of the companies whose industries are not ""Banking"".","CREATE TABLE Companies (Sales_billion INTEGER, Industry VARCHAR)","SELECT MAX(Sales_billion), MIN(Sales_billion) FROM Companies WHERE Industry <> ""Banking""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Sales_billion INTEGER, Industry VARCHAR) ### question:What are the maximum and minimum sales of the companies whose industries are not ""Banking"".","SELECT MAX(Sales_billion), MIN(Sales_billion) FROM Companies WHERE Industry <> ""Banking""" How many different industries are the companies in?,CREATE TABLE Companies (Industry VARCHAR),SELECT COUNT(DISTINCT Industry) FROM Companies,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Industry VARCHAR) ### question:How many different industries are the companies in?",SELECT COUNT(DISTINCT Industry) FROM Companies List the names of buildings in descending order of building height.,"CREATE TABLE buildings (name VARCHAR, Height VARCHAR)",SELECT name FROM buildings ORDER BY Height DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE buildings (name VARCHAR, Height VARCHAR) ### question:List the names of buildings in descending order of building height.",SELECT name FROM buildings ORDER BY Height DESC Find the stories of the building with the largest height.,"CREATE TABLE buildings (Stories VARCHAR, Height VARCHAR)",SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE buildings (Stories VARCHAR, Height VARCHAR) ### question:Find the stories of the building with the largest height.",SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1 List the name of a building along with the name of a company whose office is in the building.,"CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR); CREATE TABLE Companies (name VARCHAR, id VARCHAR)","SELECT T3.name, T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR); CREATE TABLE Companies (name VARCHAR, id VARCHAR) ### question:List the name of a building along with the name of a company whose office is in the building.","SELECT T3.name, T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id" Show the names of the buildings that have more than one company offices.,"CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR)",SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR) ### question:Show the names of the buildings that have more than one company offices.",SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1 Show the name of the building that has the most company offices.,"CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR)",SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE buildings (name VARCHAR, id VARCHAR); CREATE TABLE Companies (id VARCHAR); CREATE TABLE Office_locations (building_id VARCHAR, company_id VARCHAR) ### question:Show the name of the building that has the most company offices.",SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1 "Please show the names of the buildings whose status is ""on-hold"", in ascending order of stories.","CREATE TABLE buildings (name VARCHAR, Status VARCHAR, Stories VARCHAR)","SELECT name FROM buildings WHERE Status = ""on-hold"" ORDER BY Stories","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE buildings (name VARCHAR, Status VARCHAR, Stories VARCHAR) ### question:Please show the names of the buildings whose status is ""on-hold"", in ascending order of stories.","SELECT name FROM buildings WHERE Status = ""on-hold"" ORDER BY Stories" Please show each industry and the corresponding number of companies in that industry.,CREATE TABLE Companies (Industry VARCHAR),"SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Industry VARCHAR) ### question:Please show each industry and the corresponding number of companies in that industry.","SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry" Please show the industries of companies in descending order of the number of companies.,CREATE TABLE Companies (Industry VARCHAR),SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Industry VARCHAR) ### question:Please show the industries of companies in descending order of the number of companies.",SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC List the industry shared by the most companies.,CREATE TABLE Companies (Industry VARCHAR),SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Industry VARCHAR) ### question:List the industry shared by the most companies.",SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1 List the names of buildings that have no company office.,"CREATE TABLE buildings (name VARCHAR, id VARCHAR, building_id VARCHAR); CREATE TABLE Office_locations (name VARCHAR, id VARCHAR, building_id VARCHAR)",SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE buildings (name VARCHAR, id VARCHAR, building_id VARCHAR); CREATE TABLE Office_locations (name VARCHAR, id VARCHAR, building_id VARCHAR) ### question:List the names of buildings that have no company office.",SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations) "Show the industries shared by companies whose headquarters are ""USA"" and companies whose headquarters are ""China"".","CREATE TABLE Companies (Industry VARCHAR, Headquarters VARCHAR)","SELECT Industry FROM Companies WHERE Headquarters = ""USA"" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = ""China""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Industry VARCHAR, Headquarters VARCHAR) ### question:Show the industries shared by companies whose headquarters are ""USA"" and companies whose headquarters are ""China"".","SELECT Industry FROM Companies WHERE Headquarters = ""USA"" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = ""China""" "Find the number of companies whose industry is ""Banking"" or ""Conglomerate"",",CREATE TABLE Companies (Industry VARCHAR),"SELECT COUNT(*) FROM Companies WHERE Industry = ""Banking"" OR Industry = ""Conglomerate""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Industry VARCHAR) ### question:Find the number of companies whose industry is ""Banking"" or ""Conglomerate"",","SELECT COUNT(*) FROM Companies WHERE Industry = ""Banking"" OR Industry = ""Conglomerate""" Show the headquarters shared by more than two companies.,CREATE TABLE Companies (Headquarters VARCHAR),SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Companies (Headquarters VARCHAR) ### question:Show the headquarters shared by more than two companies.",SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2 How many products are there?,CREATE TABLE Products (Id VARCHAR),SELECT COUNT(*) FROM Products,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Id VARCHAR) ### question:How many products are there?",SELECT COUNT(*) FROM Products List the name of products in ascending order of price.,"CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR)",SELECT Product_Name FROM Products ORDER BY Product_Price,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) ### question:List the name of products in ascending order of price.",SELECT Product_Name FROM Products ORDER BY Product_Price What are the names and type codes of products?,"CREATE TABLE Products (Product_Name VARCHAR, Product_Type_Code VARCHAR)","SELECT Product_Name, Product_Type_Code FROM Products","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_Type_Code VARCHAR) ### question:What are the names and type codes of products?","SELECT Product_Name, Product_Type_Code FROM Products" "Show the prices of the products named ""Dining"" or ""Trading Policy"".","CREATE TABLE Products (Product_Price VARCHAR, Product_Name VARCHAR)","SELECT Product_Price FROM Products WHERE Product_Name = ""Dining"" OR Product_Name = ""Trading Policy""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Price VARCHAR, Product_Name VARCHAR) ### question:Show the prices of the products named ""Dining"" or ""Trading Policy"".","SELECT Product_Price FROM Products WHERE Product_Name = ""Dining"" OR Product_Name = ""Trading Policy""" What is the average price for products?,CREATE TABLE Products (Product_Price INTEGER),SELECT AVG(Product_Price) FROM Products,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Price INTEGER) ### question:What is the average price for products?",SELECT AVG(Product_Price) FROM Products What is the name of the product with the highest price?,"CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR)",SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_Price VARCHAR) ### question:What is the name of the product with the highest price?",SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1 Show different type codes of products and the number of products with each type code.,CREATE TABLE Products (Product_Type_Code VARCHAR),"SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Type_Code VARCHAR) ### question:Show different type codes of products and the number of products with each type code.","SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code" Show the most common type code across products.,CREATE TABLE Products (Product_Type_Code VARCHAR),SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Type_Code VARCHAR) ### question:Show the most common type code across products.",SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 Show the product type codes that have at least two products.,CREATE TABLE Products (Product_Type_Code VARCHAR),SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Type_Code VARCHAR) ### question:Show the product type codes that have at least two products.",SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2 Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000.,"CREATE TABLE Products (Product_Type_Code VARCHAR, Product_Price INTEGER)",SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Type_Code VARCHAR, Product_Price INTEGER) ### question:Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000.",SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000 Show the names of products and the number of events they are in.,"CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR)","SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) ### question:Show the names of products and the number of events they are in.","SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name" "Show the names of products and the number of events they are in, sorted by the number of events in descending order.","CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR)","SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) ### question:Show the names of products and the number of events they are in, sorted by the number of events in descending order.","SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC" Show the names of products that are in at least two events.,"CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR)",SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) ### question:Show the names of products that are in at least two events.",SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 Show the names of products that are in at least two events in ascending alphabetical order of product name.,"CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR)",SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_ID VARCHAR) ### question:Show the names of products that are in at least two events in ascending alphabetical order of product name.",SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name List the names of products that are not in any event.,"CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_Name VARCHAR, Product_ID VARCHAR)",SELECT Product_Name FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_Name VARCHAR, Product_ID VARCHAR); CREATE TABLE Products_in_Events (Product_Name VARCHAR, Product_ID VARCHAR) ### question:List the names of products that are not in any event.",SELECT Product_Name FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) How many artworks are there?,CREATE TABLE artwork (Id VARCHAR),SELECT COUNT(*) FROM artwork,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artwork (Id VARCHAR) ### question:How many artworks are there?",SELECT COUNT(*) FROM artwork List the name of artworks in ascending alphabetical order.,CREATE TABLE artwork (Name VARCHAR),SELECT Name FROM artwork ORDER BY Name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artwork (Name VARCHAR) ### question:List the name of artworks in ascending alphabetical order.",SELECT Name FROM artwork ORDER BY Name "List the name of artworks whose type is not ""Program Talent Show"".","CREATE TABLE artwork (Name VARCHAR, TYPE VARCHAR)","SELECT Name FROM artwork WHERE TYPE <> ""Program Talent Show""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artwork (Name VARCHAR, TYPE VARCHAR) ### question:List the name of artworks whose type is not ""Program Talent Show"".","SELECT Name FROM artwork WHERE TYPE <> ""Program Talent Show""" What are the names and locations of festivals?,"CREATE TABLE festival_detail (Festival_Name VARCHAR, LOCATION VARCHAR)","SELECT Festival_Name, LOCATION FROM festival_detail","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (Festival_Name VARCHAR, LOCATION VARCHAR) ### question:What are the names and locations of festivals?","SELECT Festival_Name, LOCATION FROM festival_detail" "What are the names of the chairs of festivals, sorted in ascending order of the year held?","CREATE TABLE festival_detail (Chair_Name VARCHAR, YEAR VARCHAR)",SELECT Chair_Name FROM festival_detail ORDER BY YEAR,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (Chair_Name VARCHAR, YEAR VARCHAR) ### question:What are the names of the chairs of festivals, sorted in ascending order of the year held?",SELECT Chair_Name FROM festival_detail ORDER BY YEAR What is the location of the festival with the largest number of audience?,"CREATE TABLE festival_detail (LOCATION VARCHAR, Num_of_Audience VARCHAR)",SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (LOCATION VARCHAR, Num_of_Audience VARCHAR) ### question:What is the location of the festival with the largest number of audience?",SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1 What are the names of festivals held in year 2007?,"CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR)",SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) ### question:What are the names of festivals held in year 2007?",SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007 What is the average number of audience for festivals?,CREATE TABLE festival_detail (Num_of_Audience INTEGER),SELECT AVG(Num_of_Audience) FROM festival_detail,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (Num_of_Audience INTEGER) ### question:What is the average number of audience for festivals?",SELECT AVG(Num_of_Audience) FROM festival_detail Show the names of the three most recent festivals.,"CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR)",SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (Festival_Name VARCHAR, YEAR VARCHAR) ### question:Show the names of the three most recent festivals.",SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3 "For each nomination, show the name of the artwork and name of the festival where it is nominated.","CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR)","SELECT T2.Name, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR) ### question:For each nomination, show the name of the artwork and name of the festival where it is nominated.","SELECT T2.Name, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID" Show distinct types of artworks that are nominated in festivals in 2007.,"CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_ID VARCHAR, Year VARCHAR); CREATE TABLE artwork (Type VARCHAR, Artwork_ID VARCHAR)",SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_ID VARCHAR, Year VARCHAR); CREATE TABLE artwork (Type VARCHAR, Artwork_ID VARCHAR) ### question:Show distinct types of artworks that are nominated in festivals in 2007.",SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007 Show the names of artworks in ascending order of the year they are nominated in.,"CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_ID VARCHAR, Year VARCHAR)",SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artwork (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE festival_detail (Festival_ID VARCHAR, Year VARCHAR) ### question:Show the names of artworks in ascending order of the year they are nominated in.",SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year "Show the names of festivals that have nominated artworks of type ""Program Talent Show"".","CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR, Type VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR)","SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = ""Program Talent Show""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE nomination (Artwork_ID VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR, Type VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR) ### question:Show the names of festivals that have nominated artworks of type ""Program Talent Show"".","SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = ""Program Talent Show""" Show the ids and names of festivals that have at least two nominations for artworks.,"CREATE TABLE nomination (Festival_ID VARCHAR, Artwork_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR)","SELECT T1.Festival_ID, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE nomination (Festival_ID VARCHAR, Artwork_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR) ### question:Show the ids and names of festivals that have at least two nominations for artworks.","SELECT T1.Festival_ID, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2" "Show the id, name of each festival and the number of artworks it has nominated.","CREATE TABLE nomination (Festival_ID VARCHAR, Artwork_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR)","SELECT T1.Festival_ID, T3.Festival_Name, COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE nomination (Festival_ID VARCHAR, Artwork_ID VARCHAR); CREATE TABLE festival_detail (Festival_Name VARCHAR, Festival_ID VARCHAR); CREATE TABLE artwork (Artwork_ID VARCHAR) ### question:Show the id, name of each festival and the number of artworks it has nominated.","SELECT T1.Festival_ID, T3.Festival_Name, COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID" Please show different types of artworks with the corresponding number of artworks of each type.,CREATE TABLE artwork (TYPE VARCHAR),"SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artwork (TYPE VARCHAR) ### question:Please show different types of artworks with the corresponding number of artworks of each type.","SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE" List the most common type of artworks.,CREATE TABLE artwork (TYPE VARCHAR),SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artwork (TYPE VARCHAR) ### question:List the most common type of artworks.",SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 List the year in which there are more than one festivals.,CREATE TABLE festival_detail (YEAR VARCHAR),SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (YEAR VARCHAR) ### question:List the year in which there are more than one festivals.",SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1 List the name of artworks that are not nominated.,"CREATE TABLE nomination (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE Artwork (Name VARCHAR, Artwork_ID VARCHAR)",SELECT Name FROM Artwork WHERE NOT Artwork_ID IN (SELECT Artwork_ID FROM nomination),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE nomination (Name VARCHAR, Artwork_ID VARCHAR); CREATE TABLE Artwork (Name VARCHAR, Artwork_ID VARCHAR) ### question:List the name of artworks that are not nominated.",SELECT Name FROM Artwork WHERE NOT Artwork_ID IN (SELECT Artwork_ID FROM nomination) Show the number of audience in year 2008 or 2010.,"CREATE TABLE festival_detail (Num_of_Audience VARCHAR, YEAR VARCHAR)",SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (Num_of_Audience VARCHAR, YEAR VARCHAR) ### question:Show the number of audience in year 2008 or 2010.",SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010 What are the total number of the audiences who visited any of the festivals?,CREATE TABLE festival_detail (Num_of_Audience INTEGER),SELECT SUM(Num_of_Audience) FROM festival_detail,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (Num_of_Audience INTEGER) ### question:What are the total number of the audiences who visited any of the festivals?",SELECT SUM(Num_of_Audience) FROM festival_detail In which year are there festivals both inside the 'United States' and outside the 'United States'?,"CREATE TABLE festival_detail (YEAR VARCHAR, LOCATION VARCHAR)",SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION <> 'United States',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE festival_detail (YEAR VARCHAR, LOCATION VARCHAR) ### question:In which year are there festivals both inside the 'United States' and outside the 'United States'?",SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION <> 'United States' How many premises are there?,CREATE TABLE premises (Id VARCHAR),SELECT COUNT(*) FROM premises,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE premises (Id VARCHAR) ### question:How many premises are there?",SELECT COUNT(*) FROM premises What are all the distinct premise types?,CREATE TABLE premises (premises_type VARCHAR),SELECT DISTINCT premises_type FROM premises,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE premises (premises_type VARCHAR) ### question:What are all the distinct premise types?",SELECT DISTINCT premises_type FROM premises Find the types and details for all premises and order by the premise type.,"CREATE TABLE premises (premises_type VARCHAR, premise_details VARCHAR)","SELECT premises_type, premise_details FROM premises ORDER BY premises_type","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE premises (premises_type VARCHAR, premise_details VARCHAR) ### question:Find the types and details for all premises and order by the premise type.","SELECT premises_type, premise_details FROM premises ORDER BY premises_type" Show each premise type and the number of premises in that type.,CREATE TABLE premises (premises_type VARCHAR),"SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE premises (premises_type VARCHAR) ### question:Show each premise type and the number of premises in that type.","SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type" Show all distinct product categories along with the number of mailshots in each category.,CREATE TABLE mailshot_campaigns (product_category VARCHAR),"SELECT product_category, COUNT(*) FROM mailshot_campaigns GROUP BY product_category","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mailshot_campaigns (product_category VARCHAR) ### question:Show all distinct product categories along with the number of mailshots in each category.","SELECT product_category, COUNT(*) FROM mailshot_campaigns GROUP BY product_category" Show the name and phone of the customer without any mailshot.,"CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR)","SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM mailshot_customers)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR) ### question:Show the name and phone of the customer without any mailshot.","SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM mailshot_customers)" Show the name and phone for customers with a mailshot with outcome code 'No Response'.,"CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR)","SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR) ### question:Show the name and phone for customers with a mailshot with outcome code 'No Response'.","SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response'" Show the outcome code of mailshots along with the number of mailshots in each outcome code.,CREATE TABLE mailshot_customers (outcome_code VARCHAR),"SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mailshot_customers (outcome_code VARCHAR) ### question:Show the outcome code of mailshots along with the number of mailshots in each outcome code.","SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code" Show the names of customers who have at least 2 mailshots with outcome code 'Order'.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR)",SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR) ### question:Show the names of customers who have at least 2 mailshots with outcome code 'Order'.",SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING COUNT(*) >= 2 Show the names of customers who have the most mailshots.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR)",SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR) ### question:Show the names of customers who have the most mailshots.",SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome.,"CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR)","SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR, customer_id VARCHAR); CREATE TABLE mailshot_customers (customer_id VARCHAR, outcome_code VARCHAR) ### question:What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome.","SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response'" Show the premise type and address type code for all customer addresses.,"CREATE TABLE premises (premises_type VARCHAR, premise_id VARCHAR); CREATE TABLE customer_addresses (address_type_code VARCHAR, premise_id VARCHAR)","SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE premises (premises_type VARCHAR, premise_id VARCHAR); CREATE TABLE customer_addresses (address_type_code VARCHAR, premise_id VARCHAR) ### question:Show the premise type and address type code for all customer addresses.","SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id" What are the distinct address type codes for all customer addresses?,CREATE TABLE customer_addresses (address_type_code VARCHAR),SELECT DISTINCT address_type_code FROM customer_addresses,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_addresses (address_type_code VARCHAR) ### question:What are the distinct address type codes for all customer addresses?",SELECT DISTINCT address_type_code FROM customer_addresses Show the shipping charge and customer id for customer orders with order status Cancelled or Paid.,"CREATE TABLE customer_orders (order_shipping_charges VARCHAR, customer_id VARCHAR, order_status_code VARCHAR)","SELECT order_shipping_charges, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (order_shipping_charges VARCHAR, customer_id VARCHAR, order_status_code VARCHAR) ### question:Show the shipping charge and customer id for customer orders with order status Cancelled or Paid.","SELECT order_shipping_charges, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'" Show the names of customers having an order with shipping method FedEx and order status Paid.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) ### question:Show the names of customers having an order with shipping method FedEx and order status Paid.",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid' How many courses are there in total?,CREATE TABLE COURSE (Id VARCHAR),SELECT COUNT(*) FROM COURSE,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (Id VARCHAR) ### question:How many courses are there in total?",SELECT COUNT(*) FROM COURSE How many courses have more than 2 credits?,CREATE TABLE COURSE (Credits INTEGER),SELECT COUNT(*) FROM COURSE WHERE Credits > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (Credits INTEGER) ### question:How many courses have more than 2 credits?",SELECT COUNT(*) FROM COURSE WHERE Credits > 2 List all names of courses with 1 credit?,"CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR)",SELECT CName FROM COURSE WHERE Credits = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) ### question:List all names of courses with 1 credit?",SELECT CName FROM COURSE WHERE Credits = 1 Which courses are taught on days MTW?,"CREATE TABLE COURSE (CName VARCHAR, Days VARCHAR)","SELECT CName FROM COURSE WHERE Days = ""MTW""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (CName VARCHAR, Days VARCHAR) ### question:Which courses are taught on days MTW?","SELECT CName FROM COURSE WHERE Days = ""MTW""" "What is the number of departments in Division ""AS""?",CREATE TABLE DEPARTMENT (Division VARCHAR),"SELECT COUNT(*) FROM DEPARTMENT WHERE Division = ""AS""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE DEPARTMENT (Division VARCHAR) ### question:What is the number of departments in Division ""AS""?","SELECT COUNT(*) FROM DEPARTMENT WHERE Division = ""AS""" What are the phones of departments in Room 268?,"CREATE TABLE DEPARTMENT (DPhone VARCHAR, Room VARCHAR)",SELECT DPhone FROM DEPARTMENT WHERE Room = 268,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE DEPARTMENT (DPhone VARCHAR, Room VARCHAR) ### question:What are the phones of departments in Room 268?",SELECT DPhone FROM DEPARTMENT WHERE Room = 268 "Find the number of students that have at least one grade ""B"".","CREATE TABLE ENROLLED_IN (StuID VARCHAR, Grade VARCHAR)","SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = ""B""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ENROLLED_IN (StuID VARCHAR, Grade VARCHAR) ### question:Find the number of students that have at least one grade ""B"".","SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = ""B""" Find the max and min grade point for all letter grade.,CREATE TABLE GRADECONVERSION (gradepoint INTEGER),"SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE GRADECONVERSION (gradepoint INTEGER) ### question:Find the max and min grade point for all letter grade.","SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION" "Find the first names of students whose first names contain letter ""a"".",CREATE TABLE STUDENT (Fname VARCHAR),SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR) ### question:Find the first names of students whose first names contain letter ""a"".",SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%' Find the first names and last names of male (sex is M) faculties who live in building NEB.,"CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, sex VARCHAR, Building VARCHAR)","SELECT Fname, Lname FROM FACULTY WHERE sex = ""M"" AND Building = ""NEB""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, sex VARCHAR, Building VARCHAR) ### question:Find the first names and last names of male (sex is M) faculties who live in building NEB.","SELECT Fname, Lname FROM FACULTY WHERE sex = ""M"" AND Building = ""NEB""" Find the rooms of faculties with rank professor who live in building NEB.,"CREATE TABLE FACULTY (Room VARCHAR, Rank VARCHAR, Building VARCHAR)","SELECT Room FROM FACULTY WHERE Rank = ""Professor"" AND Building = ""NEB""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE FACULTY (Room VARCHAR, Rank VARCHAR, Building VARCHAR) ### question:Find the rooms of faculties with rank professor who live in building NEB.","SELECT Room FROM FACULTY WHERE Rank = ""Professor"" AND Building = ""NEB""" "Find the department name that is in Building ""Mergenthaler"".","CREATE TABLE DEPARTMENT (DName VARCHAR, Building VARCHAR)","SELECT DName FROM DEPARTMENT WHERE Building = ""Mergenthaler""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE DEPARTMENT (DName VARCHAR, Building VARCHAR) ### question:Find the department name that is in Building ""Mergenthaler"".","SELECT DName FROM DEPARTMENT WHERE Building = ""Mergenthaler""" List all information about courses sorted by credits in the ascending order.,CREATE TABLE COURSE (Credits VARCHAR),SELECT * FROM COURSE ORDER BY Credits,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (Credits VARCHAR) ### question:List all information about courses sorted by credits in the ascending order.",SELECT * FROM COURSE ORDER BY Credits List the course name of courses sorted by credits.,"CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR)",SELECT CName FROM COURSE ORDER BY Credits,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR) ### question:List the course name of courses sorted by credits.",SELECT CName FROM COURSE ORDER BY Credits Find the first name of students in the descending order of age.,"CREATE TABLE STUDENT (Fname VARCHAR, Age VARCHAR)",SELECT Fname FROM STUDENT ORDER BY Age DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, Age VARCHAR) ### question:Find the first name of students in the descending order of age.",SELECT Fname FROM STUDENT ORDER BY Age DESC Find the last name of female (sex is F) students in the descending order of age.,"CREATE TABLE STUDENT (LName VARCHAR, Sex VARCHAR, Age VARCHAR)","SELECT LName FROM STUDENT WHERE Sex = ""F"" ORDER BY Age DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (LName VARCHAR, Sex VARCHAR, Age VARCHAR) ### question:Find the last name of female (sex is F) students in the descending order of age.","SELECT LName FROM STUDENT WHERE Sex = ""F"" ORDER BY Age DESC" Find the last names of faculties in building Barton in alphabetic order.,"CREATE TABLE FACULTY (Lname VARCHAR, Building VARCHAR)","SELECT Lname FROM FACULTY WHERE Building = ""Barton"" ORDER BY Lname","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE FACULTY (Lname VARCHAR, Building VARCHAR) ### question:Find the last names of faculties in building Barton in alphabetic order.","SELECT Lname FROM FACULTY WHERE Building = ""Barton"" ORDER BY Lname" Find the first names of faculties of rank Professor in alphabetic order.,"CREATE TABLE FACULTY (Fname VARCHAR, Rank VARCHAR)","SELECT Fname FROM FACULTY WHERE Rank = ""Professor"" ORDER BY Fname","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE FACULTY (Fname VARCHAR, Rank VARCHAR) ### question:Find the first names of faculties of rank Professor in alphabetic order.","SELECT Fname FROM FACULTY WHERE Rank = ""Professor"" ORDER BY Fname" Find the name of the department that has the biggest number of students minored in?,"CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR); CREATE TABLE MINOR_IN (DNO VARCHAR)",SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR); CREATE TABLE MINOR_IN (DNO VARCHAR) ### question:Find the name of the department that has the biggest number of students minored in?",SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1 Find the name of the department that has no students minored in?,"CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR); CREATE TABLE MINOR_IN (DNO VARCHAR); CREATE TABLE DEPARTMENT (DName VARCHAR)",SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR); CREATE TABLE MINOR_IN (DNO VARCHAR); CREATE TABLE DEPARTMENT (DName VARCHAR) ### question:Find the name of the department that has no students minored in?",SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO Find the name of the department that has the fewest members.,"CREATE TABLE MEMBER_OF (DNO VARCHAR); CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR)",SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MEMBER_OF (DNO VARCHAR); CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR) ### question:Find the name of the department that has the fewest members.",SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) LIMIT 1 Find the rank of the faculty that the fewest faculties belong to.,CREATE TABLE FACULTY (Rank VARCHAR),SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE FACULTY (Rank VARCHAR) ### question:Find the rank of the faculty that the fewest faculties belong to.",SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY COUNT(*) LIMIT 1 What are the first and last names of the instructors who teach the top 3 number of courses?,"CREATE TABLE COURSE (Instructor VARCHAR); CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR)","SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (Instructor VARCHAR); CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR) ### question:What are the first and last names of the instructors who teach the top 3 number of courses?","SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 3" Which building does the instructor who teaches the most number of courses live in?,"CREATE TABLE COURSE (Instructor VARCHAR); CREATE TABLE FACULTY (Building VARCHAR, FacID VARCHAR)",SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (Instructor VARCHAR); CREATE TABLE FACULTY (Building VARCHAR, FacID VARCHAR) ### question:Which building does the instructor who teaches the most number of courses live in?",SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1 What are the name of courses that have at least five enrollments?,"CREATE TABLE ENROLLED_IN (CID VARCHAR); CREATE TABLE COURSE (CName VARCHAR, CID VARCHAR)",SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ENROLLED_IN (CID VARCHAR); CREATE TABLE COURSE (CName VARCHAR, CID VARCHAR) ### question:What are the name of courses that have at least five enrollments?",SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5 Find the first name and last name of the instructor of course that has course name,"CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR); CREATE TABLE COURSE (Instructor VARCHAR, CName VARCHAR)","SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = ""COMPUTER LITERACY""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR); CREATE TABLE COURSE (Instructor VARCHAR, CName VARCHAR) ### question:Find the first name and last name of the instructor of course that has course name","SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = ""COMPUTER LITERACY""" Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.,"CREATE TABLE COURSE (DNO VARCHAR, CName VARCHAR); CREATE TABLE DEPARTMENT (Dname VARCHAR, Room VARCHAR, DNO VARCHAR)","SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = ""INTRODUCTION TO COMPUTER SCIENCE""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (DNO VARCHAR, CName VARCHAR); CREATE TABLE DEPARTMENT (Dname VARCHAR, Room VARCHAR, DNO VARCHAR) ### question:Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.","SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = ""INTRODUCTION TO COMPUTER SCIENCE""" Find the student first and last names and grade points of all enrollments.,"CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR, lettergrade VARCHAR)","SELECT T3.Fname, T3.LName, T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR, lettergrade VARCHAR) ### question:Find the student first and last names and grade points of all enrollments.","SELECT T3.Fname, T3.LName, T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID" Find the distinct student first names of all students that have grade point at least 3.8 in one course.,"CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR, lettergrade VARCHAR)",SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR, lettergrade VARCHAR) ### question:Find the distinct student first names of all students that have grade point at least 3.8 in one course.",SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8 Find the full names of faculties who are members of department with department number 520.,"CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR); CREATE TABLE MEMBER_OF (FacID VARCHAR, DNO VARCHAR)","SELECT T1.Fname, T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR); CREATE TABLE MEMBER_OF (FacID VARCHAR, DNO VARCHAR) ### question:Find the full names of faculties who are members of department with department number 520.","SELECT T1.Fname, T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520" What are the first names and last names of the students that minor in the department with DNO 140.,"CREATE TABLE STUDENT (Fname VARCHAR, Lname VARCHAR, StuID VARCHAR); CREATE TABLE MINOR_IN (StuID VARCHAR, DNO VARCHAR)","SELECT T2.Fname, T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, Lname VARCHAR, StuID VARCHAR); CREATE TABLE MINOR_IN (StuID VARCHAR, DNO VARCHAR) ### question:What are the first names and last names of the students that minor in the department with DNO 140.","SELECT T2.Fname, T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140" Find the last names of faculties who are members of computer science department.,"CREATE TABLE DEPARTMENT (DNO VARCHAR, DName VARCHAR); CREATE TABLE MEMBER_OF (DNO VARCHAR, FacID VARCHAR); CREATE TABLE FACULTY (Lname VARCHAR, FacID VARCHAR)","SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = ""Computer Science""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE DEPARTMENT (DNO VARCHAR, DName VARCHAR); CREATE TABLE MEMBER_OF (DNO VARCHAR, FacID VARCHAR); CREATE TABLE FACULTY (Lname VARCHAR, FacID VARCHAR) ### question:Find the last names of faculties who are members of computer science department.","SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = ""Computer Science""" Find the average grade point of student whose last name is Smith.,"CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR)","SELECT AVG(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = ""Smith""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR) ### question:Find the average grade point of student whose last name is Smith.","SELECT AVG(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = ""Smith""" What is the maximum and minimum grade point of students who live in NYC?,"CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (city_code VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR)","SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = ""NYC""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (city_code VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR) ### question:What is the maximum and minimum grade point of students who live in NYC?","SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = ""NYC""" Find the names of courses that have either 3 credits or 1 credit but 4 hours.,"CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR, Hours VARCHAR)",SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR, Hours VARCHAR) ### question:Find the names of courses that have either 3 credits or 1 credit but 4 hours.",SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4 Find the names of departments that are either in division AS or in division EN and in Building NEB.,"CREATE TABLE DEPARTMENT (DName VARCHAR, Division VARCHAR, Building VARCHAR)","SELECT DName FROM DEPARTMENT WHERE Division = ""AS"" UNION SELECT DName FROM DEPARTMENT WHERE Division = ""EN"" AND Building = ""NEB""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE DEPARTMENT (DName VARCHAR, Division VARCHAR, Building VARCHAR) ### question:Find the names of departments that are either in division AS or in division EN and in Building NEB.","SELECT DName FROM DEPARTMENT WHERE Division = ""AS"" UNION SELECT DName FROM DEPARTMENT WHERE Division = ""EN"" AND Building = ""NEB""" Find the first name of students not enrolled in any course.,"CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE ENROLLED_IN (Fname VARCHAR, StuID VARCHAR)",SELECT Fname FROM STUDENT WHERE NOT StuID IN (SELECT StuID FROM ENROLLED_IN),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE ENROLLED_IN (Fname VARCHAR, StuID VARCHAR) ### question:Find the first name of students not enrolled in any course.",SELECT Fname FROM STUDENT WHERE NOT StuID IN (SELECT StuID FROM ENROLLED_IN) What are the ids of the top three products that were purchased in the largest amount?,"CREATE TABLE product_suppliers (product_id VARCHAR, total_amount_purchased VARCHAR)",SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product_suppliers (product_id VARCHAR, total_amount_purchased VARCHAR) ### question:What are the ids of the top three products that were purchased in the largest amount?",SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3 What are the product id and product type of the cheapest product?,"CREATE TABLE products (product_id VARCHAR, product_type_code VARCHAR, product_price VARCHAR)","SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR, product_type_code VARCHAR, product_price VARCHAR) ### question:What are the product id and product type of the cheapest product?","SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1" Find the number of different product types.,CREATE TABLE products (product_type_code VARCHAR),SELECT COUNT(DISTINCT product_type_code) FROM products,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR) ### question:Find the number of different product types.",SELECT COUNT(DISTINCT product_type_code) FROM products Return the address of customer 10.,"CREATE TABLE customer_addresses (address_id VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_details VARCHAR, address_id VARCHAR)",SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_addresses (address_id VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_details VARCHAR, address_id VARCHAR) ### question:Return the address of customer 10.",SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10 What are the staff ids and genders of all staffs whose job title is Department Manager?,"CREATE TABLE staff_department_assignments (staff_id VARCHAR, job_title_code VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_gender VARCHAR)","SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Department Manager""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff_department_assignments (staff_id VARCHAR, job_title_code VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_gender VARCHAR) ### question:What are the staff ids and genders of all staffs whose job title is Department Manager?","SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Department Manager""" "For each payment method, return how many customers use it.",CREATE TABLE customers (payment_method_code VARCHAR),"SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (payment_method_code VARCHAR) ### question:For each payment method, return how many customers use it.","SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code" What is the id of the product that was ordered the most often?,CREATE TABLE order_items (product_id VARCHAR),SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (product_id VARCHAR) ### question:What is the id of the product that was ordered the most often?",SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1 "What are the name, phone number and email address of the customer who made the largest number of orders?","CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)","SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) ### question:What are the name, phone number and email address of the customer who made the largest number of orders?","SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1" What is the average price for each type of product?,"CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER)","SELECT product_type_code, AVG(product_price) FROM products GROUP BY product_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER) ### question:What is the average price for each type of product?","SELECT product_type_code, AVG(product_price) FROM products GROUP BY product_type_code" How many department stores does the store chain South have?,"CREATE TABLE department_stores (dept_store_chain_id VARCHAR); CREATE TABLE department_store_chain (dept_store_chain_id VARCHAR, dept_store_chain_name VARCHAR)","SELECT COUNT(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = ""South""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department_stores (dept_store_chain_id VARCHAR); CREATE TABLE department_store_chain (dept_store_chain_id VARCHAR, dept_store_chain_name VARCHAR) ### question:How many department stores does the store chain South have?","SELECT COUNT(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = ""South""" What is the name and job title of the staff who was assigned the latest?,"CREATE TABLE staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE staff_department_assignments (job_title_code VARCHAR, staff_id VARCHAR, date_assigned_to VARCHAR)","SELECT T1.staff_name, T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE staff_department_assignments (job_title_code VARCHAR, staff_id VARCHAR, date_assigned_to VARCHAR) ### question:What is the name and job title of the staff who was assigned the latest?","SELECT T1.staff_name, T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1" "Give me the product type, name and price for all the products supplied by supplier id 3.","CREATE TABLE products (product_type_code VARCHAR, product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE product_suppliers (product_id VARCHAR, supplier_id VARCHAR)","SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR, product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE product_suppliers (product_id VARCHAR, supplier_id VARCHAR) ### question:Give me the product type, name and price for all the products supplied by supplier id 3.","SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3" "Return the distinct name of customers whose order status is Pending, in the order of customer id.","CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR)","SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""Pending"" ORDER BY T2.customer_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR) ### question:Return the distinct name of customers whose order status is Pending, in the order of customer id.","SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""Pending"" ORDER BY T2.customer_id" Find the name and address of the customers who have both New and Pending orders.,"CREATE TABLE customers (customer_name VARCHAR, customer_address VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR)","SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""New"" INTERSECT SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""Pending""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_address VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR) ### question:Find the name and address of the customers who have both New and Pending orders.","SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""New"" INTERSECT SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""Pending""" Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.,"CREATE TABLE products (product_id VARCHAR, product_price INTEGER); CREATE TABLE product_suppliers (product_id VARCHAR, supplier_id VARCHAR); CREATE TABLE products (product_price INTEGER)",SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM products),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR, product_price INTEGER); CREATE TABLE product_suppliers (product_id VARCHAR, supplier_id VARCHAR); CREATE TABLE products (product_price INTEGER) ### question:Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.",SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM products) What is the id and name of the department store that has both marketing and managing department?,"CREATE TABLE department_stores (dept_store_id VARCHAR, store_name VARCHAR); CREATE TABLE departments (dept_store_id VARCHAR, department_name VARCHAR)","SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = ""marketing"" INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = ""managing""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department_stores (dept_store_id VARCHAR, store_name VARCHAR); CREATE TABLE departments (dept_store_id VARCHAR, department_name VARCHAR) ### question:What is the id and name of the department store that has both marketing and managing department?","SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = ""marketing"" INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = ""managing""" What are the ids of the two department store chains with the largest number of department stores?,CREATE TABLE department_stores (dept_store_chain_id VARCHAR),SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY COUNT(*) DESC LIMIT 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE department_stores (dept_store_chain_id VARCHAR) ### question:What are the ids of the two department store chains with the largest number of department stores?",SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY COUNT(*) DESC LIMIT 2 What is the id of the department with the least number of staff?,CREATE TABLE staff_department_assignments (department_id VARCHAR),SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff_department_assignments (department_id VARCHAR) ### question:What is the id of the department with the least number of staff?",SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY COUNT(*) LIMIT 1 "For each product type, return the maximum and minimum price.","CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER)","SELECT product_type_code, MAX(product_price), MIN(product_price) FROM products GROUP BY product_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER) ### question:For each product type, return the maximum and minimum price.","SELECT product_type_code, MAX(product_price), MIN(product_price) FROM products GROUP BY product_type_code" Find the product type whose average price is higher than the average price of all products.,"CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER)",SELECT product_type_code FROM products GROUP BY product_type_code HAVING AVG(product_price) > (SELECT AVG(product_price) FROM products),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER) ### question:Find the product type whose average price is higher than the average price of all products.",SELECT product_type_code FROM products GROUP BY product_type_code HAVING AVG(product_price) > (SELECT AVG(product_price) FROM products) Find the id and name of the staff who has been assigned for the shortest period.,"CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_name VARCHAR)","SELECT T1.staff_id, T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_name VARCHAR) ### question:Find the id and name of the staff who has been assigned for the shortest period.","SELECT T1.staff_id, T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1" Return the names and ids of all products whose price is between 600 and 700.,"CREATE TABLE products (product_name VARCHAR, product_id VARCHAR, product_price INTEGER)","SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_id VARCHAR, product_price INTEGER) ### question:Return the names and ids of all products whose price is between 600 and 700.","SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700" Find the ids of all distinct customers who made order after some orders that were Cancelled.,"CREATE TABLE Customer_Orders (customer_id VARCHAR, order_date INTEGER, order_status_code VARCHAR)","SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT MIN(order_date) FROM Customer_Orders WHERE order_status_code = ""Cancelled"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customer_Orders (customer_id VARCHAR, order_date INTEGER, order_status_code VARCHAR) ### question:Find the ids of all distinct customers who made order after some orders that were Cancelled.","SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT MIN(order_date) FROM Customer_Orders WHERE order_status_code = ""Cancelled"")" What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?,"CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR, date_assigned_to INTEGER, job_title_code VARCHAR)",SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT MAX(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR, date_assigned_to INTEGER, job_title_code VARCHAR) ### question:What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?",SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT MAX(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff') What are the names and ids of customers whose address contains TN?,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR, customer_address VARCHAR)","SELECT customer_name, customer_id FROM customers WHERE customer_address LIKE ""%TN%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR, customer_address VARCHAR) ### question:What are the names and ids of customers whose address contains TN?","SELECT customer_name, customer_id FROM customers WHERE customer_address LIKE ""%TN%""" Return the name and gender of the staff who was assigned in 2016.,"CREATE TABLE staff (staff_name VARCHAR, staff_gender VARCHAR, staff_id VARCHAR); CREATE TABLE staff_department_assignments (staff_id VARCHAR, date_assigned_from VARCHAR)","SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE ""2016%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (staff_name VARCHAR, staff_gender VARCHAR, staff_id VARCHAR); CREATE TABLE staff_department_assignments (staff_id VARCHAR, date_assigned_from VARCHAR) ### question:Return the name and gender of the staff who was assigned in 2016.","SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE ""2016%""" List the name of staff who has been assigned multiple jobs.,"CREATE TABLE staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE staff_department_assignments (staff_id VARCHAR)",SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE staff_department_assignments (staff_id VARCHAR) ### question:List the name of staff who has been assigned multiple jobs.",SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT(*) > 1 List the name and phone number of all suppliers in the alphabetical order of their addresses.,"CREATE TABLE addresses (address_id VARCHAR, address_details VARCHAR); CREATE TABLE supplier_addresses (supplier_id VARCHAR, address_id VARCHAR); CREATE TABLE Suppliers (supplier_name VARCHAR, supplier_phone VARCHAR, supplier_id VARCHAR)","SELECT T1.supplier_name, T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (address_id VARCHAR, address_details VARCHAR); CREATE TABLE supplier_addresses (supplier_id VARCHAR, address_id VARCHAR); CREATE TABLE Suppliers (supplier_name VARCHAR, supplier_phone VARCHAR, supplier_id VARCHAR) ### question:List the name and phone number of all suppliers in the alphabetical order of their addresses.","SELECT T1.supplier_name, T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details" What are the phone numbers of all customers and suppliers.,"CREATE TABLE suppliers (customer_phone VARCHAR, supplier_phone VARCHAR); CREATE TABLE customers (customer_phone VARCHAR, supplier_phone VARCHAR)",SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE suppliers (customer_phone VARCHAR, supplier_phone VARCHAR); CREATE TABLE customers (customer_phone VARCHAR, supplier_phone VARCHAR) ### question:What are the phone numbers of all customers and suppliers.",SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers Return the ids of all products that were ordered more than three times or supplied more than 80000.,"CREATE TABLE Order_Items (product_id VARCHAR, total_amount_purchased INTEGER); CREATE TABLE Product_Suppliers (product_id VARCHAR, total_amount_purchased INTEGER)",SELECT product_id FROM Order_Items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Order_Items (product_id VARCHAR, total_amount_purchased INTEGER); CREATE TABLE Product_Suppliers (product_id VARCHAR, total_amount_purchased INTEGER) ### question:Return the ids of all products that were ordered more than three times or supplied more than 80000.",SELECT product_id FROM Order_Items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000 What are id and name of the products whose price is lower than 600 or higher than 900?,"CREATE TABLE products (product_id VARCHAR, product_name VARCHAR, product_price VARCHAR)","SELECT product_id, product_name FROM products WHERE product_price < 600 OR product_price > 900","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR, product_name VARCHAR, product_price VARCHAR) ### question:What are id and name of the products whose price is lower than 600 or higher than 900?","SELECT product_id, product_name FROM products WHERE product_price < 600 OR product_price > 900" Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.,"CREATE TABLE Product_Suppliers (supplier_id VARCHAR, total_amount_purchased INTEGER)",SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING AVG(total_amount_purchased) > 50000 OR AVG(total_amount_purchased) < 30000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Product_Suppliers (supplier_id VARCHAR, total_amount_purchased INTEGER) ### question:Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.",SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING AVG(total_amount_purchased) > 50000 OR AVG(total_amount_purchased) < 30000 What are the average amount purchased and value purchased for the supplier who supplies the most products.,"CREATE TABLE Product_Suppliers (total_amount_purchased INTEGER, total_value_purchased INTEGER, supplier_id VARCHAR)","SELECT AVG(total_amount_purchased), AVG(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY COUNT(*) DESC LIMIT 1)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Product_Suppliers (total_amount_purchased INTEGER, total_value_purchased INTEGER, supplier_id VARCHAR) ### question:What are the average amount purchased and value purchased for the supplier who supplies the most products.","SELECT AVG(total_amount_purchased), AVG(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY COUNT(*) DESC LIMIT 1)" What is the largest and smallest customer codes?,CREATE TABLE Customers (customer_code INTEGER),"SELECT MAX(customer_code), MIN(customer_code) FROM Customers","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_code INTEGER) ### question:What is the largest and smallest customer codes?","SELECT MAX(customer_code), MIN(customer_code) FROM Customers" List the names of all the distinct customers who bought a keyboard.,"CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)","SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = ""keyboard""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:List the names of all the distinct customers who bought a keyboard.","SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = ""keyboard""" List the names and phone numbers of all the distinct suppliers who supply red jeans.,"CREATE TABLE product_suppliers (supplier_id VARCHAR, product_id VARCHAR); CREATE TABLE suppliers (supplier_name VARCHAR, supplier_phone VARCHAR, supplier_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR)","SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = ""red jeans""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product_suppliers (supplier_id VARCHAR, product_id VARCHAR); CREATE TABLE suppliers (supplier_name VARCHAR, supplier_phone VARCHAR, supplier_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR) ### question:List the names and phone numbers of all the distinct suppliers who supply red jeans.","SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = ""red jeans""" "What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?","CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER)","SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER) ### question:What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?","SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code" "List the order id, customer id for orders in Cancelled status, ordered by their order dates.","CREATE TABLE customer_orders (order_id VARCHAR, customer_id VARCHAR, order_status_code VARCHAR, order_date VARCHAR)","SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = ""Cancelled"" ORDER BY order_date","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (order_id VARCHAR, customer_id VARCHAR, order_status_code VARCHAR, order_date VARCHAR) ### question:List the order id, customer id for orders in Cancelled status, ordered by their order dates.","SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = ""Cancelled"" ORDER BY order_date" Find the names of products that were bought by at least two distinct customers.,"CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE customer_orders (order_id VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR)",SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE customer_orders (order_id VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR) ### question:Find the names of products that were bought by at least two distinct customers.",SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2 Find the names of customers who have bought by at least three distinct products.,"CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)",SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:Find the names of customers who have bought by at least three distinct products.",SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3 Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.,"CREATE TABLE staff (staff_name VARCHAR, staff_gender VARCHAR, staff_id VARCHAR); CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR, job_title_code VARCHAR)","SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Sales Person"" EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Clerical Staff""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (staff_name VARCHAR, staff_gender VARCHAR, staff_id VARCHAR); CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR, job_title_code VARCHAR) ### question:Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.","SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Sales Person"" EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Clerical Staff""" Find the id and name of customers whose address contains WY state and do not use credit card for payment.,"CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR, customer_address VARCHAR, payment_method_code VARCHAR)","SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE ""%WY%"" AND payment_method_code <> ""Credit Card""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR, customer_address VARCHAR, payment_method_code VARCHAR) ### question:Find the id and name of customers whose address contains WY state and do not use credit card for payment.","SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE ""%WY%"" AND payment_method_code <> ""Credit Card""" Find the average price of all product clothes.,"CREATE TABLE products (product_price INTEGER, product_type_code VARCHAR)",SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_price INTEGER, product_type_code VARCHAR) ### question:Find the average price of all product clothes.",SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes' Find the name of the most expensive hardware product.,"CREATE TABLE products (product_name VARCHAR, product_type_code VARCHAR, product_price VARCHAR)",SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_type_code VARCHAR, product_price VARCHAR) ### question:Find the name of the most expensive hardware product.",SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1 How many aircrafts are there?,CREATE TABLE aircraft (Id VARCHAR),SELECT COUNT(*) FROM aircraft,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE aircraft (Id VARCHAR) ### question:How many aircrafts are there?",SELECT COUNT(*) FROM aircraft List the description of all aircrafts.,CREATE TABLE aircraft (Description VARCHAR),SELECT Description FROM aircraft,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE aircraft (Description VARCHAR) ### question:List the description of all aircrafts.",SELECT Description FROM aircraft What is the average number of international passengers of all airports?,CREATE TABLE airport (International_Passengers INTEGER),SELECT AVG(International_Passengers) FROM airport,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (International_Passengers INTEGER) ### question:What is the average number of international passengers of all airports?",SELECT AVG(International_Passengers) FROM airport "What are the number of international and domestic passengers of the airport named London ""Heathrow""?","CREATE TABLE airport (International_Passengers VARCHAR, Domestic_Passengers VARCHAR, Airport_Name VARCHAR)","SELECT International_Passengers, Domestic_Passengers FROM airport WHERE Airport_Name = ""London Heathrow""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (International_Passengers VARCHAR, Domestic_Passengers VARCHAR, Airport_Name VARCHAR) ### question:What are the number of international and domestic passengers of the airport named London ""Heathrow""?","SELECT International_Passengers, Domestic_Passengers FROM airport WHERE Airport_Name = ""London Heathrow""" "What are the total number of Domestic Passengers of airports that contain the word ""London"".","CREATE TABLE airport (Domestic_Passengers INTEGER, Airport_Name VARCHAR)","SELECT SUM(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE ""%London%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (Domestic_Passengers INTEGER, Airport_Name VARCHAR) ### question:What are the total number of Domestic Passengers of airports that contain the word ""London"".","SELECT SUM(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE ""%London%""" What are the maximum and minimum number of transit passengers of all aiports.,CREATE TABLE airport (Transit_Passengers INTEGER),"SELECT MAX(Transit_Passengers), MIN(Transit_Passengers) FROM airport","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (Transit_Passengers INTEGER) ### question:What are the maximum and minimum number of transit passengers of all aiports.","SELECT MAX(Transit_Passengers), MIN(Transit_Passengers) FROM airport" What are the name of pilots aged 25 or older?,"CREATE TABLE pilot (Name VARCHAR, Age VARCHAR)",SELECT Name FROM pilot WHERE Age >= 25,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Name VARCHAR, Age VARCHAR) ### question:What are the name of pilots aged 25 or older?",SELECT Name FROM pilot WHERE Age >= 25 List all pilot names in ascending alphabetical order.,CREATE TABLE pilot (Name VARCHAR),SELECT Name FROM pilot ORDER BY Name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Name VARCHAR) ### question:List all pilot names in ascending alphabetical order.",SELECT Name FROM pilot ORDER BY Name List names of all pilot aged 30 or younger in descending alphabetical order.,"CREATE TABLE pilot (Name VARCHAR, Age VARCHAR)",SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Name VARCHAR, Age VARCHAR) ### question:List names of all pilot aged 30 or younger in descending alphabetical order.",SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC "Please show the names of aircrafts associated with airport with name ""London Gatwick"".","CREATE TABLE airport (Airport_ID VARCHAR, Airport_Name VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR)","SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Gatwick""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (Airport_ID VARCHAR, Airport_Name VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR) ### question:Please show the names of aircrafts associated with airport with name ""London Gatwick"".","SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Gatwick""" Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.,"CREATE TABLE airport (Airport_ID VARCHAR, Total_Passengers INTEGER); CREATE TABLE aircraft (Aircraft VARCHAR, Description VARCHAR, Aircraft_ID VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR)","SELECT T1.Aircraft, T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (Airport_ID VARCHAR, Total_Passengers INTEGER); CREATE TABLE aircraft (Aircraft VARCHAR, Description VARCHAR, Aircraft_ID VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR) ### question:Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.","SELECT T1.Aircraft, T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000" "What is the average total number of passengers of airports that are associated with aircraft ""Robinson R-22""?","CREATE TABLE airport (Total_Passengers INTEGER, Airport_ID VARCHAR); CREATE TABLE aircraft (Aircraft_ID VARCHAR, Aircraft VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR)","SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = ""Robinson R-22""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (Total_Passengers INTEGER, Airport_ID VARCHAR); CREATE TABLE aircraft (Aircraft_ID VARCHAR, Aircraft VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR) ### question:What is the average total number of passengers of airports that are associated with aircraft ""Robinson R-22""?","SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = ""Robinson R-22""" Please list the location and the winning aircraft name.,"CREATE TABLE MATCH (Location VARCHAR, Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR)","SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (Location VARCHAR, Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR) ### question:Please list the location and the winning aircraft name.","SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft" List the name of the aircraft that has been named winning aircraft the most number of times.,"CREATE TABLE MATCH (Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR)",SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR) ### question:List the name of the aircraft that has been named winning aircraft the most number of times.",SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1 List the names of aircrafts and the number of times it won matches.,"CREATE TABLE MATCH (Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR)","SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR) ### question:List the names of aircrafts and the number of times it won matches.","SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft" List names of all pilot in descending order of age.,"CREATE TABLE pilot (Name VARCHAR, Age VARCHAR)",SELECT Name FROM pilot ORDER BY Age DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (Name VARCHAR, Age VARCHAR) ### question:List names of all pilot in descending order of age.",SELECT Name FROM pilot ORDER BY Age DESC List the names of aircrafts and that won matches at least twice.,"CREATE TABLE MATCH (Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR)",SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (Winning_Aircraft VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR) ### question:List the names of aircrafts and that won matches at least twice.",SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2 List the names of aircrafts and that did not win any match.,"CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR, Winning_Aircraft VARCHAR); CREATE TABLE MATCH (Aircraft VARCHAR, Aircraft_ID VARCHAR, Winning_Aircraft VARCHAR)",SELECT Aircraft FROM aircraft WHERE NOT Aircraft_ID IN (SELECT Winning_Aircraft FROM MATCH),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR, Winning_Aircraft VARCHAR); CREATE TABLE MATCH (Aircraft VARCHAR, Aircraft_ID VARCHAR, Winning_Aircraft VARCHAR) ### question:List the names of aircrafts and that did not win any match.",SELECT Aircraft FROM aircraft WHERE NOT Aircraft_ID IN (SELECT Winning_Aircraft FROM MATCH) "Show the names of aircrafts that are associated with both an airport named ""London Heathrow"" and an airport named ""London Gatwick""","CREATE TABLE airport (Airport_ID VARCHAR, Airport_Name VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR)","SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Heathrow"" INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Gatwick""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (Airport_ID VARCHAR, Airport_Name VARCHAR); CREATE TABLE aircraft (Aircraft VARCHAR, Aircraft_ID VARCHAR); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR, Airport_ID VARCHAR) ### question:Show the names of aircrafts that are associated with both an airport named ""London Heathrow"" and an airport named ""London Gatwick""","SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Heathrow"" INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Gatwick""" Show all information on the airport that has the largest number of international passengers.,CREATE TABLE airport (International_Passengers VARCHAR),SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (International_Passengers VARCHAR) ### question:Show all information on the airport that has the largest number of international passengers.",SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1 find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.,"CREATE TABLE MATCH (winning_pilot VARCHAR); CREATE TABLE pilot (name VARCHAR, age INTEGER, pilot_id VARCHAR)","SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (winning_pilot VARCHAR); CREATE TABLE pilot (name VARCHAR, age INTEGER, pilot_id VARCHAR) ### question:find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.","SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1" what is the name and age of the youngest winning pilot?,"CREATE TABLE pilot (name VARCHAR, age VARCHAR, pilot_id VARCHAR); CREATE TABLE MATCH (winning_pilot VARCHAR)","SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pilot (name VARCHAR, age VARCHAR, pilot_id VARCHAR); CREATE TABLE MATCH (winning_pilot VARCHAR) ### question:what is the name and age of the youngest winning pilot?","SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1" find the name of pilots who did not win the matches held in the country of Australia.,"CREATE TABLE MATCH (name VARCHAR, pilot_id VARCHAR, Winning_Pilot VARCHAR, country VARCHAR); CREATE TABLE pilot (name VARCHAR, pilot_id VARCHAR, Winning_Pilot VARCHAR, country VARCHAR)",SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (name VARCHAR, pilot_id VARCHAR, Winning_Pilot VARCHAR, country VARCHAR); CREATE TABLE pilot (name VARCHAR, pilot_id VARCHAR, Winning_Pilot VARCHAR, country VARCHAR) ### question:find the name of pilots who did not win the matches held in the country of Australia.",SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia') How many residents does each property have? List property id and resident count.,CREATE TABLE properties (property_id VARCHAR); CREATE TABLE residents (property_id VARCHAR),"SELECT T1.property_id, COUNT(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE properties (property_id VARCHAR); CREATE TABLE residents (property_id VARCHAR) ### question:How many residents does each property have? List property id and resident count.","SELECT T1.property_id, COUNT(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id" What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?,"CREATE TABLE services (service_type_code VARCHAR, organization_id VARCHAR); CREATE TABLE organizations (organization_id VARCHAR, organization_details VARCHAR)",SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE services (service_type_code VARCHAR, organization_id VARCHAR); CREATE TABLE organizations (organization_id VARCHAR, organization_details VARCHAR) ### question:What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?",SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party' "How many services has each resident requested? List the resident id, details, and the count in descending order of the count.","CREATE TABLE Residents_Services (resident_id VARCHAR); CREATE TABLE Residents (resident_id VARCHAR, other_details VARCHAR)","SELECT T1.resident_id, T1.other_details, COUNT(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Residents_Services (resident_id VARCHAR); CREATE TABLE Residents (resident_id VARCHAR, other_details VARCHAR) ### question:How many services has each resident requested? List the resident id, details, and the count in descending order of the count.","SELECT T1.resident_id, T1.other_details, COUNT(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY COUNT(*) DESC" "What is the maximum number that a certain service is provided? List the service id, details and number.","CREATE TABLE Services (service_id VARCHAR, service_details VARCHAR); CREATE TABLE Residents_Services (service_id VARCHAR)","SELECT T1.service_id, T1.service_details, COUNT(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Services (service_id VARCHAR, service_details VARCHAR); CREATE TABLE Residents_Services (service_id VARCHAR) ### question:What is the maximum number that a certain service is provided? List the service id, details and number.","SELECT T1.service_id, T1.service_details, COUNT(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1" "List the id and type of each thing, and the details of the organization that owns it.","CREATE TABLE Organizations (organization_details VARCHAR, organization_id VARCHAR); CREATE TABLE Things (thing_id VARCHAR, type_of_Thing_Code VARCHAR, organization_id VARCHAR)","SELECT T1.thing_id, T1.type_of_Thing_Code, T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Organizations (organization_details VARCHAR, organization_id VARCHAR); CREATE TABLE Things (thing_id VARCHAR, type_of_Thing_Code VARCHAR, organization_id VARCHAR) ### question:List the id and type of each thing, and the details of the organization that owns it.","SELECT T1.thing_id, T1.type_of_Thing_Code, T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id" What are the id and details of the customers who have at least 3 events?,"CREATE TABLE Customers (customer_id VARCHAR, customer_details VARCHAR); CREATE TABLE Customer_Events (customer_id VARCHAR)","SELECT T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_id VARCHAR, customer_details VARCHAR); CREATE TABLE Customer_Events (customer_id VARCHAR) ### question:What are the id and details of the customers who have at least 3 events?","SELECT T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 3" "What is each customer's move in date, and the corresponding customer id and details?","CREATE TABLE Customer_Events (date_moved_in VARCHAR, customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_details VARCHAR)","SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customer_Events (date_moved_in VARCHAR, customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, customer_details VARCHAR) ### question:What is each customer's move in date, and the corresponding customer id and details?","SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id" Which events have the number of notes between one and three? List the event id and the property id.,"CREATE TABLE Customer_Events (Customer_Event_ID VARCHAR, property_id VARCHAR, customer_event_id VARCHAR); CREATE TABLE Customer_Event_Notes (Customer_Event_ID VARCHAR)","SELECT T1.Customer_Event_ID, T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING COUNT(*) BETWEEN 1 AND 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customer_Events (Customer_Event_ID VARCHAR, property_id VARCHAR, customer_event_id VARCHAR); CREATE TABLE Customer_Event_Notes (Customer_Event_ID VARCHAR) ### question:Which events have the number of notes between one and three? List the event id and the property id.","SELECT T1.Customer_Event_ID, T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING COUNT(*) BETWEEN 1 AND 3" What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21',"CREATE TABLE Timed_Status_of_Things (thing_id VARCHAR, Status_of_Thing_Code VARCHAR, Date_and_Date VARCHAR); CREATE TABLE Things (thing_id VARCHAR, Type_of_Thing_Code VARCHAR)","SELECT DISTINCT T2.thing_id, T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Timed_Status_of_Things (thing_id VARCHAR, Status_of_Thing_Code VARCHAR, Date_and_Date VARCHAR); CREATE TABLE Things (thing_id VARCHAR, Type_of_Thing_Code VARCHAR) ### question:What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'","SELECT DISTINCT T2.thing_id, T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21'" How many distinct locations have the things with service detail 'Unsatisfied' been located in?,"CREATE TABLE Timed_Locations_of_Things (Location_Code VARCHAR, thing_id VARCHAR); CREATE TABLE Things (thing_id VARCHAR, service_details VARCHAR)",SELECT COUNT(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Timed_Locations_of_Things (Location_Code VARCHAR, thing_id VARCHAR); CREATE TABLE Things (thing_id VARCHAR, service_details VARCHAR) ### question:How many distinct locations have the things with service detail 'Unsatisfied' been located in?",SELECT COUNT(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied' How many different status codes of things are there?,CREATE TABLE Timed_Status_of_Things (Status_of_Thing_Code VARCHAR),SELECT COUNT(DISTINCT Status_of_Thing_Code) FROM Timed_Status_of_Things,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Timed_Status_of_Things (Status_of_Thing_Code VARCHAR) ### question:How many different status codes of things are there?",SELECT COUNT(DISTINCT Status_of_Thing_Code) FROM Timed_Status_of_Things Which organizations are not a parent organization of others? List the organization id.,"CREATE TABLE organizations (organization_id VARCHAR, parent_organization_id VARCHAR)",SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organizations (organization_id VARCHAR, parent_organization_id VARCHAR) ### question:Which organizations are not a parent organization of others? List the organization id.",SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations When is the last day any resident moved in?,CREATE TABLE Residents (date_moved_in INTEGER),SELECT MAX(date_moved_in) FROM Residents,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Residents (date_moved_in INTEGER) ### question:When is the last day any resident moved in?",SELECT MAX(date_moved_in) FROM Residents What are the resident details containing the substring 'Miss'?,CREATE TABLE Residents (other_details VARCHAR),SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Residents (other_details VARCHAR) ### question:What are the resident details containing the substring 'Miss'?",SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%' List the customer event id and the corresponding move in date and property id.,"CREATE TABLE customer_events (customer_event_id VARCHAR, date_moved_in VARCHAR, property_id VARCHAR)","SELECT customer_event_id, date_moved_in, property_id FROM customer_events","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_events (customer_event_id VARCHAR, date_moved_in VARCHAR, property_id VARCHAR) ### question:List the customer event id and the corresponding move in date and property id.","SELECT customer_event_id, date_moved_in, property_id FROM customer_events" How many customers did not have any event?,CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE customer_events (customer_id VARCHAR),SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE customer_events (customer_id VARCHAR) ### question:How many customers did not have any event?",SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events) What are the distinct move in dates of the residents?,CREATE TABLE residents (date_moved_in VARCHAR),SELECT DISTINCT date_moved_in FROM residents,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE residents (date_moved_in VARCHAR) ### question:What are the distinct move in dates of the residents?",SELECT DISTINCT date_moved_in FROM residents List the locations of schools in ascending order of enrollment.,"CREATE TABLE school (LOCATION VARCHAR, Enrollment VARCHAR)",SELECT LOCATION FROM school ORDER BY Enrollment,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (LOCATION VARCHAR, Enrollment VARCHAR) ### question:List the locations of schools in ascending order of enrollment.",SELECT LOCATION FROM school ORDER BY Enrollment List the locations of schools in descending order of founded year.,"CREATE TABLE school (LOCATION VARCHAR, Founded VARCHAR)",SELECT LOCATION FROM school ORDER BY Founded DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (LOCATION VARCHAR, Founded VARCHAR) ### question:List the locations of schools in descending order of founded year.",SELECT LOCATION FROM school ORDER BY Founded DESC "What are the enrollments of schools whose denomination is not ""Catholic""?","CREATE TABLE school (Enrollment VARCHAR, Denomination VARCHAR)","SELECT Enrollment FROM school WHERE Denomination <> ""Catholic""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Enrollment VARCHAR, Denomination VARCHAR) ### question:What are the enrollments of schools whose denomination is not ""Catholic""?","SELECT Enrollment FROM school WHERE Denomination <> ""Catholic""" What is the average enrollment of schools?,CREATE TABLE school (Enrollment INTEGER),SELECT AVG(Enrollment) FROM school,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Enrollment INTEGER) ### question:What is the average enrollment of schools?",SELECT AVG(Enrollment) FROM school "What are the teams of the players, sorted in ascending alphabetical order?",CREATE TABLE player (Team VARCHAR),SELECT Team FROM player ORDER BY Team,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Team VARCHAR) ### question:What are the teams of the players, sorted in ascending alphabetical order?",SELECT Team FROM player ORDER BY Team Find the team of the player of the highest age.,"CREATE TABLE player (Team VARCHAR, Age VARCHAR)",SELECT Team FROM player ORDER BY Age DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Team VARCHAR, Age VARCHAR) ### question:Find the team of the player of the highest age.",SELECT Team FROM player ORDER BY Age DESC LIMIT 1 List the teams of the players with the top 5 largest ages.,"CREATE TABLE player (Team VARCHAR, Age VARCHAR)",SELECT Team FROM player ORDER BY Age DESC LIMIT 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (Team VARCHAR, Age VARCHAR) ### question:List the teams of the players with the top 5 largest ages.",SELECT Team FROM player ORDER BY Age DESC LIMIT 5 "For each player, show the team and the location of school they belong to.","CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE player (Team VARCHAR, School_ID VARCHAR)","SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE player (Team VARCHAR, School_ID VARCHAR) ### question:For each player, show the team and the location of school they belong to.","SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID" Show the locations of schools that have more than 1 player.,"CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Location VARCHAR, School_ID VARCHAR)",SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Location VARCHAR, School_ID VARCHAR) ### question:Show the locations of schools that have more than 1 player.",SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1 Show the denomination of the school that has the most players.,"CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Denomination VARCHAR, School_ID VARCHAR)",SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Denomination VARCHAR, School_ID VARCHAR) ### question:Show the denomination of the school that has the most players.",SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1 Show locations and nicknames of schools.,"CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE school_details (Nickname VARCHAR, School_ID VARCHAR)","SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE school_details (Nickname VARCHAR, School_ID VARCHAR) ### question:Show locations and nicknames of schools.","SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID" Please show different denominations and the corresponding number of schools.,CREATE TABLE school (Denomination VARCHAR),"SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Denomination VARCHAR) ### question:Please show different denominations and the corresponding number of schools.","SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination" Please show different denominations and the corresponding number of schools in descending order.,CREATE TABLE school (Denomination VARCHAR),"SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Denomination VARCHAR) ### question:Please show different denominations and the corresponding number of schools in descending order.","SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC" List the school color of the school that has the largest enrollment.,"CREATE TABLE school (School_Colors VARCHAR, Enrollment VARCHAR)",SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (School_Colors VARCHAR, Enrollment VARCHAR) ### question:List the school color of the school that has the largest enrollment.",SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1 List the locations of schools that do not have any player.,"CREATE TABLE school (LOCATION VARCHAR, School_ID VARCHAR); CREATE TABLE Player (LOCATION VARCHAR, School_ID VARCHAR)",SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (LOCATION VARCHAR, School_ID VARCHAR); CREATE TABLE Player (LOCATION VARCHAR, School_ID VARCHAR) ### question:List the locations of schools that do not have any player.",SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player) Show the denomination shared by schools founded before 1890 and schools founded after 1900,"CREATE TABLE school (Denomination VARCHAR, Founded INTEGER)",SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Denomination VARCHAR, Founded INTEGER) ### question:Show the denomination shared by schools founded before 1890 and schools founded after 1900",SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900 Show the nicknames of schools that are not in division 1.,"CREATE TABLE school_details (Nickname VARCHAR, Division VARCHAR)","SELECT Nickname FROM school_details WHERE Division <> ""Division 1""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school_details (Nickname VARCHAR, Division VARCHAR) ### question:Show the nicknames of schools that are not in division 1.","SELECT Nickname FROM school_details WHERE Division <> ""Division 1""" Show the denomination shared by more than one school.,CREATE TABLE school (Denomination VARCHAR),SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (Denomination VARCHAR) ### question:Show the denomination shared by more than one school.",SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1 Find all the distinct district names ordered by city area in descending.,"CREATE TABLE district (District_name VARCHAR, city_area VARCHAR)",SELECT DISTINCT District_name FROM district ORDER BY city_area DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (District_name VARCHAR, city_area VARCHAR) ### question:Find all the distinct district names ordered by city area in descending.",SELECT DISTINCT District_name FROM district ORDER BY city_area DESC Find the list of page size which have more than 3 product listed,CREATE TABLE product (max_page_size VARCHAR),SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (max_page_size VARCHAR) ### question:Find the list of page size which have more than 3 product listed",SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3 Find the name and population of district with population between 200000 and 2000000,"CREATE TABLE district (District_name VARCHAR, City_Population INTEGER)","SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (District_name VARCHAR, City_Population INTEGER) ### question:Find the name and population of district with population between 200000 and 2000000","SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000" Find the name all districts with city area greater than 10 or population larger than 100000,"CREATE TABLE district (district_name VARCHAR, city_area VARCHAR, City_Population VARCHAR)",SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (district_name VARCHAR, city_area VARCHAR, City_Population VARCHAR) ### question:Find the name all districts with city area greater than 10 or population larger than 100000",SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000 Which district has the largest population?,"CREATE TABLE district (district_name VARCHAR, city_population VARCHAR)",SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (district_name VARCHAR, city_population VARCHAR) ### question:Which district has the largest population?",SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1 Which district has the least area?,"CREATE TABLE district (district_name VARCHAR, city_area VARCHAR)",SELECT district_name FROM district ORDER BY city_area LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (district_name VARCHAR, city_area VARCHAR) ### question:Which district has the least area?",SELECT district_name FROM district ORDER BY city_area LIMIT 1 Find the total population of the top 3 districts with the largest area.,"CREATE TABLE district (city_population INTEGER, city_area VARCHAR)",SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (city_population INTEGER, city_area VARCHAR) ### question:Find the total population of the top 3 districts with the largest area.",SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3 Find all types of store and number of them.,CREATE TABLE store (TYPE VARCHAR),"SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE store (TYPE VARCHAR) ### question:Find all types of store and number of them.","SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE" Find the names of all stores in Khanewal District.,"CREATE TABLE district (district_id VARCHAR, district_name VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR)","SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = ""Khanewal District""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (district_id VARCHAR, district_name VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR) ### question:Find the names of all stores in Khanewal District.","SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = ""Khanewal District""" Find all the stores in the district with the most population.,"CREATE TABLE store_district (store_id VARCHAR); CREATE TABLE district (district_id VARCHAR, city_population VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR)",SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE store_district (store_id VARCHAR); CREATE TABLE district (district_id VARCHAR, city_population VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR) ### question:Find all the stores in the district with the most population.",SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1) "Which city is the headquarter of the store named ""Blackville"" in?","CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR)","SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = ""Blackville""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR) ### question:Which city is the headquarter of the store named ""Blackville"" in?","SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = ""Blackville""" Find the number of stores in each city.,"CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR)","SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR) ### question:Find the number of stores in each city.","SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city" Find the city with the most number of stores.,"CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR)",SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR) ### question:Find the city with the most number of stores.",SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1 What is the average pages per minute color?,CREATE TABLE product (pages_per_minute_color INTEGER),SELECT AVG(pages_per_minute_color) FROM product,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (pages_per_minute_color INTEGER) ### question:What is the average pages per minute color?",SELECT AVG(pages_per_minute_color) FROM product "What products are available at store named ""Miramichi""?","CREATE TABLE store_product (product_id VARCHAR, store_id VARCHAR); CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE product (product VARCHAR, product_id VARCHAR)","SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = ""Miramichi""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE store_product (product_id VARCHAR, store_id VARCHAR); CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE product (product VARCHAR, product_id VARCHAR) ### question:What products are available at store named ""Miramichi""?","SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = ""Miramichi""" "Find products with max page size as ""A4"" and pages per minute color smaller than 5.","CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR)","SELECT product FROM product WHERE max_page_size = ""A4"" AND pages_per_minute_color < 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR) ### question:Find products with max page size as ""A4"" and pages per minute color smaller than 5.","SELECT product FROM product WHERE max_page_size = ""A4"" AND pages_per_minute_color < 5" "Find products with max page size as ""A4"" or pages per minute color smaller than 5.","CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR)","SELECT product FROM product WHERE max_page_size = ""A4"" OR pages_per_minute_color < 5","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR) ### question:Find products with max page size as ""A4"" or pages per minute color smaller than 5.","SELECT product FROM product WHERE max_page_size = ""A4"" OR pages_per_minute_color < 5" "Find all the product whose name contains the word ""Scanner"".",CREATE TABLE product (product VARCHAR),"SELECT product FROM product WHERE product LIKE ""%Scanner%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product VARCHAR) ### question:Find all the product whose name contains the word ""Scanner"".","SELECT product FROM product WHERE product LIKE ""%Scanner%""" Find the most prominent max page size among all the products.,CREATE TABLE product (max_page_size VARCHAR),SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (max_page_size VARCHAR) ### question:Find the most prominent max page size among all the products.",SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1 Find the name of the products that are not using the most frequently-used max page size.,"CREATE TABLE product (product VARCHAR, max_page_size VARCHAR)",SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product VARCHAR, max_page_size VARCHAR) ### question:Find the name of the products that are not using the most frequently-used max page size.",SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1) Find the total population of the districts where the area is bigger than the average city area.,"CREATE TABLE district (city_population INTEGER, city_area INTEGER)",SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (city_population INTEGER, city_area INTEGER) ### question:Find the total population of the districts where the area is bigger than the average city area.",SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district) Find the names of districts where have both city mall and village store type stores.,"CREATE TABLE district (District_name VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR, Type VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR)","SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = ""City Mall"" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = ""Village Store""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE district (District_name VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR, Type VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR) ### question:Find the names of districts where have both city mall and village store type stores.","SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = ""City Mall"" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = ""Village Store""" What is the total enrollment number of all colleges?,CREATE TABLE College (enr INTEGER),SELECT SUM(enr) FROM College,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (enr INTEGER) ### question:What is the total enrollment number of all colleges?",SELECT SUM(enr) FROM College What is the average enrollment number?,CREATE TABLE College (enr INTEGER),SELECT AVG(enr) FROM College,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (enr INTEGER) ### question:What is the average enrollment number?",SELECT AVG(enr) FROM College How many colleges in total?,CREATE TABLE College (Id VARCHAR),SELECT COUNT(*) FROM College,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (Id VARCHAR) ### question:How many colleges in total?",SELECT COUNT(*) FROM College How many players have more than 1000 hours of training?,CREATE TABLE Player (HS INTEGER),SELECT COUNT(*) FROM Player WHERE HS > 1000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Player (HS INTEGER) ### question:How many players have more than 1000 hours of training?",SELECT COUNT(*) FROM Player WHERE HS > 1000 How many colleges has more than 15000 students?,CREATE TABLE College (enr INTEGER),SELECT COUNT(*) FROM College WHERE enr > 15000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (enr INTEGER) ### question:How many colleges has more than 15000 students?",SELECT COUNT(*) FROM College WHERE enr > 15000 What is the average training hours of all players?,CREATE TABLE Player (HS INTEGER),SELECT AVG(HS) FROM Player,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Player (HS INTEGER) ### question:What is the average training hours of all players?",SELECT AVG(HS) FROM Player Find the name and training hours of players whose hours are below 1500.,"CREATE TABLE Player (pName VARCHAR, HS INTEGER)","SELECT pName, HS FROM Player WHERE HS < 1500","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Player (pName VARCHAR, HS INTEGER) ### question:Find the name and training hours of players whose hours are below 1500.","SELECT pName, HS FROM Player WHERE HS < 1500" How many different colleges do attend the tryout test?,CREATE TABLE tryout (cName VARCHAR),SELECT COUNT(DISTINCT cName) FROM tryout,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR) ### question:How many different colleges do attend the tryout test?",SELECT COUNT(DISTINCT cName) FROM tryout What are the unique types of player positions in the tryout?,CREATE TABLE tryout (pPos VARCHAR),SELECT COUNT(DISTINCT pPos) FROM tryout,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (pPos VARCHAR) ### question:What are the unique types of player positions in the tryout?",SELECT COUNT(DISTINCT pPos) FROM tryout How many students got accepted after the tryout?,CREATE TABLE tryout (decision VARCHAR),SELECT COUNT(*) FROM tryout WHERE decision = 'yes',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (decision VARCHAR) ### question:How many students got accepted after the tryout?",SELECT COUNT(*) FROM tryout WHERE decision = 'yes' How many students whose are playing the role of goalie?,CREATE TABLE tryout (pPos VARCHAR),SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (pPos VARCHAR) ### question:How many students whose are playing the role of goalie?",SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie' "Find the max, average and min training hours of all players.",CREATE TABLE Player (HS INTEGER),"SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Player (HS INTEGER) ### question:Find the max, average and min training hours of all players.","SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player" What is average enrollment of colleges in the state FL?,"CREATE TABLE College (enr INTEGER, state VARCHAR)",SELECT AVG(enr) FROM College WHERE state = 'FL',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (enr INTEGER, state VARCHAR) ### question:What is average enrollment of colleges in the state FL?",SELECT AVG(enr) FROM College WHERE state = 'FL' What are the names of players whose training hours is between 500 and 1500?,"CREATE TABLE Player (pName VARCHAR, HS INTEGER)",SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Player (pName VARCHAR, HS INTEGER) ### question:What are the names of players whose training hours is between 500 and 1500?",SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500 Find the players whose names contain letter 'a'.,CREATE TABLE Player (pName VARCHAR),SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Player (pName VARCHAR) ### question:Find the players whose names contain letter 'a'.",SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%' "Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.","CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR)","SELECT cName, enr FROM College WHERE enr > 10000 AND state = ""LA""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR) ### question:Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.","SELECT cName, enr FROM College WHERE enr > 10000 AND state = ""LA""" List all information about college sorted by enrollment number in the ascending order.,CREATE TABLE College (enr VARCHAR),SELECT * FROM College ORDER BY enr,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (enr VARCHAR) ### question:List all information about college sorted by enrollment number in the ascending order.",SELECT * FROM College ORDER BY enr List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.,"CREATE TABLE College (cName VARCHAR, enr INTEGER)",SELECT cName FROM College WHERE enr > 18000 ORDER BY cName,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (cName VARCHAR, enr INTEGER) ### question:List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.",SELECT cName FROM College WHERE enr > 18000 ORDER BY cName Find the name of players whose card is yes in the descending order of training hours.,"CREATE TABLE Player (pName VARCHAR, yCard VARCHAR, HS VARCHAR)",SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Player (pName VARCHAR, yCard VARCHAR, HS VARCHAR) ### question:Find the name of players whose card is yes in the descending order of training hours.",SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC Find the name of different colleges involved in the tryout in alphabetical order.,CREATE TABLE tryout (cName VARCHAR),SELECT DISTINCT cName FROM tryout ORDER BY cName,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR) ### question:Find the name of different colleges involved in the tryout in alphabetical order.",SELECT DISTINCT cName FROM tryout ORDER BY cName Which position is most popular among players in the tryout?,CREATE TABLE tryout (pPos VARCHAR),SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (pPos VARCHAR) ### question:Which position is most popular among players in the tryout?",SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1 Find the number of students who participate in the tryout for each college ordered by descending count.,CREATE TABLE tryout (cName VARCHAR),"SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR) ### question:Find the number of students who participate in the tryout for each college ordered by descending count.","SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC" What is minimum hours of the students playing in different position?,"CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR)","SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR) ### question:What is minimum hours of the students playing in different position?","SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos" What are the names of schools with the top 3 largest size?,"CREATE TABLE college (cName VARCHAR, enr VARCHAR)",SELECT cName FROM college ORDER BY enr DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (cName VARCHAR, enr VARCHAR) ### question:What are the names of schools with the top 3 largest size?",SELECT cName FROM college ORDER BY enr DESC LIMIT 3 What is the name of school that has the smallest enrollment in each state?,"CREATE TABLE college (cName VARCHAR, state VARCHAR, enr INTEGER)","SELECT cName, state, MIN(enr) FROM college GROUP BY state","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (cName VARCHAR, state VARCHAR, enr INTEGER) ### question:What is the name of school that has the smallest enrollment in each state?","SELECT cName, state, MIN(enr) FROM college GROUP BY state" Find the states where have some college students in tryout.,CREATE TABLE college (cName VARCHAR); CREATE TABLE tryout (cName VARCHAR),SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (cName VARCHAR); CREATE TABLE tryout (cName VARCHAR) ### question:Find the states where have some college students in tryout.",SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName Find the states where have some college students in tryout and their decisions are yes.,"CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)",SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### question:Find the states where have some college students in tryout and their decisions are yes.",SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' Find the name and college of students whose decisions are yes in the tryout.,"CREATE TABLE tryout (cName VARCHAR, pID VARCHAR, decision VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)","SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pID VARCHAR, decision VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### question:Find the name and college of students whose decisions are yes in the tryout.","SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'" Find the name of all students who were in the tryout sorted in alphabetic order.,"CREATE TABLE tryout (pID VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)",SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (pID VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### question:Find the name of all students who were in the tryout sorted in alphabetic order.",SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName Find the name and hours of the students whose tryout decision is yes.,"CREATE TABLE player (pName VARCHAR, HS VARCHAR, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR)","SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (pName VARCHAR, HS VARCHAR, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR) ### question:Find the name and hours of the students whose tryout decision is yes.","SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'" Find the states of the colleges that have students in the tryout who played in striker position.,"CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### question:Find the states of the colleges that have students in the tryout who played in striker position.",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker' Find the names of the students who are in the position of striker and got a yes tryout decision.,"CREATE TABLE tryout (pID VARCHAR, decision VARCHAR, pPos VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)",SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (pID VARCHAR, decision VARCHAR, pPos VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### question:Find the names of the students who are in the position of striker and got a yes tryout decision.",SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker' Find the state of the college which player Charles is attending.,"CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### question:Find the state of the college which player Charles is attending.",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles' Find the average and maximum hours for the students whose tryout decision is yes.,"CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR)","SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR) ### question:Find the average and maximum hours for the students whose tryout decision is yes.","SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'" Find the average hours for the students whose tryout decision is no.,"CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR)",SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR) ### question:Find the average hours for the students whose tryout decision is no.",SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no' What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?,"CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR)","SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR) ### question:What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?","SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos" Which colleges do the tryout players whose name starts with letter D go to?,"CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR)",SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR) ### question:Which colleges do the tryout players whose name starts with letter D go to?",SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%' Which college has any student who is a goalie and succeeded in the tryout.,"CREATE TABLE tryout (cName VARCHAR, decision VARCHAR, pPos VARCHAR)",SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, decision VARCHAR, pPos VARCHAR) ### question:Which college has any student who is a goalie and succeeded in the tryout.",SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie' Find the name of the tryout players who are from the college with largest size.,"CREATE TABLE college (cName VARCHAR, enr VARCHAR); CREATE TABLE tryout (pID VARCHAR, cName VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)",SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (cName VARCHAR, enr VARCHAR); CREATE TABLE tryout (pID VARCHAR, cName VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### question:Find the name of the tryout players who are from the college with largest size.",SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1) What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.,"CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, enr VARCHAR, cName VARCHAR)","SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, enr VARCHAR, cName VARCHAR) ### question:What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.","SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'" Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.,"CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR)","SELECT cName FROM College WHERE enr < 13000 AND state = ""AZ"" UNION SELECT cName FROM College WHERE enr > 15000 AND state = ""LA""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR) ### question:Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.","SELECT cName FROM College WHERE enr < 13000 AND state = ""AZ"" UNION SELECT cName FROM College WHERE enr > 15000 AND state = ""LA""" Find the names of schools that have some students playing in goalie and mid positions.,"CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR)",SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR) ### question:Find the names of schools that have some students playing in goalie and mid positions.",SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid' Find the names of states that have some college students playing in goalie and mid positions.,"CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### question:Find the names of states that have some college students playing in goalie and mid positions.",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' How many schools have some students playing in goalie and mid positions.,"CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR)",SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR) ### question:How many schools have some students playing in goalie and mid positions.",SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid') Find the names of schools that have some players in the mid position but not in the goalie position.,"CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR)",SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR) ### question:Find the names of schools that have some players in the mid position but not in the goalie position.",SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie' Find the names of states that have some college students playing in the mid position but not in the goalie position.,"CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### question:Find the names of states that have some college students playing in the mid position but not in the goalie position.",SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' How many states that have some college students playing in the mid position but not in the goalie position.,"CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)",SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### question:How many states that have some college students playing in the mid position but not in the goalie position.",SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie') Find the states where have the colleges whose enrollments are less than the largest size.,"CREATE TABLE college (state VARCHAR, enr INTEGER)",SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (state VARCHAR, enr INTEGER) ### question:Find the states where have the colleges whose enrollments are less than the largest size.",SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college) Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.,"CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR)",SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR) ### question:Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.",SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL') Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.,"CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR)",SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR) ### question:Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.",SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL') What is the total number of enrollment of schools that do not have any goalie player?,"CREATE TABLE college (enr INTEGER, cName VARCHAR, pPos VARCHAR); CREATE TABLE tryout (enr INTEGER, cName VARCHAR, pPos VARCHAR)","SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = ""goalie"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (enr INTEGER, cName VARCHAR, pPos VARCHAR); CREATE TABLE tryout (enr INTEGER, cName VARCHAR, pPos VARCHAR) ### question:What is the total number of enrollment of schools that do not have any goalie player?","SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = ""goalie"")" What is the number of states that has some college whose enrollment is larger than the average enrollment?,"CREATE TABLE college (state VARCHAR, enr INTEGER)",SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (state VARCHAR, enr INTEGER) ### question:What is the number of states that has some college whose enrollment is larger than the average enrollment?",SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college) What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?,"CREATE TABLE college (state VARCHAR, enr INTEGER)",SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE college (state VARCHAR, enr INTEGER) ### question:What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?",SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college) How many devices are there?,CREATE TABLE device (Id VARCHAR),SELECT COUNT(*) FROM device,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE device (Id VARCHAR) ### question:How many devices are there?",SELECT COUNT(*) FROM device List the carriers of devices in ascending alphabetical order.,CREATE TABLE device (Carrier VARCHAR),SELECT Carrier FROM device ORDER BY Carrier,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE device (Carrier VARCHAR) ### question:List the carriers of devices in ascending alphabetical order.",SELECT Carrier FROM device ORDER BY Carrier "What are the carriers of devices whose software platforms are not ""Android""?","CREATE TABLE device (Carrier VARCHAR, Software_Platform VARCHAR)",SELECT Carrier FROM device WHERE Software_Platform <> 'Android',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE device (Carrier VARCHAR, Software_Platform VARCHAR) ### question:What are the carriers of devices whose software platforms are not ""Android""?",SELECT Carrier FROM device WHERE Software_Platform <> 'Android' What are the names of shops in ascending order of open year?,"CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR)",SELECT Shop_Name FROM shop ORDER BY Open_Year,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR) ### question:What are the names of shops in ascending order of open year?",SELECT Shop_Name FROM shop ORDER BY Open_Year What is the average quantity of stocks?,CREATE TABLE stock (Quantity INTEGER),SELECT AVG(Quantity) FROM stock,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stock (Quantity INTEGER) ### question:What is the average quantity of stocks?",SELECT AVG(Quantity) FROM stock What are the names and location of the shops in ascending alphabetical order of name.,"CREATE TABLE shop (Shop_Name VARCHAR, LOCATION VARCHAR)","SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Shop_Name VARCHAR, LOCATION VARCHAR) ### question:What are the names and location of the shops in ascending alphabetical order of name.","SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name" How many different software platforms are there for devices?,CREATE TABLE device (Software_Platform VARCHAR),SELECT COUNT(DISTINCT Software_Platform) FROM device,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE device (Software_Platform VARCHAR) ### question:How many different software platforms are there for devices?",SELECT COUNT(DISTINCT Software_Platform) FROM device "List the open date of open year of the shop named ""Apple"".","CREATE TABLE shop (Open_Date VARCHAR, Open_Year VARCHAR, Shop_Name VARCHAR)","SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = ""Apple""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Open_Date VARCHAR, Open_Year VARCHAR, Shop_Name VARCHAR) ### question:List the open date of open year of the shop named ""Apple"".","SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = ""Apple""" List the name of the shop with the latest open year.,"CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR)",SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR) ### question:List the name of the shop with the latest open year.",SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1 Show names of shops and the carriers of devices they have in stock.,"CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Device_ID VARCHAR, Shop_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR)","SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Device_ID VARCHAR, Shop_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR) ### question:Show names of shops and the carriers of devices they have in stock.","SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID" Show names of shops that have more than one kind of device in stock.,"CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR)",SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR) ### question:Show names of shops that have more than one kind of device in stock.",SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1 Show the name of the shop that has the most kind of devices in stock.,"CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR)",SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR) ### question:Show the name of the shop that has the most kind of devices in stock.",SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1 Show the name of the shop that have the largest quantity of devices in stock.,"CREATE TABLE stock (Shop_ID VARCHAR, quantity INTEGER); CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR)",SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stock (Shop_ID VARCHAR, quantity INTEGER); CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR) ### question:Show the name of the shop that have the largest quantity of devices in stock.",SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1 Please show different software platforms and the corresponding number of devices using each.,CREATE TABLE device (Software_Platform VARCHAR),"SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE device (Software_Platform VARCHAR) ### question:Please show different software platforms and the corresponding number of devices using each.","SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform" Please show the software platforms of devices in descending order of the count.,CREATE TABLE device (Software_Platform VARCHAR),SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE device (Software_Platform VARCHAR) ### question:Please show the software platforms of devices in descending order of the count.",SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC List the software platform shared by the greatest number of devices.,CREATE TABLE device (Software_Platform VARCHAR),SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE device (Software_Platform VARCHAR) ### question:List the software platform shared by the greatest number of devices.",SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1 List the names of shops that have no devices in stock.,"CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_Name VARCHAR, Shop_ID VARCHAR)",SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_Name VARCHAR, Shop_ID VARCHAR) ### question:List the names of shops that have no devices in stock.",SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock) Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.,"CREATE TABLE shop (LOCATION VARCHAR, Open_Year INTEGER)",SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shop (LOCATION VARCHAR, Open_Year INTEGER) ### question:Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.",SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008 List the carriers of devices that have no devices in stock.,"CREATE TABLE stock (Carrier VARCHAR, Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR)",SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stock (Carrier VARCHAR, Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR) ### question:List the carriers of devices that have no devices in stock.",SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock) Show the carriers of devices in stock at more than one shop.,"CREATE TABLE stock (Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR)",SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stock (Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR) ### question:Show the carriers of devices in stock at more than one shop.",SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1 How many bookings do we have?,CREATE TABLE BOOKINGS (Id VARCHAR),SELECT COUNT(*) FROM BOOKINGS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE BOOKINGS (Id VARCHAR) ### question:How many bookings do we have?",SELECT COUNT(*) FROM BOOKINGS List the order dates of all the bookings.,CREATE TABLE BOOKINGS (Order_Date VARCHAR),SELECT Order_Date FROM BOOKINGS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE BOOKINGS (Order_Date VARCHAR) ### question:List the order dates of all the bookings.",SELECT Order_Date FROM BOOKINGS Show all the planned delivery dates and actual delivery dates of bookings.,"CREATE TABLE BOOKINGS (Planned_Delivery_Date VARCHAR, Actual_Delivery_Date VARCHAR)","SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE BOOKINGS (Planned_Delivery_Date VARCHAR, Actual_Delivery_Date VARCHAR) ### question:Show all the planned delivery dates and actual delivery dates of bookings.","SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS" How many customers do we have?,CREATE TABLE CUSTOMERS (Id VARCHAR),SELECT COUNT(*) FROM CUSTOMERS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CUSTOMERS (Id VARCHAR) ### question:How many customers do we have?",SELECT COUNT(*) FROM CUSTOMERS What are the phone and email for customer Harold?,"CREATE TABLE CUSTOMERS (Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Customer_Name VARCHAR)","SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = ""Harold""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CUSTOMERS (Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Customer_Name VARCHAR) ### question:What are the phone and email for customer Harold?","SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = ""Harold""" Show all the Store_Name of drama workshop groups.,CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR),SELECT Store_Name FROM Drama_Workshop_Groups,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR) ### question:Show all the Store_Name of drama workshop groups.",SELECT Store_Name FROM Drama_Workshop_Groups "Show the minimum, average, maximum order quantity of all invoices.",CREATE TABLE INVOICES (Order_Quantity INTEGER),"SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE INVOICES (Order_Quantity INTEGER) ### question:Show the minimum, average, maximum order quantity of all invoices.","SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES" What are the distinct payment method codes in all the invoices?,CREATE TABLE INVOICES (payment_method_code VARCHAR),SELECT DISTINCT payment_method_code FROM INVOICES,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE INVOICES (payment_method_code VARCHAR) ### question:What are the distinct payment method codes in all the invoices?",SELECT DISTINCT payment_method_code FROM INVOICES What is the description of the marketing region China?,"CREATE TABLE Marketing_Regions (Marketing_Region_Descriptrion VARCHAR, Marketing_Region_Name VARCHAR)","SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = ""China""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Marketing_Regions (Marketing_Region_Descriptrion VARCHAR, Marketing_Region_Name VARCHAR) ### question:What is the description of the marketing region China?","SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = ""China""" Show all the distinct product names with price higher than the average.,"CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER)",SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) ### question:Show all the distinct product names with price higher than the average.",SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS) What is the name of the most expensive product?,"CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price VARCHAR)",SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price VARCHAR) ### question:What is the name of the most expensive product?",SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1 What is the phone number of the performer Ashley?,"CREATE TABLE PERFORMERS (Customer_Phone VARCHAR, Customer_Name VARCHAR)","SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = ""Ashley""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PERFORMERS (Customer_Phone VARCHAR, Customer_Name VARCHAR) ### question:What is the phone number of the performer Ashley?","SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = ""Ashley""" Show all payment method codes and the number of orders for each code.,CREATE TABLE INVOICES (payment_method_code VARCHAR),"SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE INVOICES (payment_method_code VARCHAR) ### question:Show all payment method codes and the number of orders for each code.","SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code" What is the payment method code used by the most orders?,CREATE TABLE INVOICES (payment_method_code VARCHAR),SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE INVOICES (payment_method_code VARCHAR) ### question:What is the payment method code used by the most orders?",SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1 "Which city is the address of the store named ""FJA Filming"" located in?","CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Store_Name VARCHAR)","SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = ""FJA Filming""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Store_Name VARCHAR) ### question:Which city is the address of the store named ""FJA Filming"" located in?","SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = ""FJA Filming""" "What are the states or counties of the address of the stores with marketing region code ""CA""?","CREATE TABLE Addresses (State_County VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Marketing_Region_Code VARCHAR)","SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = ""CA""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (State_County VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Marketing_Region_Code VARCHAR) ### question:What are the states or counties of the address of the stores with marketing region code ""CA""?","SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = ""CA""" What is the name of the marketing region that the store Rob Dinning belongs to?,"CREATE TABLE Marketing_Regions (Marketing_Region_Name VARCHAR, Marketing_Region_Code VARCHAR); CREATE TABLE Stores (Marketing_Region_Code VARCHAR, Store_Name VARCHAR)","SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = ""Rob Dinning""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Marketing_Regions (Marketing_Region_Name VARCHAR, Marketing_Region_Code VARCHAR); CREATE TABLE Stores (Marketing_Region_Code VARCHAR, Store_Name VARCHAR) ### question:What is the name of the marketing region that the store Rob Dinning belongs to?","SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = ""Rob Dinning""" What are the descriptions of the service types with product price above 100?,"CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Price INTEGER); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR)",SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Price INTEGER); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) ### question:What are the descriptions of the service types with product price above 100?",SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 "What is the description, code and the corresponding count of each service type?","CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR)","SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) ### question:What is the description, code and the corresponding count of each service type?","SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code" What is the description and code of the type of service that is performed the most often?,"CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR)","SELECT T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) ### question:What is the description and code of the type of service that is performed the most often?","SELECT T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1" What are the phones and emails of workshop groups in which services are performed?,"CREATE TABLE Services (Workshop_Group_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR)","SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Services (Workshop_Group_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR) ### question:What are the phones and emails of workshop groups in which services are performed?","SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID" "What are the names of workshop groups in which services with product name ""film"" are performed?","CREATE TABLE Services (Workshop_Group_ID VARCHAR, Product_Name VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR)","SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = ""film""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Services (Workshop_Group_ID VARCHAR, Product_Name VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR) ### question:What are the names of workshop groups in which services with product name ""film"" are performed?","SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = ""film""" What are the different product names? What is the average product price for each of them?,"CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER)","SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) ### question:What are the different product names? What is the average product price for each of them?","SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name" What are the product names with average product price smaller than 1000000?,"CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER)",SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) ### question:What are the product names with average product price smaller than 1000000?",SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000 What are the total order quantities of photo products?,"CREATE TABLE ORDER_ITEMS (Order_Quantity INTEGER, Product_ID VARCHAR); CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR)","SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = ""photo""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ORDER_ITEMS (Order_Quantity INTEGER, Product_ID VARCHAR); CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR) ### question:What are the total order quantities of photo products?","SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = ""photo""" What are the order details of the products with price higher than 2000?,"CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Other_Item_Details VARCHAR, Product_ID VARCHAR)",SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Other_Item_Details VARCHAR, Product_ID VARCHAR) ### question:What are the order details of the products with price higher than 2000?",SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 What are the actual delivery dates of orders with quantity 1?,"CREATE TABLE Customer_Orders (Actual_Delivery_Date VARCHAR, Order_ID VARCHAR); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Order_Quantity VARCHAR)",SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customer_Orders (Actual_Delivery_Date VARCHAR, Order_ID VARCHAR); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Order_Quantity VARCHAR) ### question:What are the actual delivery dates of orders with quantity 1?",SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 What are the order dates of orders with price higher than 1000?,"CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Product_ID VARCHAR); CREATE TABLE Customer_Orders (Order_Date VARCHAR, Order_ID VARCHAR)",SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Product_ID VARCHAR); CREATE TABLE Customer_Orders (Order_Date VARCHAR, Order_ID VARCHAR) ### question:What are the order dates of orders with price higher than 1000?",SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000 How many distinct currency codes are there for all drama workshop groups?,CREATE TABLE Drama_Workshop_Groups (Currency_Code VARCHAR),SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Drama_Workshop_Groups (Currency_Code VARCHAR) ### question:How many distinct currency codes are there for all drama workshop groups?",SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups What are the names of the drama workshop groups with address in Feliciaberg city?,"CREATE TABLE Addresses (Address_ID VARCHAR, City_Town VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Address_ID VARCHAR)","SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = ""Feliciaberg""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (Address_ID VARCHAR, City_Town VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Address_ID VARCHAR) ### question:What are the names of the drama workshop groups with address in Feliciaberg city?","SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = ""Feliciaberg""" What are the email addresses of the drama workshop groups with address in Alaska state?,"CREATE TABLE Drama_Workshop_Groups (Store_Email_Address VARCHAR, Address_ID VARCHAR); CREATE TABLE Addresses (Address_ID VARCHAR, State_County VARCHAR)","SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = ""Alaska""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Drama_Workshop_Groups (Store_Email_Address VARCHAR, Address_ID VARCHAR); CREATE TABLE Addresses (Address_ID VARCHAR, State_County VARCHAR) ### question:What are the email addresses of the drama workshop groups with address in Alaska state?","SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = ""Alaska""" Show all cities along with the number of drama workshop groups in each city.,"CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Address_ID VARCHAR)","SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Address_ID VARCHAR) ### question:Show all cities along with the number of drama workshop groups in each city.","SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town" What is the marketing region code that has the most drama workshop groups?,CREATE TABLE Drama_Workshop_Groups (Marketing_Region_Code VARCHAR),SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Drama_Workshop_Groups (Marketing_Region_Code VARCHAR) ### question:What is the marketing region code that has the most drama workshop groups?",SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC LIMIT 1 Show all cities where at least one customer lives in but no performer lives in.,"CREATE TABLE Customers (Address_ID VARCHAR); CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Performers (Address_ID VARCHAR)",SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (Address_ID VARCHAR); CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Performers (Address_ID VARCHAR) ### question:Show all cities where at least one customer lives in but no performer lives in.",SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID What is the most frequent status of bookings?,CREATE TABLE BOOKINGS (Status_Code VARCHAR),SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE BOOKINGS (Status_Code VARCHAR) ### question:What is the most frequent status of bookings?",SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1 "What are the names of the workshop groups that have bookings with status code ""stop""?","CREATE TABLE Bookings (Workshop_Group_ID VARCHAR, Status_Code VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Workshop_Group_ID VARCHAR)","SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = ""stop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Bookings (Workshop_Group_ID VARCHAR, Status_Code VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Workshop_Group_ID VARCHAR) ### question:What are the names of the workshop groups that have bookings with status code ""stop""?","SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = ""stop""" Show the names of all the clients with no booking.,"CREATE TABLE Clients (Customer_Name VARCHAR, Client_ID VARCHAR); CREATE TABLE Bookings (Customer_ID VARCHAR); CREATE TABLE Clients (Customer_Name VARCHAR)",SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Clients (Customer_Name VARCHAR, Client_ID VARCHAR); CREATE TABLE Bookings (Customer_ID VARCHAR); CREATE TABLE Clients (Customer_Name VARCHAR) ### question:Show the names of all the clients with no booking.",SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID "What is the average quantities ordered with payment method code ""MasterCard"" on invoices?","CREATE TABLE Invoices (Order_Quantity INTEGER, payment_method_code VARCHAR)","SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = ""MasterCard""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Invoices (Order_Quantity INTEGER, payment_method_code VARCHAR) ### question:What is the average quantities ordered with payment method code ""MasterCard"" on invoices?","SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = ""MasterCard""" What is the product ID of the most frequently ordered item on invoices?,CREATE TABLE INVOICES (Product_ID VARCHAR),SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE INVOICES (Product_ID VARCHAR) ### question:What is the product ID of the most frequently ordered item on invoices?",SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1 What is the description of the service type which offers both the photo product and the film product?,"CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR); CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Name VARCHAR)",SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR); CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Name VARCHAR) ### question:What is the description of the service type which offers both the photo product and the film product?",SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film' How many bands are there?,CREATE TABLE Band (Id VARCHAR),SELECT COUNT(*) FROM Band,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Band (Id VARCHAR) ### question:How many bands are there?",SELECT COUNT(*) FROM Band What are all the labels?,CREATE TABLE Albums (label VARCHAR),SELECT DISTINCT label FROM Albums,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Albums (label VARCHAR) ### question:What are all the labels?",SELECT DISTINCT label FROM Albums Find all the albums in 2012.,CREATE TABLE Albums (YEAR VARCHAR),SELECT * FROM Albums WHERE YEAR = 2012,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Albums (YEAR VARCHAR) ### question:Find all the albums in 2012.",SELECT * FROM Albums WHERE YEAR = 2012 "Find all the stage positions of the musicians with first name ""Solveig""","CREATE TABLE Band (id VARCHAR); CREATE TABLE Performance (stageposition VARCHAR, bandmate VARCHAR)","SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = ""Solveig""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Band (id VARCHAR); CREATE TABLE Performance (stageposition VARCHAR, bandmate VARCHAR) ### question:Find all the stage positions of the musicians with first name ""Solveig""","SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = ""Solveig""" How many songs are there?,CREATE TABLE Songs (Id VARCHAR),SELECT COUNT(*) FROM Songs,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Songs (Id VARCHAR) ### question:How many songs are there?",SELECT COUNT(*) FROM Songs "Find all the songs performed by artist with last name ""Heilo""","CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, Lastname VARCHAR)","SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = ""Heilo""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, Lastname VARCHAR) ### question:Find all the songs performed by artist with last name ""Heilo""","SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = ""Heilo""" "Hom many musicians performed in the song ""Flash""?","CREATE TABLE performance (bandmate VARCHAR, songid VARCHAR); CREATE TABLE songs (songid VARCHAR, Title VARCHAR); CREATE TABLE band (id VARCHAR)","SELECT COUNT(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = ""Flash""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE performance (bandmate VARCHAR, songid VARCHAR); CREATE TABLE songs (songid VARCHAR, Title VARCHAR); CREATE TABLE band (id VARCHAR) ### question:Hom many musicians performed in the song ""Flash""?","SELECT COUNT(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = ""Flash""" "Find all the songs produced by artists with first name ""Marianne"".","CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, firstname VARCHAR)","SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = ""Marianne""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, firstname VARCHAR) ### question:Find all the songs produced by artists with first name ""Marianne"".","SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = ""Marianne""" "Who performed the song named ""Badlands""? Show the first name and the last name.","CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Badlands""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) ### question:Who performed the song named ""Badlands""? Show the first name and the last name.","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Badlands""" "Who is performing in the back stage position for the song ""Badlands""? Show the first name and the last name.","CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Badlands"" AND T1.StagePosition = ""back""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) ### question:Who is performing in the back stage position for the song ""Badlands""? Show the first name and the last name.","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Badlands"" AND T1.StagePosition = ""back""" How many unique labels are there for albums?,CREATE TABLE albums (label VARCHAR),SELECT COUNT(DISTINCT label) FROM albums,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE albums (label VARCHAR) ### question:How many unique labels are there for albums?",SELECT COUNT(DISTINCT label) FROM albums What is the label that has the most albums?,CREATE TABLE albums (label VARCHAR),SELECT label FROM albums GROUP BY label ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE albums (label VARCHAR) ### question:What is the label that has the most albums?",SELECT label FROM albums GROUP BY label ORDER BY COUNT(*) DESC LIMIT 1 What is the last name of the musician that have produced the most number of songs?,"CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR)",SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR) ### question:What is the last name of the musician that have produced the most number of songs?",SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1 What is the last name of the musician that has been at the back position the most?,"CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR)","SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = ""back"" GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR) ### question:What is the last name of the musician that has been at the back position the most?","SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = ""back"" GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1" "Find all the songs whose name contains the word ""the"".",CREATE TABLE songs (title VARCHAR),SELECT title FROM songs WHERE title LIKE '% the %',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE songs (title VARCHAR) ### question:Find all the songs whose name contains the word ""the"".",SELECT title FROM songs WHERE title LIKE '% the %' What are all the instruments used?,CREATE TABLE Instruments (instrument VARCHAR),SELECT DISTINCT instrument FROM Instruments,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Instruments (instrument VARCHAR) ### question:What are all the instruments used?",SELECT DISTINCT instrument FROM Instruments "What instrument did the musician with last name ""Heilo"" use in the song ""Le Pop""?","CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR)","SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = ""Heilo"" AND T3.title = ""Le Pop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR) ### question:What instrument did the musician with last name ""Heilo"" use in the song ""Le Pop""?","SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = ""Heilo"" AND T3.title = ""Le Pop""" What is the most used instrument?,CREATE TABLE instruments (instrument VARCHAR),SELECT instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE instruments (instrument VARCHAR) ### question:What is the most used instrument?",SELECT instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC LIMIT 1 "How many songs have used the instrument ""drums""?",CREATE TABLE instruments (instrument VARCHAR),"SELECT COUNT(*) FROM instruments WHERE instrument = ""drums""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE instruments (instrument VARCHAR) ### question:How many songs have used the instrument ""drums""?","SELECT COUNT(*) FROM instruments WHERE instrument = ""drums""" "What instruments does the the song ""Le Pop"" use?",CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:What instruments does the the song ""Le Pop"" use?","SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""" "How many instruments does the song ""Le Pop"" use?",CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:How many instruments does the song ""Le Pop"" use?","SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""" "How many instrument does the musician with last name ""Heilo"" use?","CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR)","SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = ""Heilo""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR) ### question:How many instrument does the musician with last name ""Heilo"" use?","SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = ""Heilo""" "Find all the instruments ever used by the musician with last name ""Heilo""?","CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR)","SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = ""Heilo""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR) ### question:Find all the instruments ever used by the musician with last name ""Heilo""?","SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = ""Heilo""" Which song has the most vocals?,CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:Which song has the most vocals?",SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC LIMIT 1 Which vocal type is the most frequently appearring type?,CREATE TABLE vocals (TYPE VARCHAR),SELECT TYPE FROM vocals GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (TYPE VARCHAR) ### question:Which vocal type is the most frequently appearring type?",SELECT TYPE FROM vocals GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 "Which vocal type has the band mate with last name ""Heilo"" played the most?",CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR),"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = ""Heilo"" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR) ### question:Which vocal type has the band mate with last name ""Heilo"" played the most?","SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = ""Heilo"" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1" "What are the vocal types used in song ""Le Pop""?",CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:What are the vocal types used in song ""Le Pop""?","SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""" "Find the number of vocal types used in song ""Demon Kitty Rag""?",CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Demon Kitty Rag""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:Find the number of vocal types used in song ""Demon Kitty Rag""?","SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Demon Kitty Rag""" How many songs have a lead vocal?,CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = ""lead""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:How many songs have a lead vocal?","SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = ""lead""" "Which vocal type did the musician with first name ""Solveig"" played in the song with title ""A Bar in Amsterdam""?","CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE band (id VARCHAR, firstname VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR)","SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = ""Solveig"" AND T2.title = ""A Bar In Amsterdam""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE band (id VARCHAR, firstname VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR) ### question:Which vocal type did the musician with first name ""Solveig"" played in the song with title ""A Bar in Amsterdam""?","SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = ""Solveig"" AND T2.title = ""A Bar In Amsterdam""" Find all the songs that do not have a lead vocal.,"CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR)","SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = ""lead""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR) ### question:Find all the songs that do not have a lead vocal.","SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = ""lead""" Find all the vocal types.,CREATE TABLE vocals (TYPE VARCHAR),SELECT DISTINCT TYPE FROM vocals,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (TYPE VARCHAR) ### question:Find all the vocal types.",SELECT DISTINCT TYPE FROM vocals What are the albums produced in year 2010?,CREATE TABLE Albums (YEAR VARCHAR),SELECT * FROM Albums WHERE YEAR = 2010,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Albums (YEAR VARCHAR) ### question:What are the albums produced in year 2010?",SELECT * FROM Albums WHERE YEAR = 2010 "Who performed the song named ""Le Pop""?","CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Le Pop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) ### question:Who performed the song named ""Le Pop""?","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Le Pop""" "What instrument did the musician with last name ""Heilo"" use in the song ""Badlands""?","CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR)","SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = ""Heilo"" AND T3.title = ""Badlands""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR) ### question:What instrument did the musician with last name ""Heilo"" use in the song ""Badlands""?","SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = ""Heilo"" AND T3.title = ""Badlands""" "How many instruments does the song ""Badlands"" use?",CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Badlands""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:How many instruments does the song ""Badlands"" use?","SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Badlands""" "What are the vocal types used in song ""Badlands""?",CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Badlands""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:What are the vocal types used in song ""Badlands""?","SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Badlands""" "Find the number of vocal types used in song ""Le Pop""",CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:Find the number of vocal types used in song ""Le Pop""","SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""" How many songs have a shared vocal?,CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR),"SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = ""shared""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) ### question:How many songs have a shared vocal?","SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = ""shared""" Find all the songs that do not have a back vocal.,"CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR)","SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = ""back""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR) ### question:Find all the songs that do not have a back vocal.","SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = ""back""" "Which vocal type has the band mate with first name ""Solveig"" played the most?",CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR),"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = ""Solveig"" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR) ### question:Which vocal type has the band mate with first name ""Solveig"" played the most?","SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = ""Solveig"" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1" "Which vocal type did the musician with last name ""Heilo"" played in the song with title ""Der Kapitan""?","CREATE TABLE band (id VARCHAR, lastname VARCHAR); CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR)","SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = ""Heilo"" AND T2.title = ""Der Kapitan""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE band (id VARCHAR, lastname VARCHAR); CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR) ### question:Which vocal type did the musician with last name ""Heilo"" played in the song with title ""Der Kapitan""?","SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = ""Heilo"" AND T2.title = ""Der Kapitan""" Find the first name of the band mate that has performed in most songs.,"CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (firstname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR)",SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (firstname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR) ### question:Find the first name of the band mate that has performed in most songs.",SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY COUNT(*) DESC LIMIT 1 "Which vocal type has the band mate with first name ""Marianne"" played the most?",CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR),"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = ""Marianne"" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR) ### question:Which vocal type has the band mate with first name ""Marianne"" played the most?","SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = ""Marianne"" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1" "Who is performing in the back stage position for the song ""Der Kapitan""? Show the first name and last name.","CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Der Kapitan"" AND T1.StagePosition = ""back""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) ### question:Who is performing in the back stage position for the song ""Der Kapitan""? Show the first name and last name.","SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Der Kapitan"" AND T1.StagePosition = ""back""" "What are the songs in album ""A Kiss Before You Go: Live in Hamburg""?","CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR, title VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR)","SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = ""A Kiss Before You Go: Live in Hamburg""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR, title VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR) ### question:What are the songs in album ""A Kiss Before You Go: Live in Hamburg""?","SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = ""A Kiss Before You Go: Live in Hamburg""" "What are all the songs in albums under label ""Universal Music Group""?","CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR)","SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = ""Universal Music Group""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR) ### question:What are all the songs in albums under label ""Universal Music Group""?","SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = ""Universal Music Group""" Find the number of songs in all the studio albums.,"CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR)","SELECT COUNT(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = ""Studio""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR) ### question:Find the number of songs in all the studio albums.","SELECT COUNT(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = ""Studio""" Who is the founder of Sony?,"CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR)",SELECT founder FROM manufacturers WHERE name = 'Sony',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR) ### question:Who is the founder of Sony?",SELECT founder FROM manufacturers WHERE name = 'Sony' Where is the headquarter of the company founded by James?,"CREATE TABLE manufacturers (headquarter VARCHAR, founder VARCHAR)",SELECT headquarter FROM manufacturers WHERE founder = 'James',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (headquarter VARCHAR, founder VARCHAR) ### question:Where is the headquarter of the company founded by James?",SELECT headquarter FROM manufacturers WHERE founder = 'James' "Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.","CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR)","SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR) ### question:Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.","SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC" "What are the average, maximum and total revenues of all companies?",CREATE TABLE manufacturers (revenue INTEGER),"SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (revenue INTEGER) ### question:What are the average, maximum and total revenues of all companies?","SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers" How many companies were created by Andy?,CREATE TABLE manufacturers (founder VARCHAR),SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (founder VARCHAR) ### question:How many companies were created by Andy?",SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy' Find the total revenue created by the companies whose headquarter is located at Austin.,"CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR)",SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR) ### question:Find the total revenue created by the companies whose headquarter is located at Austin.",SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin' What are the different cities listed?,CREATE TABLE manufacturers (headquarter VARCHAR),SELECT DISTINCT headquarter FROM manufacturers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (headquarter VARCHAR) ### question:What are the different cities listed?",SELECT DISTINCT headquarter FROM manufacturers Find the number of manufactures that are based in Tokyo or Beijing.,CREATE TABLE manufacturers (headquarter VARCHAR),SELECT COUNT(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (headquarter VARCHAR) ### question:Find the number of manufactures that are based in Tokyo or Beijing.",SELECT COUNT(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing' Find the founder of the company whose name begins with the letter 'S'.,"CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR)",SELECT founder FROM manufacturers WHERE name LIKE 'S%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR) ### question:Find the founder of the company whose name begins with the letter 'S'.",SELECT founder FROM manufacturers WHERE name LIKE 'S%' Find the name of companies whose revenue is between 100 and 150.,"CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER)",SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER) ### question:Find the name of companies whose revenue is between 100 and 150.",SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150 What is the total revenue of all companies whose main office is at Tokyo or Taiwan?,"CREATE TABLE manufacturers (revenue INTEGER, Headquarter VARCHAR)",SELECT SUM(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (revenue INTEGER, Headquarter VARCHAR) ### question:What is the total revenue of all companies whose main office is at Tokyo or Taiwan?",SELECT SUM(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan' Find the name of product that is produced by both companies Creative Labs and Sony.,"CREATE TABLE manufacturers (code VARCHAR, name VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR)",SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (code VARCHAR, name VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR) ### question:Find the name of product that is produced by both companies Creative Labs and Sony.",SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony' "Find the name, headquarter and founder of the manufacturer that has the highest revenue.","CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, founder VARCHAR, revenue VARCHAR)","SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, founder VARCHAR, revenue VARCHAR) ### question:Find the name, headquarter and founder of the manufacturer that has the highest revenue.","SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1" "Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.","CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR)","SELECT name, headquarter, revenue FROM manufacturers ORDER BY revenue DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR) ### question:Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.","SELECT name, headquarter, revenue FROM manufacturers ORDER BY revenue DESC" Find the name of companies whose revenue is greater than the average revenue of all companies.,"CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER)",SELECT name FROM manufacturers WHERE revenue > (SELECT AVG(revenue) FROM manufacturers),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER) ### question:Find the name of companies whose revenue is greater than the average revenue of all companies.",SELECT name FROM manufacturers WHERE revenue > (SELECT AVG(revenue) FROM manufacturers) Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.,"CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER, headquarter VARCHAR)",SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER, headquarter VARCHAR) ### question:Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.",SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin') Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.,"CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR)",SELECT SUM(revenue) FROM manufacturers WHERE revenue > (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR) ### question:Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.",SELECT SUM(revenue) FROM manufacturers WHERE revenue > (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin') Find the total revenue of companies of each founder.,"CREATE TABLE manufacturers (founder VARCHAR, revenue INTEGER)","SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (founder VARCHAR, revenue INTEGER) ### question:Find the total revenue of companies of each founder.","SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder" Find the name and revenue of the company that earns the highest revenue in each city.,"CREATE TABLE manufacturers (name VARCHAR, Headquarter VARCHAR, revenue INTEGER)","SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, Headquarter VARCHAR, revenue INTEGER) ### question:Find the name and revenue of the company that earns the highest revenue in each city.","SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter" Find the total revenue for each manufacturer.,"CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER)","SELECT SUM(revenue), name FROM manufacturers GROUP BY name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER) ### question:Find the total revenue for each manufacturer.","SELECT SUM(revenue), name FROM manufacturers GROUP BY name" "Find the average prices of all products from each manufacture, and list each company's name.","CREATE TABLE products (price INTEGER, Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR)","SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (price INTEGER, Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR) ### question:Find the average prices of all products from each manufacture, and list each company's name.","SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name" Find the number of different products that are produced by companies at different headquarter cities.,"CREATE TABLE manufacturers (Headquarter VARCHAR, code VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR)","SELECT COUNT(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (Headquarter VARCHAR, code VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR) ### question:Find the number of different products that are produced by companies at different headquarter cities.","SELECT COUNT(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter" Find number of products which Sony does not make.,"CREATE TABLE manufacturers (code VARCHAR, name VARCHAR); CREATE TABLE products (name VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR)",SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (code VARCHAR, name VARCHAR); CREATE TABLE products (name VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR) ### question:Find number of products which Sony does not make.",SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony') Find the name of companies that do not make DVD drive.,"CREATE TABLE manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Manufacturer VARCHAR, name VARCHAR); CREATE TABLE manufacturers (name VARCHAR)",SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Manufacturer VARCHAR, name VARCHAR); CREATE TABLE manufacturers (name VARCHAR) ### question:Find the name of companies that do not make DVD drive.",SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive' "Find the number of products for each manufacturer, showing the name of each company.","CREATE TABLE products (Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR)","SELECT COUNT(*), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR) ### question:Find the number of products for each manufacturer, showing the name of each company.","SELECT COUNT(*), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name" Select the names of all the products in the store.,CREATE TABLE Products (Name VARCHAR),SELECT Name FROM Products,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Name VARCHAR) ### question:Select the names of all the products in the store.",SELECT Name FROM Products Select the names and the prices of all the products in the store.,"CREATE TABLE products (name VARCHAR, price VARCHAR)","SELECT name, price FROM products","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (name VARCHAR, price VARCHAR) ### question:Select the names and the prices of all the products in the store.","SELECT name, price FROM products" Select the name of the products with a price less than or equal to $200.,"CREATE TABLE products (name VARCHAR, price VARCHAR)",SELECT name FROM products WHERE price <= 200,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (name VARCHAR, price VARCHAR) ### question:Select the name of the products with a price less than or equal to $200.",SELECT name FROM products WHERE price <= 200 Find all information of all the products with a price between $60 and $120.,CREATE TABLE products (price INTEGER),SELECT * FROM products WHERE price BETWEEN 60 AND 120,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (price INTEGER) ### question:Find all information of all the products with a price between $60 and $120.",SELECT * FROM products WHERE price BETWEEN 60 AND 120 Compute the average price of all the products.,CREATE TABLE products (price INTEGER),SELECT AVG(price) FROM products,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (price INTEGER) ### question:Compute the average price of all the products.",SELECT AVG(price) FROM products Compute the average price of all products with manufacturer code equal to 2.,"CREATE TABLE products (price INTEGER, Manufacturer VARCHAR)",SELECT AVG(price) FROM products WHERE Manufacturer = 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (price INTEGER, Manufacturer VARCHAR) ### question:Compute the average price of all products with manufacturer code equal to 2.",SELECT AVG(price) FROM products WHERE Manufacturer = 2 Compute the number of products with a price larger than or equal to $180.,CREATE TABLE products (price VARCHAR),SELECT COUNT(*) FROM products WHERE price >= 180,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (price VARCHAR) ### question:Compute the number of products with a price larger than or equal to $180.",SELECT COUNT(*) FROM products WHERE price >= 180 "Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).","CREATE TABLE products (name VARCHAR, price VARCHAR)","SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (name VARCHAR, price VARCHAR) ### question:Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).","SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name" Select all the data from the products and each product's manufacturer.,CREATE TABLE products (manufacturer VARCHAR); CREATE TABLE Manufacturers (code VARCHAR),SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (manufacturer VARCHAR); CREATE TABLE Manufacturers (code VARCHAR) ### question:Select all the data from the products and each product's manufacturer.",SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code "Select the average price of each manufacturer's products, showing only the manufacturer's code.","CREATE TABLE Products (Manufacturer VARCHAR, Price INTEGER)","SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (Manufacturer VARCHAR, Price INTEGER) ### question:Select the average price of each manufacturer's products, showing only the manufacturer's code.","SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer" "Select the average price of each manufacturer's products, showing the manufacturer's name.","CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufacturer VARCHAR)","SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufacturer VARCHAR) ### question:Select the average price of each manufacturer's products, showing the manufacturer's name.","SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name" Select the names of manufacturer whose products have an average price higher than or equal to $150.,"CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufacturer VARCHAR, price INTEGER)","SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufacturer VARCHAR, price INTEGER) ### question:Select the names of manufacturer whose products have an average price higher than or equal to $150.","SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150" Select the name and price of the cheapest product.,"CREATE TABLE Products (name VARCHAR, price VARCHAR)","SELECT name, price FROM Products ORDER BY price LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Products (name VARCHAR, price VARCHAR) ### question:Select the name and price of the cheapest product.","SELECT name, price FROM Products ORDER BY price LIMIT 1" Select the name of each manufacturer along with the name and price of its most expensive product.,"CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Name VARCHAR, Price INTEGER, manufacturer VARCHAR)","SELECT T1.Name, MAX(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Name VARCHAR, Price INTEGER, manufacturer VARCHAR) ### question:Select the name of each manufacturer along with the name and price of its most expensive product.","SELECT T1.Name, MAX(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name" Select the code of the product that is cheapest in each product category.,"CREATE TABLE products (code VARCHAR, name VARCHAR, price INTEGER)","SELECT code, name, MIN(price) FROM products GROUP BY name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (code VARCHAR, name VARCHAR, price INTEGER) ### question:Select the code of the product that is cheapest in each product category.","SELECT code, name, MIN(price) FROM products GROUP BY name" What is the id of the problem log that is created most recently?,"CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR)",SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR) ### question:What is the id of the problem log that is created most recently?",SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1 What is the oldest log id and its corresponding problem id?,"CREATE TABLE problem_log (problem_log_id VARCHAR, problem_id VARCHAR, log_entry_date VARCHAR)","SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problem_log (problem_log_id VARCHAR, problem_id VARCHAR, log_entry_date VARCHAR) ### question:What is the oldest log id and its corresponding problem id?","SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1" Find all the ids and dates of the logs for the problem whose id is 10.,"CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR, problem_id VARCHAR)","SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR, problem_id VARCHAR) ### question:Find all the ids and dates of the logs for the problem whose id is 10.","SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10" List all the log ids and their descriptions from the problem logs.,"CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_description VARCHAR)","SELECT problem_log_id, log_entry_description FROM problem_log","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_description VARCHAR) ### question:List all the log ids and their descriptions from the problem logs.","SELECT problem_log_id, log_entry_description FROM problem_log" List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.,"CREATE TABLE problem_log (assigned_to_staff_id VARCHAR, problem_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR)","SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problem_log (assigned_to_staff_id VARCHAR, problem_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR) ### question:List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.","SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1" List the problem id and log id which are assigned to the staff named Rylan Homenick.,"CREATE TABLE problem_log (problem_id VARCHAR, problem_log_id VARCHAR, assigned_to_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR)","SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = ""Rylan"" AND T1.staff_last_name = ""Homenick""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problem_log (problem_id VARCHAR, problem_log_id VARCHAR, assigned_to_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR) ### question:List the problem id and log id which are assigned to the staff named Rylan Homenick.","SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = ""Rylan"" AND T1.staff_last_name = ""Homenick""" How many problems are there for product voluptatem?,"CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR, product_name VARCHAR)","SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = ""voluptatem""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR, product_name VARCHAR) ### question:How many problems are there for product voluptatem?","SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = ""voluptatem""" How many problems does the product with the most problems have? List the number of the problems and product name.,"CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, product_id VARCHAR)","SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, product_id VARCHAR) ### question:How many problems does the product with the most problems have? List the number of the problems and product name.","SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1" Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.,"CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR); CREATE TABLE problems (problem_description VARCHAR, reported_by_staff_id VARCHAR)","SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Christop""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR); CREATE TABLE problems (problem_description VARCHAR, reported_by_staff_id VARCHAR) ### question:Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.","SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Christop""" Find the ids of the problems that are reported by the staff whose last name is Bosco.,"CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_last_name VARCHAR)","SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = ""Bosco""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_last_name VARCHAR) ### question:Find the ids of the problems that are reported by the staff whose last name is Bosco.","SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = ""Bosco""" What are the ids of the problems which are reported after 1978-06-26?,"CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER)","SELECT problem_id FROM problems WHERE date_problem_reported > ""1978-06-26""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER) ### question:What are the ids of the problems which are reported after 1978-06-26?","SELECT problem_id FROM problems WHERE date_problem_reported > ""1978-06-26""" What are the ids of the problems which are reported before 1978-06-26?,"CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER)","SELECT problem_id FROM problems WHERE date_problem_reported < ""1978-06-26""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER) ### question:What are the ids of the problems which are reported before 1978-06-26?","SELECT problem_id FROM problems WHERE date_problem_reported < ""1978-06-26""" "For each product which has problems, what are the number of problems and the product id?",CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR),"SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR) ### question:For each product which has problems, what are the number of problems and the product id?","SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id" "For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?","CREATE TABLE product (product_id VARCHAR); CREATE TABLE problems (product_id VARCHAR, date_problem_reported INTEGER)","SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > ""1986-11-13"" GROUP BY T2.product_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product_id VARCHAR); CREATE TABLE problems (product_id VARCHAR, date_problem_reported INTEGER) ### question:For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?","SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > ""1986-11-13"" GROUP BY T2.product_id" List the names of all the distinct product names in alphabetical order?,CREATE TABLE product (product_name VARCHAR),SELECT DISTINCT product_name FROM product ORDER BY product_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product_name VARCHAR) ### question:List the names of all the distinct product names in alphabetical order?",SELECT DISTINCT product_name FROM product ORDER BY product_name List all the distinct product names ordered by product id?,"CREATE TABLE product (product_name VARCHAR, product_id VARCHAR)",SELECT DISTINCT product_name FROM product ORDER BY product_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product_name VARCHAR, product_id VARCHAR) ### question:List all the distinct product names ordered by product id?",SELECT DISTINCT product_name FROM product ORDER BY product_id What are the id of problems reported by the staff named Dameon Frami or Jolie Weber?,"CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR)","SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Dameon"" AND T2.staff_last_name = ""Frami"" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Jolie"" AND T2.staff_last_name = ""Weber""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR) ### question:What are the id of problems reported by the staff named Dameon Frami or Jolie Weber?","SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Dameon"" AND T2.staff_last_name = ""Frami"" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Jolie"" AND T2.staff_last_name = ""Weber""" What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?,"CREATE TABLE problems (reported_by_staff_id VARCHAR, closure_authorised_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR)","SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Christop"" AND T2.staff_last_name = ""Berge"" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Ashley"" AND T2.staff_last_name = ""Medhurst""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (reported_by_staff_id VARCHAR, closure_authorised_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR) ### question:What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?","SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Christop"" AND T2.staff_last_name = ""Berge"" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Ashley"" AND T2.staff_last_name = ""Medhurst""" What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte?,"CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR)","SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < (SELECT MIN(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = ""Lysanne"" AND T4.staff_last_name = ""Turcotte"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR) ### question:What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte?","SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < (SELECT MIN(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = ""Lysanne"" AND T4.staff_last_name = ""Turcotte"")" What are the ids of the problems reported after the date of any problems reported by Rylan Homenick?,"CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR)","SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > (SELECT MAX(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = ""Rylan"" AND T4.staff_last_name = ""Homenick"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR) ### question:What are the ids of the problems reported after the date of any problems reported by Rylan Homenick?","SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > (SELECT MAX(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = ""Rylan"" AND T4.staff_last_name = ""Homenick"")" Find the top 3 products which have the largest number of problems?,"CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, product_id VARCHAR)",SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY COUNT(*) DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, product_id VARCHAR) ### question:Find the top 3 products which have the largest number of problems?",SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY COUNT(*) DESC LIMIT 3 "List the ids of the problems from the product ""voluptatem"" that are reported after 1995?","CREATE TABLE problems (problem_id VARCHAR, product_id VARCHAR, date_problem_reported VARCHAR); CREATE TABLE product (product_id VARCHAR, product_name VARCHAR)","SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = ""voluptatem"" AND T1.date_problem_reported > ""1995""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE problems (problem_id VARCHAR, product_id VARCHAR, date_problem_reported VARCHAR); CREATE TABLE product (product_id VARCHAR, product_name VARCHAR) ### question:List the ids of the problems from the product ""voluptatem"" that are reported after 1995?","SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = ""voluptatem"" AND T1.date_problem_reported > ""1995""" "Find the first and last name of the staff members who reported problems from the product ""rem"" but not ""aut""?","CREATE TABLE product (product_name VARCHAR, product_id VARCHAR); CREATE TABLE staff (staff_first_name VARCHAR, staff_last_name VARCHAR, staff_id VARCHAR); CREATE TABLE problems (product_id VARCHAR, reported_by_staff_id VARCHAR)","SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = ""rem"" EXCEPT SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = ""aut""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product_name VARCHAR, product_id VARCHAR); CREATE TABLE staff (staff_first_name VARCHAR, staff_last_name VARCHAR, staff_id VARCHAR); CREATE TABLE problems (product_id VARCHAR, reported_by_staff_id VARCHAR) ### question:Find the first and last name of the staff members who reported problems from the product ""rem"" but not ""aut""?","SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = ""rem"" EXCEPT SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = ""aut""" Find the products which have problems reported by both Lacey Bosco and Kenton Champlin?,"CREATE TABLE product (product_name VARCHAR, product_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (product_id VARCHAR, reported_by_staff_id VARCHAR)","SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = ""Lacey"" AND T3.staff_last_name = ""Bosco"" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = ""Kenton"" AND T3.staff_last_name = ""Champlin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product (product_name VARCHAR, product_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (product_id VARCHAR, reported_by_staff_id VARCHAR) ### question:Find the products which have problems reported by both Lacey Bosco and Kenton Champlin?","SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = ""Lacey"" AND T3.staff_last_name = ""Bosco"" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = ""Kenton"" AND T3.staff_last_name = ""Champlin""" How many branches where have more than average number of memberships are there?,CREATE TABLE branch (membership_amount INTEGER),SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (membership_amount INTEGER) ### question:How many branches where have more than average number of memberships are there?",SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch) "Show name, address road, and city for all branches sorted by open year.","CREATE TABLE branch (name VARCHAR, address_road VARCHAR, city VARCHAR, open_year VARCHAR)","SELECT name, address_road, city FROM branch ORDER BY open_year","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (name VARCHAR, address_road VARCHAR, city VARCHAR, open_year VARCHAR) ### question:Show name, address road, and city for all branches sorted by open year.","SELECT name, address_road, city FROM branch ORDER BY open_year" What are names for top three branches with most number of membership?,"CREATE TABLE branch (name VARCHAR, membership_amount VARCHAR)",SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (name VARCHAR, membership_amount VARCHAR) ### question:What are names for top three branches with most number of membership?",SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3 Show all distinct city where branches with at least 100 memberships are located.,"CREATE TABLE branch (city VARCHAR, membership_amount VARCHAR)",SELECT DISTINCT city FROM branch WHERE membership_amount >= 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (city VARCHAR, membership_amount VARCHAR) ### question:Show all distinct city where branches with at least 100 memberships are located.",SELECT DISTINCT city FROM branch WHERE membership_amount >= 100 List all open years when at least two shops are opened.,CREATE TABLE branch (open_year VARCHAR),SELECT open_year FROM branch GROUP BY open_year HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (open_year VARCHAR) ### question:List all open years when at least two shops are opened.",SELECT open_year FROM branch GROUP BY open_year HAVING COUNT(*) >= 2 Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.,"CREATE TABLE branch (membership_amount INTEGER, open_year VARCHAR, city VARCHAR)","SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (membership_amount INTEGER, open_year VARCHAR, city VARCHAR) ### question:Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.","SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'" Show the city and the number of branches opened before 2010 for each city.,"CREATE TABLE branch (city VARCHAR, open_year INTEGER)","SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (city VARCHAR, open_year INTEGER) ### question:Show the city and the number of branches opened before 2010 for each city.","SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city" How many different levels do members have?,CREATE TABLE member (LEVEL VARCHAR),SELECT COUNT(DISTINCT LEVEL) FROM member,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (LEVEL VARCHAR) ### question:How many different levels do members have?",SELECT COUNT(DISTINCT LEVEL) FROM member "Show card number, name, and hometown for all members in a descending order of level.","CREATE TABLE member (card_number VARCHAR, name VARCHAR, hometown VARCHAR, LEVEL VARCHAR)","SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (card_number VARCHAR, name VARCHAR, hometown VARCHAR, LEVEL VARCHAR) ### question:Show card number, name, and hometown for all members in a descending order of level.","SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC" Show the membership level with most number of members.,CREATE TABLE member (LEVEL VARCHAR),SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (LEVEL VARCHAR) ### question:Show the membership level with most number of members.",SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1 Show all member names and registered branch names sorted by register year.,"CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, member_id VARCHAR, register_year VARCHAR); CREATE TABLE branch (name VARCHAR, branch_id VARCHAR)","SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, member_id VARCHAR, register_year VARCHAR); CREATE TABLE branch (name VARCHAR, branch_id VARCHAR) ### question:Show all member names and registered branch names sorted by register year.","SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year" Show all branch names with the number of members in each branch registered after 2015.,"CREATE TABLE branch (name VARCHAR, branch_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, register_year INTEGER)","SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (name VARCHAR, branch_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, register_year INTEGER) ### question:Show all branch names with the number of members in each branch registered after 2015.","SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id" Show member names without any registered branch.,"CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (name VARCHAR, member_id VARCHAR)",SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (name VARCHAR, member_id VARCHAR) ### question:Show member names without any registered branch.",SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch) List the branch name and city without any registered members.,"CREATE TABLE membership_register_branch (name VARCHAR, city VARCHAR, branch_id VARCHAR); CREATE TABLE branch (name VARCHAR, city VARCHAR, branch_id VARCHAR)","SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE membership_register_branch (name VARCHAR, city VARCHAR, branch_id VARCHAR); CREATE TABLE branch (name VARCHAR, city VARCHAR, branch_id VARCHAR) ### question:List the branch name and city without any registered members.","SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)" What is the name and open year for the branch with most number of memberships registered in 2016?,"CREATE TABLE membership_register_branch (branch_id VARCHAR, register_year VARCHAR); CREATE TABLE branch (name VARCHAR, open_year VARCHAR, branch_id VARCHAR)","SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE membership_register_branch (branch_id VARCHAR, register_year VARCHAR); CREATE TABLE branch (name VARCHAR, open_year VARCHAR, branch_id VARCHAR) ### question:What is the name and open year for the branch with most number of memberships registered in 2016?","SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1" Show the member name and hometown who registered a branch in 2016.,"CREATE TABLE member (name VARCHAR, hometown VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (member_id VARCHAR, register_year VARCHAR)","SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (name VARCHAR, hometown VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (member_id VARCHAR, register_year VARCHAR) ### question:Show the member name and hometown who registered a branch in 2016.","SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016" Show all city with a branch opened in 2001 and a branch with more than 100 membership.,"CREATE TABLE branch (city VARCHAR, open_year VARCHAR, membership_amount VARCHAR)",SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (city VARCHAR, open_year VARCHAR, membership_amount VARCHAR) ### question:Show all city with a branch opened in 2001 and a branch with more than 100 membership.",SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100 Show all cities without a branch having more than 100 memberships.,"CREATE TABLE branch (city VARCHAR, membership_amount INTEGER)",SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE branch (city VARCHAR, membership_amount INTEGER) ### question:Show all cities without a branch having more than 100 memberships.",SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100 What is the sum of total pounds of purchase in year 2018 for all branches in London?,"CREATE TABLE purchase (branch_id VARCHAR, year VARCHAR); CREATE TABLE branch (branch_id VARCHAR, city VARCHAR)",SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE purchase (branch_id VARCHAR, year VARCHAR); CREATE TABLE branch (branch_id VARCHAR, city VARCHAR) ### question:What is the sum of total pounds of purchase in year 2018 for all branches in London?",SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018 What is the total number of purchases for members with level 6?,"CREATE TABLE member (member_id VARCHAR, level VARCHAR); CREATE TABLE purchase (member_id VARCHAR)",SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (member_id VARCHAR, level VARCHAR); CREATE TABLE purchase (member_id VARCHAR) ### question:What is the total number of purchases for members with level 6?",SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6 "Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.","CREATE TABLE member (member_id VARCHAR, Hometown VARCHAR); CREATE TABLE branch (name VARCHAR, branch_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, member_id VARCHAR)","SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (member_id VARCHAR, Hometown VARCHAR); CREATE TABLE branch (name VARCHAR, branch_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, member_id VARCHAR) ### question:Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.","SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia'" "list the card number of all members whose hometown address includes word ""Kentucky"".","CREATE TABLE member (card_number VARCHAR, Hometown VARCHAR)","SELECT card_number FROM member WHERE Hometown LIKE ""%Kentucky%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE member (card_number VARCHAR, Hometown VARCHAR) ### question:list the card number of all members whose hometown address includes word ""Kentucky"".","SELECT card_number FROM member WHERE Hometown LIKE ""%Kentucky%""" Find the number of students in total.,CREATE TABLE STUDENT (Id VARCHAR),SELECT COUNT(*) FROM STUDENT,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Id VARCHAR) ### question:Find the number of students in total.",SELECT COUNT(*) FROM STUDENT Find the number of voting records in total.,CREATE TABLE VOTING_RECORD (Id VARCHAR),SELECT COUNT(*) FROM VOTING_RECORD,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (Id VARCHAR) ### question:Find the number of voting records in total.",SELECT COUNT(*) FROM VOTING_RECORD Find the distinct number of president votes.,CREATE TABLE VOTING_RECORD (President_Vote VARCHAR),SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (President_Vote VARCHAR) ### question:Find the distinct number of president votes.",SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD Find the maximum age of all the students.,CREATE TABLE STUDENT (Age INTEGER),SELECT MAX(Age) FROM STUDENT,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Age INTEGER) ### question:Find the maximum age of all the students.",SELECT MAX(Age) FROM STUDENT Find the last names of students with major 50.,"CREATE TABLE STUDENT (LName VARCHAR, Major VARCHAR)",SELECT LName FROM STUDENT WHERE Major = 50,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (LName VARCHAR, Major VARCHAR) ### question:Find the last names of students with major 50.",SELECT LName FROM STUDENT WHERE Major = 50 Find the first names of students with age above 22.,"CREATE TABLE STUDENT (Fname VARCHAR, Age INTEGER)",SELECT Fname FROM STUDENT WHERE Age > 22,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, Age INTEGER) ### question:Find the first names of students with age above 22.",SELECT Fname FROM STUDENT WHERE Age > 22 What are the majors of male (sex is M) students?,"CREATE TABLE STUDENT (Major VARCHAR, Sex VARCHAR)","SELECT Major FROM STUDENT WHERE Sex = ""M""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Major VARCHAR, Sex VARCHAR) ### question:What are the majors of male (sex is M) students?","SELECT Major FROM STUDENT WHERE Sex = ""M""" What is the average age of female (sex is F) students?,"CREATE TABLE STUDENT (Age INTEGER, Sex VARCHAR)","SELECT AVG(Age) FROM STUDENT WHERE Sex = ""F""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Age INTEGER, Sex VARCHAR) ### question:What is the average age of female (sex is F) students?","SELECT AVG(Age) FROM STUDENT WHERE Sex = ""F""" What are the maximum and minimum age of students with major 600?,"CREATE TABLE STUDENT (Age INTEGER, Major VARCHAR)","SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Age INTEGER, Major VARCHAR) ### question:What are the maximum and minimum age of students with major 600?","SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600" "Who are the advisors for students that live in a city with city code ""BAL""?","CREATE TABLE STUDENT (Advisor VARCHAR, city_code VARCHAR)","SELECT Advisor FROM STUDENT WHERE city_code = ""BAL""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Advisor VARCHAR, city_code VARCHAR) ### question:Who are the advisors for students that live in a city with city code ""BAL""?","SELECT Advisor FROM STUDENT WHERE city_code = ""BAL""" What are the distinct secretary votes in the fall election cycle?,"CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, ELECTION_CYCLE VARCHAR)","SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = ""Fall""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, ELECTION_CYCLE VARCHAR) ### question:What are the distinct secretary votes in the fall election cycle?","SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = ""Fall""" What are the distinct president votes on 08/30/2015?,"CREATE TABLE VOTING_RECORD (PRESIDENT_Vote VARCHAR, Registration_Date VARCHAR)","SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = ""08/30/2015""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (PRESIDENT_Vote VARCHAR, Registration_Date VARCHAR) ### question:What are the distinct president votes on 08/30/2015?","SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = ""08/30/2015""" Report the distinct registration date and the election cycle.,"CREATE TABLE VOTING_RECORD (Registration_Date VARCHAR, Election_Cycle VARCHAR)","SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (Registration_Date VARCHAR, Election_Cycle VARCHAR) ### question:Report the distinct registration date and the election cycle.","SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD" Report the distinct president vote and the vice president vote.,"CREATE TABLE VOTING_RECORD (President_Vote VARCHAR, VICE_President_Vote VARCHAR)","SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (President_Vote VARCHAR, VICE_President_Vote VARCHAR) ### question:Report the distinct president vote and the vice president vote.","SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD" Find the distinct last names of the students who have class president votes.,"CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_President_VOTE VARCHAR)",SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_President_VOTE VARCHAR) ### question:Find the distinct last names of the students who have class president votes.",SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE Find the distinct first names of the students who have class senator votes.,"CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_Senator_VOTE VARCHAR)",SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_Senator_VOTE VARCHAR) ### question:Find the distinct first names of the students who have class senator votes.",SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE Find the distinct ages of students who have secretary votes in the fall election cycle.,"CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, Election_Cycle VARCHAR); CREATE TABLE STUDENT (Age VARCHAR, StuID VARCHAR)","SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = ""Fall""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, Election_Cycle VARCHAR); CREATE TABLE STUDENT (Age VARCHAR, StuID VARCHAR) ### question:Find the distinct ages of students who have secretary votes in the fall election cycle.","SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = ""Fall""" Find the distinct Advisor of students who have treasurer votes in the spring election cycle.,"CREATE TABLE STUDENT (Advisor VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR, Election_Cycle VARCHAR)","SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = ""Spring""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Advisor VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR, Election_Cycle VARCHAR) ### question:Find the distinct Advisor of students who have treasurer votes in the spring election cycle.","SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = ""Spring""" Find the distinct majors of students who have treasurer votes.,"CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR); CREATE TABLE STUDENT (Major VARCHAR, StuID VARCHAR)",SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR); CREATE TABLE STUDENT (Major VARCHAR, StuID VARCHAR) ### question:Find the distinct majors of students who have treasurer votes.",SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote Find the first and last names of all the female (sex is F) students who have president votes.,"CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, sex VARCHAR); CREATE TABLE VOTING_RECORD (President_VOTE VARCHAR)","SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = ""F""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, sex VARCHAR); CREATE TABLE VOTING_RECORD (President_VOTE VARCHAR) ### question:Find the first and last names of all the female (sex is F) students who have president votes.","SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = ""F""" Find the first and last name of all the students of age 18 who have vice president votes.,"CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, age VARCHAR); CREATE TABLE VOTING_RECORD (VICE_President_VOTE VARCHAR)","SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, age VARCHAR); CREATE TABLE VOTING_RECORD (VICE_President_VOTE VARCHAR) ### question:Find the first and last name of all the students of age 18 who have vice president votes.","SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18" How many male (sex is M) students have class senator votes in the fall election cycle?,"CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR); CREATE TABLE STUDENT (StuID VARCHAR, Sex VARCHAR)","SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = ""M"" AND T2.Election_Cycle = ""Fall""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR); CREATE TABLE STUDENT (StuID VARCHAR, Sex VARCHAR) ### question:How many male (sex is M) students have class senator votes in the fall election cycle?","SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = ""M"" AND T2.Election_Cycle = ""Fall""" Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.,"CREATE TABLE STUDENT (StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)","SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = ""NYC"" AND T2.Election_Cycle = ""Spring""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### question:Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.","SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = ""NYC"" AND T2.Election_Cycle = ""Spring""" "Find the average age of students who live in the city with code ""NYC"" and have secretary votes in the spring election cycle.","CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)","SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = ""NYC"" AND T2.Election_Cycle = ""Spring""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### question:Find the average age of students who live in the city with code ""NYC"" and have secretary votes in the spring election cycle.","SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = ""NYC"" AND T2.Election_Cycle = ""Spring""" Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.,"CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, Sex VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)","SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = ""F"" AND T2.Election_Cycle = ""Spring""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, Sex VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### question:Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.","SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = ""F"" AND T2.Election_Cycle = ""Spring""" Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.,"CREATE TABLE STUDENT (Fname VARCHAR, city_code VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (VICE_PRESIDENT_Vote VARCHAR)","SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = ""PIT""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Fname VARCHAR, city_code VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (VICE_PRESIDENT_Vote VARCHAR) ### question:Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.","SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = ""PIT""" Find the distinct last names of all the students who have president votes and whose advisor is not 2192.,"CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR)","SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = ""2192""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR) ### question:Find the distinct last names of all the students who have president votes and whose advisor is not 2192.","SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = ""2192""" Find the distinct last names of all the students who have president votes and whose advisor is 8741.,"CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR)","SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = ""8741""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR) ### question:Find the distinct last names of all the students who have president votes and whose advisor is 8741.","SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = ""8741""" "For each advisor, report the total number of students advised by him or her.",CREATE TABLE STUDENT (Advisor VARCHAR),"SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Advisor VARCHAR) ### question:For each advisor, report the total number of students advised by him or her.","SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor" Report all advisors that advise more than 2 students.,CREATE TABLE STUDENT (Advisor VARCHAR),SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Advisor VARCHAR) ### question:Report all advisors that advise more than 2 students.",SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2 Report all majors that have less than 3 students.,CREATE TABLE STUDENT (Major VARCHAR),SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Major VARCHAR) ### question:Report all majors that have less than 3 students.",SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3 "For each election cycle, report the number of voting records.",CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR),"SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### question:For each election cycle, report the number of voting records.","SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle" Which major has the most students?,"CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR)",SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR) ### question:Which major has the most students?",SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1 What is the most common major among female (sex is F) students?,"CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR, Sex VARCHAR)","SELECT Major FROM STUDENT WHERE Sex = ""F"" GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR, Sex VARCHAR) ### question:What is the most common major among female (sex is F) students?","SELECT Major FROM STUDENT WHERE Sex = ""F"" GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1" What is the city_code of the city that the most students live in?,CREATE TABLE STUDENT (city_code VARCHAR),SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE STUDENT (city_code VARCHAR) ### question:What is the city_code of the city that the most students live in?",SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1 How many products are there?,CREATE TABLE products (Id VARCHAR),SELECT COUNT(*) FROM products,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (Id VARCHAR) ### question:How many products are there?",SELECT COUNT(*) FROM products How many colors are there?,CREATE TABLE ref_colors (Id VARCHAR),SELECT COUNT(*) FROM ref_colors,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_colors (Id VARCHAR) ### question:How many colors are there?",SELECT COUNT(*) FROM ref_colors How many characteristics are there?,CREATE TABLE CHARACTERISTICS (Id VARCHAR),SELECT COUNT(*) FROM CHARACTERISTICS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (Id VARCHAR) ### question:How many characteristics are there?",SELECT COUNT(*) FROM CHARACTERISTICS What are the names and buying prices of all the products?,"CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR)","SELECT product_name, typical_buying_price FROM products","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR) ### question:What are the names and buying prices of all the products?","SELECT product_name, typical_buying_price FROM products" List the description of all the colors.,CREATE TABLE ref_colors (color_description VARCHAR),SELECT color_description FROM ref_colors,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_colors (color_description VARCHAR) ### question:List the description of all the colors.",SELECT color_description FROM ref_colors Find the names of all the product characteristics.,CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR),SELECT DISTINCT characteristic_name FROM CHARACTERISTICS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR) ### question:Find the names of all the product characteristics.",SELECT DISTINCT characteristic_name FROM CHARACTERISTICS "What are the names of products with category ""Spices""?","CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR)","SELECT product_name FROM products WHERE product_category_code = ""Spices""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR) ### question:What are the names of products with category ""Spices""?","SELECT product_name FROM products WHERE product_category_code = ""Spices""" "List the names, color descriptions and product descriptions of products with category ""Herbs"".","CREATE TABLE Ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_name VARCHAR, product_description VARCHAR, color_code VARCHAR)","SELECT T1.product_name, T2.color_description, T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = ""Herbs""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_name VARCHAR, product_description VARCHAR, color_code VARCHAR) ### question:List the names, color descriptions and product descriptions of products with category ""Herbs"".","SELECT T1.product_name, T2.color_description, T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = ""Herbs""" "How many products are there under the category ""Seeds""?",CREATE TABLE products (product_category_code VARCHAR),"SELECT COUNT(*) FROM products WHERE product_category_code = ""Seeds""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_category_code VARCHAR) ### question:How many products are there under the category ""Seeds""?","SELECT COUNT(*) FROM products WHERE product_category_code = ""Seeds""" "Find the number of products with category ""Spices"" and typically sold above 1000.","CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR)","SELECT COUNT(*) FROM products WHERE product_category_code = ""Spices"" AND typical_buying_price > 1000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR) ### question:Find the number of products with category ""Spices"" and typically sold above 1000.","SELECT COUNT(*) FROM products WHERE product_category_code = ""Spices"" AND typical_buying_price > 1000" "What is the category and typical buying price of the product with name ""cumin""?","CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR, product_name VARCHAR)","SELECT product_category_code, typical_buying_price FROM products WHERE product_name = ""cumin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR, product_name VARCHAR) ### question:What is the category and typical buying price of the product with name ""cumin""?","SELECT product_category_code, typical_buying_price FROM products WHERE product_name = ""cumin""" "Which category does the product named ""flax"" belong to?","CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)","SELECT product_category_code FROM products WHERE product_name = ""flax""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR) ### question:Which category does the product named ""flax"" belong to?","SELECT product_category_code FROM products WHERE product_name = ""flax""" What is the name of the product with the color description 'yellow'?,"CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR)",SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR) ### question:What is the name of the product with the color description 'yellow'?",SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow' Find the category descriptions of the products whose descriptions include letter 't'.,"CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_description VARCHAR)",SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_description VARCHAR) ### question:Find the category descriptions of the products whose descriptions include letter 't'.",SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' "What is the color description of the product with name ""catnip""?","CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR)","SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = ""catnip""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR) ### question:What is the color description of the product with name ""catnip""?","SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = ""catnip""" "What is the color code and description of the product named ""chervil""?","CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR)","SELECT t1.color_code, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = ""chervil""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR) ### question:What is the color code and description of the product named ""chervil""?","SELECT t1.color_code, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = ""chervil""" Find the id and color description of the products with at least 2 characteristics.,"CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR)","SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR) ### question:Find the id and color description of the products with at least 2 characteristics.","SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2" "List all the product names with the color description ""white"".","CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR)","SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = ""white""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR) ### question:List all the product names with the color description ""white"".","SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = ""white""" "What are the name and typical buying and selling prices of the products that have color described as ""yellow""?","CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR, typical_selling_price VARCHAR, color_code VARCHAR)","SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = ""yellow""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR, typical_selling_price VARCHAR, color_code VARCHAR) ### question:What are the name and typical buying and selling prices of the products that have color described as ""yellow""?","SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = ""yellow""" "How many characteristics does the product named ""sesame"" have?","CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR)","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = ""sesame""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR) ### question:How many characteristics does the product named ""sesame"" have?","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = ""sesame""" "How many distinct characteristic names does the product ""cumin"" have?","CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:How many distinct characteristic names does the product ""cumin"" have?","SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame""" "What are all the characteristic names of product ""sesame""?","CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:What are all the characteristic names of product ""sesame""?","SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame""" "List all the characteristic names and data types of product ""cumin"".","CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""cumin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:List all the characteristic names and data types of product ""cumin"".","SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""cumin""" "List all characteristics of product named ""sesame"" with type code ""Grade"".","CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR, characteristic_type_code VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame"" AND t3.characteristic_type_code = ""Grade""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR, characteristic_type_code VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:List all characteristics of product named ""sesame"" with type code ""Grade"".","SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame"" AND t3.characteristic_type_code = ""Grade""" "How many characteristics does the product named ""laurel"" have?","CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""laurel""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:How many characteristics does the product named ""laurel"" have?","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""laurel""" "Find the number of characteristics that the product ""flax"" has.","CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""flax""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:Find the number of characteristics that the product ""flax"" has.","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""flax""" "Find the name of the products that have the color description ""red"" and have the characteristic name ""fast"".","CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""red"" AND t3.characteristic_name = ""fast""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:Find the name of the products that have the color description ""red"" and have the characteristic name ""fast"".","SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""red"" AND t3.characteristic_name = ""fast""" "How many products have the characteristic named ""hot""?","CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = ""hot""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:How many products have the characteristic named ""hot""?","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = ""hot""" List the all the distinct names of the products with the characteristic name 'warm'.,"CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = ""warm""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:List the all the distinct names of the products with the characteristic name 'warm'.","SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = ""warm""" "Find the number of the products that have their color described as ""red"" and have a characteristic named ""slow"".","CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""red"" AND t3.characteristic_name = ""slow""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:Find the number of the products that have their color described as ""red"" and have a characteristic named ""slow"".","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""red"" AND t3.characteristic_name = ""slow""" "Count the products that have the color description ""white"" or have the characteristic name ""hot"".","CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""white"" OR t3.characteristic_name = ""hot""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:Count the products that have the color description ""white"" or have the characteristic name ""hot"".","SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""white"" OR t3.characteristic_name = ""hot""" "What is the unit of measuerment of the product category code ""Herbs""?","CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR)","SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = ""Herbs""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR) ### question:What is the unit of measuerment of the product category code ""Herbs""?","SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = ""Herbs""" "Find the product category description of the product category with code ""Spices"".","CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR)","SELECT product_category_description FROM ref_product_categories WHERE product_category_code = ""Spices""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR) ### question:Find the product category description of the product category with code ""Spices"".","SELECT product_category_description FROM ref_product_categories WHERE product_category_code = ""Spices""" "What is the product category description and unit of measurement of category ""Herbs""?","CREATE TABLE ref_product_categories (product_category_description VARCHAR, unit_of_measure VARCHAR, product_category_code VARCHAR)","SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = ""Herbs""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_product_categories (product_category_description VARCHAR, unit_of_measure VARCHAR, product_category_code VARCHAR) ### question:What is the product category description and unit of measurement of category ""Herbs""?","SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = ""Herbs""" "What is the unit of measurement of product named ""cumin""?","CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)","SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = ""cumin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR) ### question:What is the unit of measurement of product named ""cumin""?","SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = ""cumin""" "Find the unit of measurement and product category code of product named ""chervil"".","CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)","SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = ""chervil""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR) ### question:Find the unit of measurement and product category code of product named ""chervil"".","SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = ""chervil""" "Find the product names that are colored 'white' but do not have unit of measurement ""Handful"".","CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR, color_code VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE ref_product_categories (product_category_code VARCHAR, unit_of_measure VARCHAR)","SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = ""white"" AND t2.unit_of_measure <> ""Handful""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR, color_code VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE ref_product_categories (product_category_code VARCHAR, unit_of_measure VARCHAR) ### question:Find the product names that are colored 'white' but do not have unit of measurement ""Handful"".","SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = ""white"" AND t2.unit_of_measure <> ""Handful""" What is the description of the color for most products?,"CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR)",SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR) ### question:What is the description of the color for most products?",SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1 What is the description of the color used by least products?,"CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR)",SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR) ### question:What is the description of the color used by least products?",SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) LIMIT 1 What is the characteristic name used by most number of the products?,"CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)",SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:What is the characteristic name used by most number of the products?",SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1 "What are the names, details and data types of the characteristics which are never used by any product?","CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (characteristic_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR)","SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (characteristic_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR) ### question:What are the names, details and data types of the characteristics which are never used by any product?","SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id" What are characteristic names used at least twice across all products?,"CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)",SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### question:What are characteristic names used at least twice across all products?",SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2 How many colors are never used by any product?,CREATE TABLE products (color_code VARCHAR); CREATE TABLE Ref_colors (color_code VARCHAR),SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (color_code VARCHAR); CREATE TABLE Ref_colors (color_code VARCHAR) ### question:How many colors are never used by any product?",SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products) How many events are there?,CREATE TABLE event (Id VARCHAR),SELECT COUNT(*) FROM event,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE event (Id VARCHAR) ### question:How many events are there?",SELECT COUNT(*) FROM event List all the event names by year from the most recent to the oldest.,"CREATE TABLE event (name VARCHAR, YEAR VARCHAR)",SELECT name FROM event ORDER BY YEAR DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE event (name VARCHAR, YEAR VARCHAR) ### question:List all the event names by year from the most recent to the oldest.",SELECT name FROM event ORDER BY YEAR DESC What is the name of the event that happened in the most recent year?,"CREATE TABLE event (name VARCHAR, YEAR VARCHAR)",SELECT name FROM event ORDER BY YEAR DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE event (name VARCHAR, YEAR VARCHAR) ### question:What is the name of the event that happened in the most recent year?",SELECT name FROM event ORDER BY YEAR DESC LIMIT 1 How many stadiums are there?,CREATE TABLE stadium (Id VARCHAR),SELECT COUNT(*) FROM stadium,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (Id VARCHAR) ### question:How many stadiums are there?",SELECT COUNT(*) FROM stadium Find the name of the stadium that has the maximum capacity.,"CREATE TABLE stadium (name VARCHAR, capacity VARCHAR)",SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, capacity VARCHAR) ### question:Find the name of the stadium that has the maximum capacity.",SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1 Find the names of stadiums whose capacity is smaller than the average capacity.,"CREATE TABLE stadium (name VARCHAR, capacity INTEGER)",SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, capacity INTEGER) ### question:Find the names of stadiums whose capacity is smaller than the average capacity.",SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium) Find the country that has the most stadiums.,CREATE TABLE stadium (country VARCHAR),SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (country VARCHAR) ### question:Find the country that has the most stadiums.",SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 Which country has at most 3 stadiums listed?,CREATE TABLE stadium (country VARCHAR),SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (country VARCHAR) ### question:Which country has at most 3 stadiums listed?",SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3 Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?,"CREATE TABLE stadium (country VARCHAR, capacity INTEGER)",SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (country VARCHAR, capacity INTEGER) ### question:Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?",SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000 How many cities have a stadium that was opened before the year of 2006?,"CREATE TABLE stadium (city VARCHAR, opening_year INTEGER)",SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (city VARCHAR, opening_year INTEGER) ### question:How many cities have a stadium that was opened before the year of 2006?",SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006 How many stadiums does each country have?,CREATE TABLE stadium (country VARCHAR),"SELECT country, COUNT(*) FROM stadium GROUP BY country","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (country VARCHAR) ### question:How many stadiums does each country have?","SELECT country, COUNT(*) FROM stadium GROUP BY country" Which countries do not have a stadium that was opened after 2006?,"CREATE TABLE stadium (country VARCHAR, opening_year INTEGER)",SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (country VARCHAR, opening_year INTEGER) ### question:Which countries do not have a stadium that was opened after 2006?",SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006 "How many stadiums are not in country ""Russia""?",CREATE TABLE stadium (country VARCHAR),SELECT COUNT(*) FROM stadium WHERE country <> 'Russia',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (country VARCHAR) ### question:How many stadiums are not in country ""Russia""?",SELECT COUNT(*) FROM stadium WHERE country <> 'Russia' "Find the names of all swimmers, sorted by their 100 meter scores in ascending order.","CREATE TABLE swimmer (name VARCHAR, meter_100 VARCHAR)",SELECT name FROM swimmer ORDER BY meter_100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE swimmer (name VARCHAR, meter_100 VARCHAR) ### question:Find the names of all swimmers, sorted by their 100 meter scores in ascending order.",SELECT name FROM swimmer ORDER BY meter_100 How many different countries are all the swimmers from?,CREATE TABLE swimmer (nationality VARCHAR),SELECT COUNT(DISTINCT nationality) FROM swimmer,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE swimmer (nationality VARCHAR) ### question:How many different countries are all the swimmers from?",SELECT COUNT(DISTINCT nationality) FROM swimmer List countries that have more than one swimmer.,CREATE TABLE swimmer (nationality VARCHAR),"SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE swimmer (nationality VARCHAR) ### question:List countries that have more than one swimmer.","SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1" "Find all 200 meter and 300 meter results of swimmers with nationality ""Australia"".","CREATE TABLE swimmer (meter_200 VARCHAR, meter_300 VARCHAR, nationality VARCHAR)","SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE swimmer (meter_200 VARCHAR, meter_300 VARCHAR, nationality VARCHAR) ### question:Find all 200 meter and 300 meter results of swimmers with nationality ""Australia"".","SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'" "Find the names of swimmers who has a result of ""win"".","CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### question:Find the names of swimmers who has a result of ""win"".",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' What is the name of the stadium which held the most events?,"CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR)",SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR) ### question:What is the name of the stadium which held the most events?",SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1 "Find the name and capacity of the stadium where the event named ""World Junior"" happened.","CREATE TABLE event (stadium_id VARCHAR, name VARCHAR); CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, id VARCHAR)","SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE event (stadium_id VARCHAR, name VARCHAR); CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, id VARCHAR) ### question:Find the name and capacity of the stadium where the event named ""World Junior"" happened.","SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'" Find the names of stadiums which have never had any event.,"CREATE TABLE stadium (name VARCHAR, id VARCHAR, stadium_id VARCHAR); CREATE TABLE event (name VARCHAR, id VARCHAR, stadium_id VARCHAR)",SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, id VARCHAR, stadium_id VARCHAR); CREATE TABLE event (name VARCHAR, id VARCHAR, stadium_id VARCHAR) ### question:Find the names of stadiums which have never had any event.",SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event) Find the name of the swimmer who has the most records.,"CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### question:Find the name of the swimmer who has the most records.",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1 Find the name of the swimmer who has at least 2 records.,"CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### question:Find the name of the swimmer who has at least 2 records.",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING COUNT(*) >= 2 "Find the name and nationality of the swimmer who has won (i.e., has a result of ""win"") more than 1 time.","CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, nationality VARCHAR, id VARCHAR)","SELECT t1.name, t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, nationality VARCHAR, id VARCHAR) ### question:Find the name and nationality of the swimmer who has won (i.e., has a result of ""win"") more than 1 time.","SELECT t1.name, t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING COUNT(*) > 1" Find the names of the swimmers who have no record.,"CREATE TABLE swimmer (name VARCHAR, id VARCHAR, swimmer_id VARCHAR); CREATE TABLE record (name VARCHAR, id VARCHAR, swimmer_id VARCHAR)",SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE swimmer (name VARCHAR, id VARCHAR, swimmer_id VARCHAR); CREATE TABLE record (name VARCHAR, id VARCHAR, swimmer_id VARCHAR) ### question:Find the names of the swimmers who have no record.",SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record) "Find the names of the swimmers who have both ""win"" and ""loss"" results in the record.","CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### question:Find the names of the swimmers who have both ""win"" and ""loss"" results in the record.",SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss' Find the names of stadiums that some Australian swimmers have been to.,"CREATE TABLE swimmer (id VARCHAR, nationality VARCHAR); CREATE TABLE record (swimmer_id VARCHAR, event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (id VARCHAR, stadium_id VARCHAR)",SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE swimmer (id VARCHAR, nationality VARCHAR); CREATE TABLE record (swimmer_id VARCHAR, event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (id VARCHAR, stadium_id VARCHAR) ### question:Find the names of stadiums that some Australian swimmers have been to.",SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia' Find the names of stadiums that the most swimmers have been to.,"CREATE TABLE record (event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR, id VARCHAR)",SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE record (event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR, id VARCHAR) ### question:Find the names of stadiums that the most swimmers have been to.",SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1 Find all details for each swimmer.,CREATE TABLE swimmer (Id VARCHAR),SELECT * FROM swimmer,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE swimmer (Id VARCHAR) ### question:Find all details for each swimmer.",SELECT * FROM swimmer What is the average capacity of the stadiums that were opened in year 2005?,"CREATE TABLE stadium (capacity INTEGER, opening_year VARCHAR)",SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (capacity INTEGER, opening_year VARCHAR) ### question:What is the average capacity of the stadiums that were opened in year 2005?",SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005 How many railways are there?,CREATE TABLE railway (Id VARCHAR),SELECT COUNT(*) FROM railway,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Id VARCHAR) ### question:How many railways are there?",SELECT COUNT(*) FROM railway List the builders of railways in ascending alphabetical order.,CREATE TABLE railway (Builder VARCHAR),SELECT Builder FROM railway ORDER BY Builder,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Builder VARCHAR) ### question:List the builders of railways in ascending alphabetical order.",SELECT Builder FROM railway ORDER BY Builder List the wheels and locations of the railways.,"CREATE TABLE railway (Wheels VARCHAR, LOCATION VARCHAR)","SELECT Wheels, LOCATION FROM railway","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Wheels VARCHAR, LOCATION VARCHAR) ### question:List the wheels and locations of the railways.","SELECT Wheels, LOCATION FROM railway" "What is the maximum level of managers in countries that are not ""Australia""?","CREATE TABLE manager (LEVEL INTEGER, Country VARCHAR)","SELECT MAX(LEVEL) FROM manager WHERE Country <> ""Australia ""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (LEVEL INTEGER, Country VARCHAR) ### question:What is the maximum level of managers in countries that are not ""Australia""?","SELECT MAX(LEVEL) FROM manager WHERE Country <> ""Australia """ What is the average age for all managers?,CREATE TABLE manager (Age INTEGER),SELECT AVG(Age) FROM manager,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (Age INTEGER) ### question:What is the average age for all managers?",SELECT AVG(Age) FROM manager What are the names of managers in ascending order of level?,"CREATE TABLE manager (Name VARCHAR, LEVEL VARCHAR)",SELECT Name FROM manager ORDER BY LEVEL,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (Name VARCHAR, LEVEL VARCHAR) ### question:What are the names of managers in ascending order of level?",SELECT Name FROM manager ORDER BY LEVEL What are the names and arrival times of trains?,"CREATE TABLE train (Name VARCHAR, Arrival VARCHAR)","SELECT Name, Arrival FROM train","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (Name VARCHAR, Arrival VARCHAR) ### question:What are the names and arrival times of trains?","SELECT Name, Arrival FROM train" What is the name of the oldest manager?,"CREATE TABLE manager (Name VARCHAR, Age VARCHAR)",SELECT Name FROM manager ORDER BY Age DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (Name VARCHAR, Age VARCHAR) ### question:What is the name of the oldest manager?",SELECT Name FROM manager ORDER BY Age DESC LIMIT 1 Show the names of trains and locations of railways they are in.,"CREATE TABLE railway (Location VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Name VARCHAR, Railway_ID VARCHAR)","SELECT T2.Name, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Location VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Name VARCHAR, Railway_ID VARCHAR) ### question:Show the names of trains and locations of railways they are in.","SELECT T2.Name, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID" "Show the builder of railways associated with the trains named ""Andaman Exp"".","CREATE TABLE railway (Builder VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Railway_ID VARCHAR, Name VARCHAR)","SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = ""Andaman Exp""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Builder VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Railway_ID VARCHAR, Name VARCHAR) ### question:Show the builder of railways associated with the trains named ""Andaman Exp"".","SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = ""Andaman Exp""" Show id and location of railways that are associated with more than one train.,"CREATE TABLE railway (Location VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Railway_ID VARCHAR)","SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Location VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Railway_ID VARCHAR) ### question:Show id and location of railways that are associated with more than one train.","SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1" Show the id and builder of the railway that are associated with the most trains.,"CREATE TABLE train (Railway_ID VARCHAR); CREATE TABLE railway (Builder VARCHAR, Railway_ID VARCHAR)","SELECT T2.Railway_ID, T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (Railway_ID VARCHAR); CREATE TABLE railway (Builder VARCHAR, Railway_ID VARCHAR) ### question:Show the id and builder of the railway that are associated with the most trains.","SELECT T2.Railway_ID, T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1" "Show different builders of railways, along with the corresponding number of railways using each builder.",CREATE TABLE railway (Builder VARCHAR),"SELECT Builder, COUNT(*) FROM railway GROUP BY Builder","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Builder VARCHAR) ### question:Show different builders of railways, along with the corresponding number of railways using each builder.","SELECT Builder, COUNT(*) FROM railway GROUP BY Builder" Show the most common builder of railways.,CREATE TABLE railway (Builder VARCHAR),SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (Builder VARCHAR) ### question:Show the most common builder of railways.",SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1 Show different locations of railways along with the corresponding number of railways at each location.,CREATE TABLE railway (LOCATION VARCHAR),"SELECT LOCATION, COUNT(*) FROM railway GROUP BY LOCATION","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (LOCATION VARCHAR) ### question:Show different locations of railways along with the corresponding number of railways at each location.","SELECT LOCATION, COUNT(*) FROM railway GROUP BY LOCATION" Show the locations that have more than one railways.,CREATE TABLE railway (LOCATION VARCHAR),SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE railway (LOCATION VARCHAR) ### question:Show the locations that have more than one railways.",SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1 List the object number of railways that do not have any trains.,"CREATE TABLE train (ObjectNumber VARCHAR, Railway_ID VARCHAR); CREATE TABLE railway (ObjectNumber VARCHAR, Railway_ID VARCHAR)",SELECT ObjectNumber FROM railway WHERE NOT Railway_ID IN (SELECT Railway_ID FROM train),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (ObjectNumber VARCHAR, Railway_ID VARCHAR); CREATE TABLE railway (ObjectNumber VARCHAR, Railway_ID VARCHAR) ### question:List the object number of railways that do not have any trains.",SELECT ObjectNumber FROM railway WHERE NOT Railway_ID IN (SELECT Railway_ID FROM train) Show the countries that have both managers of age above 50 and managers of age below 46.,"CREATE TABLE manager (Country VARCHAR, Age INTEGER)",SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (Country VARCHAR, Age INTEGER) ### question:Show the countries that have both managers of age above 50 and managers of age below 46.",SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46 Show the distinct countries of managers.,CREATE TABLE manager (Country VARCHAR),SELECT DISTINCT Country FROM manager,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (Country VARCHAR) ### question:Show the distinct countries of managers.",SELECT DISTINCT Country FROM manager Show the working years of managers in descending order of their level.,"CREATE TABLE manager (Working_year_starts VARCHAR, LEVEL VARCHAR)",SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (Working_year_starts VARCHAR, LEVEL VARCHAR) ### question:Show the working years of managers in descending order of their level.",SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC Show the countries that have managers of age above 50 or below 46.,"CREATE TABLE manager (Country VARCHAR, Age VARCHAR)",SELECT Country FROM manager WHERE Age > 50 OR Age < 46,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE manager (Country VARCHAR, Age VARCHAR) ### question:Show the countries that have managers of age above 50 or below 46.",SELECT Country FROM manager WHERE Age > 50 OR Age < 46 How many addresses are there in country USA?,CREATE TABLE addresses (country VARCHAR),SELECT COUNT(*) FROM addresses WHERE country = 'USA',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (country VARCHAR) ### question:How many addresses are there in country USA?",SELECT COUNT(*) FROM addresses WHERE country = 'USA' Show all distinct cities in the address record.,CREATE TABLE addresses (city VARCHAR),SELECT DISTINCT city FROM addresses,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (city VARCHAR) ### question:Show all distinct cities in the address record.",SELECT DISTINCT city FROM addresses Show each state and the number of addresses in each state.,CREATE TABLE addresses (state_province_county VARCHAR),"SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (state_province_county VARCHAR) ### question:Show each state and the number of addresses in each state.","SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county" Show names and phones of customers who do not have address information.,"CREATE TABLE customer_address_history (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR)","SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_address_history)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_address_history (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR) ### question:Show names and phones of customers who do not have address information.","SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_address_history)" Show the name of the customer who has the most orders.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) ### question:Show the name of the customer who has the most orders.",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 Show the product type codes which have at least two products.,CREATE TABLE products (product_type_code VARCHAR),SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR) ### question:Show the product type codes which have at least two products.",SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2 Show the names of customers who have both an order in completed status and an order in part status.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR)",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR) ### question:Show the names of customers who have both an order in completed status and an order in part status.",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part' "Show the name, phone, and payment method code for all customers in descending order of customer number.","CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, payment_method_code VARCHAR, customer_number VARCHAR)","SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, payment_method_code VARCHAR, customer_number VARCHAR) ### question:Show the name, phone, and payment method code for all customers in descending order of customer number.","SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC" Show the product name and total order quantity for each product.,"CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, product_id VARCHAR)","SELECT T1.product_name, SUM(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, product_id VARCHAR) ### question:Show the product name and total order quantity for each product.","SELECT T1.product_name, SUM(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id" "Show the minimum, maximum, average price for all products.",CREATE TABLE products (product_price INTEGER),"SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_price INTEGER) ### question:Show the minimum, maximum, average price for all products.","SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products" How many products have a price higher than the average?,CREATE TABLE products (product_price INTEGER),SELECT COUNT(*) FROM products WHERE product_price > (SELECT AVG(product_price) FROM products),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_price INTEGER) ### question:How many products have a price higher than the average?",SELECT COUNT(*) FROM products WHERE product_price > (SELECT AVG(product_price) FROM products) "Show the customer name, customer address city, date from, and date to for each customer address history.","CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_address_history (date_from VARCHAR, date_to VARCHAR, customer_id VARCHAR, address_id VARCHAR)","SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_address_history (date_from VARCHAR, date_to VARCHAR, customer_id VARCHAR, address_id VARCHAR) ### question:Show the customer name, customer address city, date from, and date to for each customer address history.","SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id" Show the names of customers who use Credit Card payment method and have more than 2 orders.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR, payment_method_code VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR, payment_method_code VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) ### question:Show the names of customers who use Credit Card payment method and have more than 2 orders.",SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2 What are the name and phone of the customer with the most ordered product quantity?,"CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)","SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY SUM(T3.order_quantity) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:What are the name and phone of the customer with the most ordered product quantity?","SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY SUM(T3.order_quantity) DESC LIMIT 1" Show the product type and name for the products with price higher than 1000 or lower than 500.,"CREATE TABLE products (product_type_code VARCHAR, product_name VARCHAR, product_price VARCHAR)","SELECT product_type_code, product_name FROM products WHERE product_price > 1000 OR product_price < 500","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_type_code VARCHAR, product_name VARCHAR, product_price VARCHAR) ### question:Show the product type and name for the products with price higher than 1000 or lower than 500.","SELECT product_type_code, product_name FROM products WHERE product_price > 1000 OR product_price < 500" Find the name of dorms only for female (F gender).,"CREATE TABLE dorm (dorm_name VARCHAR, gender VARCHAR)",SELECT dorm_name FROM dorm WHERE gender = 'F',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, gender VARCHAR) ### question:Find the name of dorms only for female (F gender).",SELECT dorm_name FROM dorm WHERE gender = 'F' Find the name of dorms that can accommodate more than 300 students.,"CREATE TABLE dorm (dorm_name VARCHAR, student_capacity INTEGER)",SELECT dorm_name FROM dorm WHERE student_capacity > 300,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, student_capacity INTEGER) ### question:Find the name of dorms that can accommodate more than 300 students.",SELECT dorm_name FROM dorm WHERE student_capacity > 300 How many female students (sex is F) whose age is below 25?,"CREATE TABLE student (sex VARCHAR, age VARCHAR)",SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (sex VARCHAR, age VARCHAR) ### question:How many female students (sex is F) whose age is below 25?",SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25 Find the first name of students who is older than 20.,"CREATE TABLE student (fname VARCHAR, age INTEGER)",SELECT fname FROM student WHERE age > 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR, age INTEGER) ### question:Find the first name of students who is older than 20.",SELECT fname FROM student WHERE age > 20 Find the first name of students living in city PHL whose age is between 20 and 25.,"CREATE TABLE student (fname VARCHAR, city_code VARCHAR, age VARCHAR)",SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR, city_code VARCHAR, age VARCHAR) ### question:Find the first name of students living in city PHL whose age is between 20 and 25.",SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25 How many dorms are there?,CREATE TABLE dorm (Id VARCHAR),SELECT COUNT(*) FROM dorm,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (Id VARCHAR) ### question:How many dorms are there?",SELECT COUNT(*) FROM dorm Find the number of distinct amenities.,CREATE TABLE dorm_amenity (Id VARCHAR),SELECT COUNT(*) FROM dorm_amenity,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm_amenity (Id VARCHAR) ### question:Find the number of distinct amenities.",SELECT COUNT(*) FROM dorm_amenity Find the total capacity of all dorms.,CREATE TABLE dorm (student_capacity INTEGER),SELECT SUM(student_capacity) FROM dorm,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (student_capacity INTEGER) ### question:Find the total capacity of all dorms.",SELECT SUM(student_capacity) FROM dorm Find the average age of all students living in the each city.,"CREATE TABLE student (city_code VARCHAR, age INTEGER)","SELECT AVG(age), city_code FROM student GROUP BY city_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (city_code VARCHAR, age INTEGER) ### question:Find the average age of all students living in the each city.","SELECT AVG(age), city_code FROM student GROUP BY city_code" Find the average and total capacity of dorms for the students with gender X.,"CREATE TABLE dorm (student_capacity INTEGER, gender VARCHAR)","SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (student_capacity INTEGER, gender VARCHAR) ### question:Find the average and total capacity of dorms for the students with gender X.","SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'" Find the number of dorms that have some amenity.,CREATE TABLE has_amenity (dormid VARCHAR),SELECT COUNT(DISTINCT dormid) FROM has_amenity,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_amenity (dormid VARCHAR) ### question:Find the number of dorms that have some amenity.",SELECT COUNT(DISTINCT dormid) FROM has_amenity Find the name of dorms that do not have any amenity,"CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dorm_name VARCHAR, dormid VARCHAR)",SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dorm_name VARCHAR, dormid VARCHAR) ### question:Find the name of dorms that do not have any amenity",SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity) Find the number of distinct gender for dorms.,CREATE TABLE dorm (gender VARCHAR),SELECT COUNT(DISTINCT gender) FROM dorm,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (gender VARCHAR) ### question:Find the number of distinct gender for dorms.",SELECT COUNT(DISTINCT gender) FROM dorm Find the capacity and gender type of the dorm whose name has substring ‘Donor’.,"CREATE TABLE dorm (student_capacity VARCHAR, gender VARCHAR, dorm_name VARCHAR)","SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (student_capacity VARCHAR, gender VARCHAR, dorm_name VARCHAR) ### question:Find the capacity and gender type of the dorm whose name has substring ‘Donor’.","SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'" Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.,"CREATE TABLE dorm (dorm_name VARCHAR, gender VARCHAR, student_capacity VARCHAR)","SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, gender VARCHAR, student_capacity VARCHAR) ### question:Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.","SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100" Find the numbers of different majors and cities.,"CREATE TABLE student (major VARCHAR, city_code VARCHAR)","SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (major VARCHAR, city_code VARCHAR) ### question:Find the numbers of different majors and cities.","SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student" Find the name of dorms which have both TV Lounge and Study Room as amenities.,"CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR)",SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) ### question:Find the name of dorms which have both TV Lounge and Study Room as amenities.",SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room' Find the name of dorms which have TV Lounge but no Study Room as amenity.,"CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR)",SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) ### question:Find the name of dorms which have TV Lounge but no Study Room as amenity.",SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room' Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.,"CREATE TABLE student (lname VARCHAR, sex VARCHAR, city_code VARCHAR, age VARCHAR)",SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (lname VARCHAR, sex VARCHAR, city_code VARCHAR, age VARCHAR) ### question:Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.",SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20 Find the name of the dorm with the largest capacity.,"CREATE TABLE dorm (dorm_name VARCHAR, student_capacity VARCHAR)",SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, student_capacity VARCHAR) ### question:Find the name of the dorm with the largest capacity.",SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1 List in alphabetic order all different amenities.,CREATE TABLE dorm_amenity (amenity_name VARCHAR),SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm_amenity (amenity_name VARCHAR) ### question:List in alphabetic order all different amenities.",SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name Find the code of city where most of students are living in.,CREATE TABLE student (city_code VARCHAR),SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (city_code VARCHAR) ### question:Find the code of city where most of students are living in.",SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1 Find the first and last name of students whose age is younger than the average age.,"CREATE TABLE student (fname VARCHAR, lname VARCHAR, age INTEGER)","SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR, lname VARCHAR, age INTEGER) ### question:Find the first and last name of students whose age is younger than the average age.","SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student)" "List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.","CREATE TABLE student (fname VARCHAR, lname VARCHAR, city_code VARCHAR, age VARCHAR)","SELECT fname, lname FROM student WHERE city_code <> 'HKG' ORDER BY age","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR, lname VARCHAR, city_code VARCHAR, age VARCHAR) ### question:List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.","SELECT fname, lname FROM student WHERE city_code <> 'HKG' ORDER BY age" "List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.","CREATE TABLE has_amenity (amenid VARCHAR, dormid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR)",SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_amenity (amenid VARCHAR, dormid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) ### question:List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.",SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name Find the number of dorms and total capacity for each gender.,"CREATE TABLE dorm (gender VARCHAR, student_capacity INTEGER)","SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (gender VARCHAR, student_capacity INTEGER) ### question:Find the number of dorms and total capacity for each gender.","SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender" Find the average and oldest age for students with different sex.,"CREATE TABLE student (sex VARCHAR, age INTEGER)","SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (sex VARCHAR, age INTEGER) ### question:Find the average and oldest age for students with different sex.","SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex" Find the number of students in each major.,CREATE TABLE student (major VARCHAR),"SELECT COUNT(*), major FROM student GROUP BY major","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (major VARCHAR) ### question:Find the number of students in each major.","SELECT COUNT(*), major FROM student GROUP BY major" Find the number and average age of students living in each city.,"CREATE TABLE student (city_code VARCHAR, age INTEGER)","SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (city_code VARCHAR, age INTEGER) ### question:Find the number and average age of students living in each city.","SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code" Find the average age and number of male students (with sex M) from each city.,"CREATE TABLE student (city_code VARCHAR, age INTEGER, sex VARCHAR)","SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (city_code VARCHAR, age INTEGER, sex VARCHAR) ### question:Find the average age and number of male students (with sex M) from each city.","SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code" Find the number of students for the cities where have more than one student.,CREATE TABLE student (city_code VARCHAR),"SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (city_code VARCHAR) ### question:Find the number of students for the cities where have more than one student.","SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1" Find the first and last name of students who are not in the largest major.,"CREATE TABLE student (fname VARCHAR, lname VARCHAR, major VARCHAR)","SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR, lname VARCHAR, major VARCHAR) ### question:Find the first and last name of students who are not in the largest major.","SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1)" Find the number of students whose age is older than the average age for each gender.,"CREATE TABLE student (sex VARCHAR, age INTEGER)","SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (sex VARCHAR, age INTEGER) ### question:Find the number of students whose age is older than the average age for each gender.","SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex" Find the average age of students living in each dorm and the name of dorm.,"CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR)","SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR) ### question:Find the average age of students living in each dorm and the name of dorm.","SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name" Find the number of amenities for each of the dorms that can accommodate more than 100 students.,"CREATE TABLE dorm (dormid VARCHAR, student_capacity INTEGER); CREATE TABLE has_amenity (dormid VARCHAR)","SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dormid VARCHAR, student_capacity INTEGER); CREATE TABLE has_amenity (dormid VARCHAR) ### question:Find the number of amenities for each of the dorms that can accommodate more than 100 students.","SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid" Find the number of students who is older than 20 in each dorm.,"CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR, age INTEGER)","SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR, age INTEGER) ### question:Find the number of students who is older than 20 in each dorm.","SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name" Find the first name of students who are living in the Smith Hall.,"CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR)",SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) ### question:Find the first name of students who are living in the Smith Hall.",SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' Find the average age of students who are living in the dorm with the largest capacity.,"CREATE TABLE dorm (student_capacity INTEGER); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, student_capacity INTEGER)",SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (student_capacity INTEGER); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, student_capacity INTEGER) ### question:Find the average age of students who are living in the dorm with the largest capacity.",SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm) Find the total number of students living in the male dorm (with gender M).,"CREATE TABLE dorm (dormid VARCHAR, gender VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR)",SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dormid VARCHAR, gender VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR) ### question:Find the total number of students living in the male dorm (with gender M).",SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M' Find the number of female students (with F sex) living in Smith Hall,"CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR, sex VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR)",SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR, sex VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) ### question:Find the number of female students (with F sex) living in Smith Hall",SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F' Find the name of amenities Smith Hall dorm have.,"CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR)",SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) ### question:Find the name of amenities Smith Hall dorm have.",SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.,"CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR)",SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) ### question:Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.",SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name Find the name of amenity that is most common in all dorms.,"CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE has_amenity (amenid VARCHAR)",SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE has_amenity (amenid VARCHAR) ### question:Find the name of amenity that is most common in all dorms.",SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1 Find the first name of students who are living in the dorm that has most number of amenities.,"CREATE TABLE dorm_amenity (amenid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR); CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR)",SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm_amenity (amenid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR); CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR) ### question:Find the first name of students who are living in the dorm that has most number of amenities.",SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1) Find the name and capacity of the dorm with least number of amenities.,"CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR); CREATE TABLE dorm (dorm_name VARCHAR, student_capacity VARCHAR, dormid VARCHAR)","SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR); CREATE TABLE dorm (dorm_name VARCHAR, student_capacity VARCHAR, dormid VARCHAR) ### question:Find the name and capacity of the dorm with least number of amenities.","SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) LIMIT 1" Find the name of dorms that do not have amenity TV Lounge.,"CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dorm_name VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR)",SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dorm_name VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) ### question:Find the name of dorms that do not have amenity TV Lounge.",SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' Find the first and last name of students who are living in the dorms that have amenity TV Lounge.,"CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR)","SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) ### question:Find the first and last name of students who are living in the dorms that have amenity TV Lounge.","SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')" Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.,"CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE student (fname VARCHAR, age VARCHAR, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR)","SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE student (fname VARCHAR, age VARCHAR, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) ### question:Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.","SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')" Find the name of amenities of the dorm where the student with last name Smith is living in.,"CREATE TABLE student (stuid VARCHAR, lname VARCHAR); CREATE TABLE dorm (dormid VARCHAR); CREATE TABLE lives_in (dormid VARCHAR, stuid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR)",SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, lname VARCHAR); CREATE TABLE dorm (dormid VARCHAR); CREATE TABLE lives_in (dormid VARCHAR, stuid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR) ### question:Find the name of amenities of the dorm where the student with last name Smith is living in.",SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith' "Find the emails and phone numbers of all the customers, ordered by email address and phone number.","CREATE TABLE customers (email_address VARCHAR, phone_number VARCHAR)","SELECT email_address, phone_number FROM customers ORDER BY email_address, phone_number","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (email_address VARCHAR, phone_number VARCHAR) ### question:Find the emails and phone numbers of all the customers, ordered by email address and phone number.","SELECT email_address, phone_number FROM customers ORDER BY email_address, phone_number" "Which city has the least number of customers whose type code is ""Good Credit Rating""?","CREATE TABLE customers (town_city VARCHAR, customer_type_code VARCHAR)","SELECT town_city FROM customers WHERE customer_type_code = ""Good Credit Rating"" GROUP BY town_city ORDER BY COUNT(*) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (town_city VARCHAR, customer_type_code VARCHAR) ### question:Which city has the least number of customers whose type code is ""Good Credit Rating""?","SELECT town_city FROM customers WHERE customer_type_code = ""Good Credit Rating"" GROUP BY town_city ORDER BY COUNT(*) LIMIT 1" List the name of all products along with the number of complaints that they have received.,"CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_id VARCHAR)","SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_id VARCHAR) ### question:List the name of all products along with the number of complaints that they have received.","SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name" Find the emails of customers who has filed a complaints of the product with the most complaints.,"CREATE TABLE customers (email_address VARCHAR, customer_id VARCHAR); CREATE TABLE complaints (customer_id VARCHAR)",SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (email_address VARCHAR, customer_id VARCHAR); CREATE TABLE complaints (customer_id VARCHAR) ### question:Find the emails of customers who has filed a complaints of the product with the most complaints.",SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1 Which products has been complained by the customer who has filed least amount of complaints?,"CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_id VARCHAR)",SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_id VARCHAR) ### question:Which products has been complained by the customer who has filed least amount of complaints?",SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) LIMIT 1 What is the phone number of the customer who has filed the most recent complaint?,"CREATE TABLE customers (phone_number VARCHAR, customer_id VARCHAR); CREATE TABLE complaints (customer_id VARCHAR, date_complaint_raised VARCHAR)",SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (phone_number VARCHAR, customer_id VARCHAR); CREATE TABLE complaints (customer_id VARCHAR, date_complaint_raised VARCHAR) ### question:What is the phone number of the customer who has filed the most recent complaint?",SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1 Find the email and phone number of the customers who have never filed a complaint before.,"CREATE TABLE complaints (email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR); CREATE TABLE customers (email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR)","SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE complaints (email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR); CREATE TABLE customers (email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR) ### question:Find the email and phone number of the customers who have never filed a complaint before.","SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)" Find the phone number of all the customers and staff.,CREATE TABLE staff (phone_number VARCHAR); CREATE TABLE customers (phone_number VARCHAR),SELECT phone_number FROM customers UNION SELECT phone_number FROM staff,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (phone_number VARCHAR); CREATE TABLE customers (phone_number VARCHAR) ### question:Find the phone number of all the customers and staff.",SELECT phone_number FROM customers UNION SELECT phone_number FROM staff "What is the description of the product named ""Chocolate""?","CREATE TABLE products (product_description VARCHAR, product_name VARCHAR)","SELECT product_description FROM products WHERE product_name = ""Chocolate""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_description VARCHAR, product_name VARCHAR) ### question:What is the description of the product named ""Chocolate""?","SELECT product_description FROM products WHERE product_name = ""Chocolate""" Find the name and category of the most expensive product.,"CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR, product_price VARCHAR)","SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR, product_price VARCHAR) ### question:Find the name and category of the most expensive product.","SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1" Find the prices of products which has never received a single complaint.,"CREATE TABLE products (product_price VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_price VARCHAR, product_id VARCHAR)",SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_price VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_price VARCHAR, product_id VARCHAR) ### question:Find the prices of products which has never received a single complaint.",SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints) What is the average price of the products for each category?,"CREATE TABLE products (product_category_code VARCHAR, product_price INTEGER)","SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_category_code VARCHAR, product_price INTEGER) ### question:What is the average price of the products for each category?","SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code" Find the last name of the staff member who processed the complaint of the cheapest product.,"CREATE TABLE products (product_id VARCHAR, product_price VARCHAR); CREATE TABLE complaints (staff_id VARCHAR, product_id VARCHAR); CREATE TABLE staff (last_name VARCHAR, staff_id VARCHAR)",SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR, product_price VARCHAR); CREATE TABLE complaints (staff_id VARCHAR, product_id VARCHAR); CREATE TABLE staff (last_name VARCHAR, staff_id VARCHAR) ### question:Find the last name of the staff member who processed the complaint of the cheapest product.",SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1 Which complaint status has more than 3 records on file?,CREATE TABLE complaints (complaint_status_code VARCHAR),SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE complaints (complaint_status_code VARCHAR) ### question:Which complaint status has more than 3 records on file?",SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3 "Find the last name of the staff whose email address contains ""wrau"".","CREATE TABLE staff (last_name VARCHAR, email_address VARCHAR)","SELECT last_name FROM staff WHERE email_address LIKE ""%wrau%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (last_name VARCHAR, email_address VARCHAR) ### question:Find the last name of the staff whose email address contains ""wrau"".","SELECT last_name FROM staff WHERE email_address LIKE ""%wrau%""" How many customers are there in the customer type with the most customers?,CREATE TABLE customers (customer_type_code VARCHAR),SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_type_code VARCHAR) ### question:How many customers are there in the customer type with the most customers?",SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1 What is the last name of the staff who has handled the first ever complaint?,"CREATE TABLE staff (last_name VARCHAR, staff_id VARCHAR); CREATE TABLE complaints (staff_id VARCHAR, date_complaint_raised VARCHAR)",SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE staff (last_name VARCHAR, staff_id VARCHAR); CREATE TABLE complaints (staff_id VARCHAR, date_complaint_raised VARCHAR) ### question:What is the last name of the staff who has handled the first ever complaint?",SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1 How many distinct complaint type codes are there in the database?,CREATE TABLE complaints (complaint_type_code VARCHAR),SELECT COUNT(DISTINCT complaint_type_code) FROM complaints,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE complaints (complaint_type_code VARCHAR) ### question:How many distinct complaint type codes are there in the database?",SELECT COUNT(DISTINCT complaint_type_code) FROM complaints "Find the address line 1 and 2 of the customer with email ""vbogisich@example.org"".","CREATE TABLE customers (address_line_1 VARCHAR, address_line_2 VARCHAR, email_address VARCHAR)","SELECT address_line_1, address_line_2 FROM customers WHERE email_address = ""vbogisich@example.org""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (address_line_1 VARCHAR, address_line_2 VARCHAR, email_address VARCHAR) ### question:Find the address line 1 and 2 of the customer with email ""vbogisich@example.org"".","SELECT address_line_1, address_line_2 FROM customers WHERE email_address = ""vbogisich@example.org""" Find the number of complaints with Product Failure type for each complaint status.,"CREATE TABLE complaints (complaint_status_code VARCHAR, complaint_type_code VARCHAR)","SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = ""Product Failure"" GROUP BY complaint_status_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE complaints (complaint_status_code VARCHAR, complaint_type_code VARCHAR) ### question:Find the number of complaints with Product Failure type for each complaint status.","SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = ""Product Failure"" GROUP BY complaint_status_code" What is first names of the top 5 staff who have handled the greatest number of complaints?,"CREATE TABLE complaints (staff_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, staff_id VARCHAR)",SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY COUNT(*) LIMIT 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE complaints (staff_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, staff_id VARCHAR) ### question:What is first names of the top 5 staff who have handled the greatest number of complaints?",SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY COUNT(*) LIMIT 5 Which state has the most customers?,CREATE TABLE customers (state VARCHAR),SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (state VARCHAR) ### question:Which state has the most customers?",SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) LIMIT 1 How many submissions are there?,CREATE TABLE submission (Id VARCHAR),SELECT COUNT(*) FROM submission,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Id VARCHAR) ### question:How many submissions are there?",SELECT COUNT(*) FROM submission List the authors of submissions in ascending order of scores.,"CREATE TABLE submission (Author VARCHAR, Scores VARCHAR)",SELECT Author FROM submission ORDER BY Scores,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Author VARCHAR, Scores VARCHAR) ### question:List the authors of submissions in ascending order of scores.",SELECT Author FROM submission ORDER BY Scores What are the authors of submissions and their colleges?,"CREATE TABLE submission (Author VARCHAR, College VARCHAR)","SELECT Author, College FROM submission","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Author VARCHAR, College VARCHAR) ### question:What are the authors of submissions and their colleges?","SELECT Author, College FROM submission" "Show the names of authors from college ""Florida"" or ""Temple""","CREATE TABLE submission (Author VARCHAR, College VARCHAR)","SELECT Author FROM submission WHERE College = ""Florida"" OR College = ""Temple""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Author VARCHAR, College VARCHAR) ### question:Show the names of authors from college ""Florida"" or ""Temple""","SELECT Author FROM submission WHERE College = ""Florida"" OR College = ""Temple""" What is the average score of submissions?,CREATE TABLE submission (Scores INTEGER),SELECT AVG(Scores) FROM submission,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Scores INTEGER) ### question:What is the average score of submissions?",SELECT AVG(Scores) FROM submission What is the author of the submission with the highest score?,"CREATE TABLE submission (Author VARCHAR, Scores VARCHAR)",SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Author VARCHAR, Scores VARCHAR) ### question:What is the author of the submission with the highest score?",SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1 Show different colleges along with the number of authors of submission from each college.,CREATE TABLE submission (College VARCHAR),"SELECT College, COUNT(*) FROM submission GROUP BY College","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (College VARCHAR) ### question:Show different colleges along with the number of authors of submission from each college.","SELECT College, COUNT(*) FROM submission GROUP BY College" Show the most common college of authors of submissions.,CREATE TABLE submission (College VARCHAR),SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (College VARCHAR) ### question:Show the most common college of authors of submissions.",SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1 Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.,"CREATE TABLE submission (College VARCHAR, Scores INTEGER)",SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (College VARCHAR, Scores INTEGER) ### question:Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.",SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80 Show the authors of submissions and the acceptance results of their submissions.,"CREATE TABLE acceptance (Result VARCHAR, Submission_ID VARCHAR); CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR)","SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE acceptance (Result VARCHAR, Submission_ID VARCHAR); CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR) ### question:Show the authors of submissions and the acceptance results of their submissions.","SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID" Show the result of the submission with the highest score.,"CREATE TABLE acceptance (Result VARCHAR, Submission_ID VARCHAR); CREATE TABLE submission (Submission_ID VARCHAR, Scores VARCHAR)",SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE acceptance (Result VARCHAR, Submission_ID VARCHAR); CREATE TABLE submission (Submission_ID VARCHAR, Scores VARCHAR) ### question:Show the result of the submission with the highest score.",SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1 Show each author and the number of workshops they submitted to.,"CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR); CREATE TABLE acceptance (workshop_id VARCHAR, Submission_ID VARCHAR)","SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR); CREATE TABLE acceptance (workshop_id VARCHAR, Submission_ID VARCHAR) ### question:Show each author and the number of workshops they submitted to.","SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author" Show the authors who have submissions to more than one workshop.,"CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR); CREATE TABLE acceptance (Submission_ID VARCHAR, workshop_id VARCHAR)",SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR); CREATE TABLE acceptance (Submission_ID VARCHAR, workshop_id VARCHAR) ### question:Show the authors who have submissions to more than one workshop.",SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1 Show the date and venue of each workshop in ascending alphabetical order of the venue.,"CREATE TABLE workshop (Date VARCHAR, Venue VARCHAR)","SELECT Date, Venue FROM workshop ORDER BY Venue","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE workshop (Date VARCHAR, Venue VARCHAR) ### question:Show the date and venue of each workshop in ascending alphabetical order of the venue.","SELECT Date, Venue FROM workshop ORDER BY Venue" List the authors who do not have submission to any workshop.,"CREATE TABLE acceptance (Author VARCHAR, Submission_ID VARCHAR); CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR)",SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE acceptance (Author VARCHAR, Submission_ID VARCHAR); CREATE TABLE submission (Author VARCHAR, Submission_ID VARCHAR) ### question:List the authors who do not have submission to any workshop.",SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance) Find the number of investors in total.,CREATE TABLE INVESTORS (Id VARCHAR),SELECT COUNT(*) FROM INVESTORS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE INVESTORS (Id VARCHAR) ### question:Find the number of investors in total.",SELECT COUNT(*) FROM INVESTORS Show all investor details.,CREATE TABLE INVESTORS (Investor_details VARCHAR),SELECT Investor_details FROM INVESTORS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE INVESTORS (Investor_details VARCHAR) ### question:Show all investor details.",SELECT Investor_details FROM INVESTORS Show all distinct lot details.,CREATE TABLE LOTS (lot_details VARCHAR),SELECT DISTINCT lot_details FROM LOTS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOTS (lot_details VARCHAR) ### question:Show all distinct lot details.",SELECT DISTINCT lot_details FROM LOTS Show the maximum amount of transaction.,CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER),SELECT MAX(amount_of_transaction) FROM TRANSACTIONS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER) ### question:Show the maximum amount of transaction.",SELECT MAX(amount_of_transaction) FROM TRANSACTIONS Show all date and share count of transactions.,"CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, share_count VARCHAR)","SELECT date_of_transaction, share_count FROM TRANSACTIONS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, share_count VARCHAR) ### question:Show all date and share count of transactions.","SELECT date_of_transaction, share_count FROM TRANSACTIONS" What is the total share of transactions?,CREATE TABLE TRANSACTIONS (share_count INTEGER),SELECT SUM(share_count) FROM TRANSACTIONS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (share_count INTEGER) ### question:What is the total share of transactions?",SELECT SUM(share_count) FROM TRANSACTIONS Show all transaction ids with transaction code 'PUR'.,"CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, transaction_type_code VARCHAR)",SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, transaction_type_code VARCHAR) ### question:Show all transaction ids with transaction code 'PUR'.",SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR' "Show all dates of transactions whose type code is ""SALE"".","CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, transaction_type_code VARCHAR)","SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = ""SALE""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, transaction_type_code VARCHAR) ### question:Show all dates of transactions whose type code is ""SALE"".","SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = ""SALE""" "Show the average amount of transactions with type code ""SALE"".","CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER, transaction_type_code VARCHAR)","SELECT AVG(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = ""SALE""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER, transaction_type_code VARCHAR) ### question:Show the average amount of transactions with type code ""SALE"".","SELECT AVG(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = ""SALE""" "Show the description of transaction type with code ""PUR"".","CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR, transaction_type_code VARCHAR)","SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = ""PUR""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR, transaction_type_code VARCHAR) ### question:Show the description of transaction type with code ""PUR"".","SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = ""PUR""" "Show the minimum amount of transactions whose type code is ""PUR"" and whose share count is bigger than 50.","CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER, transaction_type_code VARCHAR, share_count VARCHAR)","SELECT MIN(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = ""PUR"" AND share_count > 50","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER, transaction_type_code VARCHAR, share_count VARCHAR) ### question:Show the minimum amount of transactions whose type code is ""PUR"" and whose share count is bigger than 50.","SELECT MIN(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = ""PUR"" AND share_count > 50" Show the maximum share count of transactions where the amount is smaller than 10000,"CREATE TABLE TRANSACTIONS (share_count INTEGER, amount_of_transaction INTEGER)",SELECT MAX(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (share_count INTEGER, amount_of_transaction INTEGER) ### question:Show the maximum share count of transactions where the amount is smaller than 10000",SELECT MAX(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000 Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.,"CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, share_count VARCHAR, amount_of_transaction VARCHAR)",SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, share_count VARCHAR, amount_of_transaction VARCHAR) ### question:Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.",SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000 Show the transaction type descriptions and dates if the share count is smaller than 10.,"CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR, transaction_type_code VARCHAR); CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, transaction_type_code VARCHAR, share_count INTEGER)","SELECT T1.transaction_type_description, T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR, transaction_type_code VARCHAR); CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, transaction_type_code VARCHAR, share_count INTEGER) ### question:Show the transaction type descriptions and dates if the share count is smaller than 10.","SELECT T1.transaction_type_description, T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10" Show details of all investors if they make any transaction with share count greater than 100.,"CREATE TABLE TRANSACTIONS (investor_id VARCHAR, share_count INTEGER); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR)",SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR, share_count INTEGER); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR) ### question:Show details of all investors if they make any transaction with share count greater than 100.",SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100 How many distinct transaction types are used in the transactions?,CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR),SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR) ### question:How many distinct transaction types are used in the transactions?",SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS Return the lot details and investor ids.,"CREATE TABLE LOTS (lot_details VARCHAR, investor_id VARCHAR)","SELECT lot_details, investor_id FROM LOTS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOTS (lot_details VARCHAR, investor_id VARCHAR) ### question:Return the lot details and investor ids.","SELECT lot_details, investor_id FROM LOTS" "Return the lot details of lots that belong to investors with details ""l""?","CREATE TABLE LOTS (lot_details VARCHAR, investor_id VARCHAR); CREATE TABLE INVESTORS (investor_id VARCHAR, Investor_details VARCHAR)","SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = ""l""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOTS (lot_details VARCHAR, investor_id VARCHAR); CREATE TABLE INVESTORS (investor_id VARCHAR, Investor_details VARCHAR) ### question:Return the lot details of lots that belong to investors with details ""l""?","SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = ""l""" What are the purchase details of transactions with amount bigger than 10000?,"CREATE TABLE PURCHASES (purchase_details VARCHAR, purchase_transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, amount_of_transaction INTEGER)",SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PURCHASES (purchase_details VARCHAR, purchase_transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, amount_of_transaction INTEGER) ### question:What are the purchase details of transactions with amount bigger than 10000?",SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 What are the sale details and dates of transactions with amount smaller than 3000?,"CREATE TABLE SALES (sales_details VARCHAR, sales_transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, transaction_id VARCHAR, amount_of_transaction INTEGER)","SELECT T1.sales_details, T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE SALES (sales_details VARCHAR, sales_transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, transaction_id VARCHAR, amount_of_transaction INTEGER) ### question:What are the sale details and dates of transactions with amount smaller than 3000?","SELECT T1.sales_details, T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000" What are the lot details of lots associated with transactions with share count smaller than 50?,"CREATE TABLE LOTS (lot_details VARCHAR, lot_id VARCHAR); CREATE TABLE TRANSACTIONS_LOTS (transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, share_count INTEGER)",SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOTS (lot_details VARCHAR, lot_id VARCHAR); CREATE TABLE TRANSACTIONS_LOTS (transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, share_count INTEGER) ### question:What are the lot details of lots associated with transactions with share count smaller than 50?",SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50 "What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is ""PUR""?","CREATE TABLE LOTS (lot_details VARCHAR, lot_id VARCHAR); CREATE TABLE TRANSACTIONS_LOTS (transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, share_count VARCHAR, transaction_type_code VARCHAR)","SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = ""PUR""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOTS (lot_details VARCHAR, lot_id VARCHAR); CREATE TABLE TRANSACTIONS_LOTS (transaction_id VARCHAR); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, share_count VARCHAR, transaction_type_code VARCHAR) ### question:What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is ""PUR""?","SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = ""PUR""" Show the average transaction amount for different transaction types.,"CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR, amount_of_transaction INTEGER)","SELECT transaction_type_code, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR, amount_of_transaction INTEGER) ### question:Show the average transaction amount for different transaction types.","SELECT transaction_type_code, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code" Show the maximum and minimum share count of different transaction types.,"CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR, share_count INTEGER)","SELECT transaction_type_code, MAX(share_count), MIN(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR, share_count INTEGER) ### question:Show the maximum and minimum share count of different transaction types.","SELECT transaction_type_code, MAX(share_count), MIN(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code" Show the average share count of transactions for different investors.,"CREATE TABLE TRANSACTIONS (investor_id VARCHAR, share_count INTEGER)","SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR, share_count INTEGER) ### question:Show the average share count of transactions for different investors.","SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id" "Show the average share count of transactions each each investor, ordered by average share count.","CREATE TABLE TRANSACTIONS (investor_id VARCHAR, share_count INTEGER)","SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY AVG(share_count)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR, share_count INTEGER) ### question:Show the average share count of transactions each each investor, ordered by average share count.","SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY AVG(share_count)" Show the average amount of transactions for different investors.,"CREATE TABLE TRANSACTIONS (investor_id VARCHAR, amount_of_transaction INTEGER)","SELECT investor_id, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR, amount_of_transaction INTEGER) ### question:Show the average amount of transactions for different investors.","SELECT investor_id, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id" Show the average amount of transactions for different lots.,"CREATE TABLE TRANSACTIONS (transaction_id VARCHAR); CREATE TABLE Transactions_Lots (lot_id VARCHAR, transaction_id VARCHAR)","SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_id VARCHAR); CREATE TABLE Transactions_Lots (lot_id VARCHAR, transaction_id VARCHAR) ### question:Show the average amount of transactions for different lots.","SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id" "Show the average amount of transactions for different lots, ordered by average amount of transactions.","CREATE TABLE TRANSACTIONS (transaction_id VARCHAR); CREATE TABLE Transactions_Lots (lot_id VARCHAR, transaction_id VARCHAR)","SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY AVG(amount_of_transaction)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_id VARCHAR); CREATE TABLE Transactions_Lots (lot_id VARCHAR, transaction_id VARCHAR) ### question:Show the average amount of transactions for different lots, ordered by average amount of transactions.","SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY AVG(amount_of_transaction)" "Show the number of transactions with transaction type code ""SALE"" for different investors if it is larger than 0.","CREATE TABLE TRANSACTIONS (investor_id VARCHAR, transaction_type_code VARCHAR)","SELECT investor_id, COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = ""SALE"" GROUP BY investor_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR, transaction_type_code VARCHAR) ### question:Show the number of transactions with transaction type code ""SALE"" for different investors if it is larger than 0.","SELECT investor_id, COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = ""SALE"" GROUP BY investor_id" Show the number of transactions for different investors.,CREATE TABLE TRANSACTIONS (investor_id VARCHAR),"SELECT investor_id, COUNT(*) FROM TRANSACTIONS GROUP BY investor_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR) ### question:Show the number of transactions for different investors.","SELECT investor_id, COUNT(*) FROM TRANSACTIONS GROUP BY investor_id" Show the transaction type code that occurs the fewest times.,CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR),SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR) ### question:Show the transaction type code that occurs the fewest times.",SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) LIMIT 1 Show the transaction type code that occurs the most frequently.,CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR),SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR) ### question:Show the transaction type code that occurs the most frequently.",SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1 Show the description of the transaction type that occurs most frequently.,"CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR); CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR, transaction_type_code VARCHAR)",SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR); CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR, transaction_type_code VARCHAR) ### question:Show the description of the transaction type that occurs most frequently.",SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1 Show the id and details of the investor that has the largest number of transactions.,"CREATE TABLE TRANSACTIONS (investor_id VARCHAR); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR)","SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR) ### question:Show the id and details of the investor that has the largest number of transactions.","SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1" Show the id and details for the investors who have the top 3 number of transactions.,"CREATE TABLE TRANSACTIONS (investor_id VARCHAR); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR)","SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR) ### question:Show the id and details for the investors who have the top 3 number of transactions.","SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3" Show the ids of the investors who have at least two transactions.,CREATE TABLE TRANSACTIONS (investor_id VARCHAR); CREATE TABLE INVESTORS (investor_id VARCHAR),SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR); CREATE TABLE INVESTORS (investor_id VARCHAR) ### question:Show the ids of the investors who have at least two transactions.",SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2 "Show the ids and details of the investors who have at least two transactions with type code ""SALE"".","CREATE TABLE TRANSACTIONS (investor_id VARCHAR, transaction_type_code VARCHAR); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR)","SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = ""SALE"" GROUP BY T2.investor_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (investor_id VARCHAR, transaction_type_code VARCHAR); CREATE TABLE INVESTORS (Investor_details VARCHAR, investor_id VARCHAR) ### question:Show the ids and details of the investors who have at least two transactions with type code ""SALE"".","SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = ""SALE"" GROUP BY T2.investor_id HAVING COUNT(*) >= 2" What are the dates of transactions with at least 100 share count or amount bigger than 100?,"CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, share_count VARCHAR, amount_of_transaction VARCHAR)",SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR, share_count VARCHAR, amount_of_transaction VARCHAR) ### question:What are the dates of transactions with at least 100 share count or amount bigger than 100?",SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100 What are the details of all sales and purchases?,"CREATE TABLE purchases (sales_details VARCHAR, purchase_details VARCHAR); CREATE TABLE sales (sales_details VARCHAR, purchase_details VARCHAR)",SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE purchases (sales_details VARCHAR, purchase_details VARCHAR); CREATE TABLE sales (sales_details VARCHAR, purchase_details VARCHAR) ### question:What are the details of all sales and purchases?",SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases What are the details of the lots which are not used in any transactions?,"CREATE TABLE Lots (lot_details VARCHAR, lot_id VARCHAR); CREATE TABLE Lots (lot_details VARCHAR); CREATE TABLE transactions_lots (lot_id VARCHAR)",SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lots (lot_details VARCHAR, lot_id VARCHAR); CREATE TABLE Lots (lot_details VARCHAR); CREATE TABLE transactions_lots (lot_id VARCHAR) ### question:What are the details of the lots which are not used in any transactions?",SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id How many available hotels are there in total?,CREATE TABLE HOTELS (Id VARCHAR),SELECT COUNT(*) FROM HOTELS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (Id VARCHAR) ### question:How many available hotels are there in total?",SELECT COUNT(*) FROM HOTELS What are the price ranges of hotels?,CREATE TABLE HOTELS (price_range VARCHAR),SELECT price_range FROM HOTELS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (price_range VARCHAR) ### question:What are the price ranges of hotels?",SELECT price_range FROM HOTELS Show all distinct location names.,CREATE TABLE LOCATIONS (Location_Name VARCHAR),SELECT DISTINCT Location_Name FROM LOCATIONS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOCATIONS (Location_Name VARCHAR) ### question:Show all distinct location names.",SELECT DISTINCT Location_Name FROM LOCATIONS Show the names and details of all the staff members.,"CREATE TABLE Staff (Name VARCHAR, Other_Details VARCHAR)","SELECT Name, Other_Details FROM Staff","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (Name VARCHAR, Other_Details VARCHAR) ### question:Show the names and details of all the staff members.","SELECT Name, Other_Details FROM Staff" Show details of all visitors.,CREATE TABLE VISITORS (Tourist_Details VARCHAR),SELECT Tourist_Details FROM VISITORS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITORS (Tourist_Details VARCHAR) ### question:Show details of all visitors.",SELECT Tourist_Details FROM VISITORS Show the price ranges of hotels with 5 star ratings.,"CREATE TABLE HOTELS (price_range VARCHAR, star_rating_code VARCHAR)","SELECT price_range FROM HOTELS WHERE star_rating_code = ""5""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (price_range VARCHAR, star_rating_code VARCHAR) ### question:Show the price ranges of hotels with 5 star ratings.","SELECT price_range FROM HOTELS WHERE star_rating_code = ""5""" Show the average price range of hotels that have 5 star ratings and allow pets.,"CREATE TABLE HOTELS (price_range INTEGER, star_rating_code VARCHAR, pets_allowed_yn VARCHAR)","SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = ""5"" AND pets_allowed_yn = 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (price_range INTEGER, star_rating_code VARCHAR, pets_allowed_yn VARCHAR) ### question:Show the average price range of hotels that have 5 star ratings and allow pets.","SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = ""5"" AND pets_allowed_yn = 1" "What is the address of the location ""UK Gallery""?","CREATE TABLE LOCATIONS (Address VARCHAR, Location_Name VARCHAR)","SELECT Address FROM LOCATIONS WHERE Location_Name = ""UK Gallery""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOCATIONS (Address VARCHAR, Location_Name VARCHAR) ### question:What is the address of the location ""UK Gallery""?","SELECT Address FROM LOCATIONS WHERE Location_Name = ""UK Gallery""" What is the detail of the location UK Gallery?,"CREATE TABLE LOCATIONS (Other_Details VARCHAR, Location_Name VARCHAR)","SELECT Other_Details FROM LOCATIONS WHERE Location_Name = ""UK Gallery""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOCATIONS (Other_Details VARCHAR, Location_Name VARCHAR) ### question:What is the detail of the location UK Gallery?","SELECT Other_Details FROM LOCATIONS WHERE Location_Name = ""UK Gallery""" "Which location names contain the word ""film""?",CREATE TABLE LOCATIONS (Location_Name VARCHAR),"SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE ""%film%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE LOCATIONS (Location_Name VARCHAR) ### question:Which location names contain the word ""film""?","SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE ""%film%""" How many distinct names are associated with all the photos?,CREATE TABLE PHOTOS (Name VARCHAR),SELECT COUNT(DISTINCT Name) FROM PHOTOS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE PHOTOS (Name VARCHAR) ### question:How many distinct names are associated with all the photos?",SELECT COUNT(DISTINCT Name) FROM PHOTOS What are the distinct visit dates?,CREATE TABLE VISITS (Visit_Date VARCHAR),SELECT DISTINCT Visit_Date FROM VISITS,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITS (Visit_Date VARCHAR) ### question:What are the distinct visit dates?",SELECT DISTINCT Visit_Date FROM VISITS What are the names of the tourist attractions that can be accessed by bus?,"CREATE TABLE TOURIST_ATTRACTIONS (Name VARCHAR, How_to_Get_There VARCHAR)","SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = ""bus""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (Name VARCHAR, How_to_Get_There VARCHAR) ### question:What are the names of the tourist attractions that can be accessed by bus?","SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = ""bus""" What are the names and opening hours of the tourist attractions that can be accessed by bus or walk?,"CREATE TABLE TOURIST_ATTRACTIONS (Name VARCHAR, Opening_Hours VARCHAR, How_to_Get_There VARCHAR)","SELECT Name, Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = ""bus"" OR How_to_Get_There = ""walk""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (Name VARCHAR, Opening_Hours VARCHAR, How_to_Get_There VARCHAR) ### question:What are the names and opening hours of the tourist attractions that can be accessed by bus or walk?","SELECT Name, Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = ""bus"" OR How_to_Get_There = ""walk""" What are the star rating descriptions of the hotels with price above 10000?,"CREATE TABLE HOTELS (star_rating_code VARCHAR, price_range INTEGER); CREATE TABLE Ref_Hotel_Star_Ratings (star_rating_description VARCHAR, star_rating_code VARCHAR)",SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (star_rating_code VARCHAR, price_range INTEGER); CREATE TABLE Ref_Hotel_Star_Ratings (star_rating_description VARCHAR, star_rating_code VARCHAR) ### question:What are the star rating descriptions of the hotels with price above 10000?",SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000 What are the details and opening hours of the museums?,"CREATE TABLE TOURIST_ATTRACTIONS (Opening_Hours VARCHAR, Tourist_Attraction_ID VARCHAR); CREATE TABLE MUSEUMS (Museum_Details VARCHAR, Museum_ID VARCHAR)","SELECT T1.Museum_Details, T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (Opening_Hours VARCHAR, Tourist_Attraction_ID VARCHAR); CREATE TABLE MUSEUMS (Museum_Details VARCHAR, Museum_ID VARCHAR) ### question:What are the details and opening hours of the museums?","SELECT T1.Museum_Details, T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID" "What is the name of the tourist attraction that is associated with the photo ""game1""?","CREATE TABLE TOURIST_ATTRACTIONS (Name VARCHAR, Tourist_Attraction_ID VARCHAR); CREATE TABLE PHOTOS (Tourist_Attraction_ID VARCHAR, Name VARCHAR)","SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = ""game1""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (Name VARCHAR, Tourist_Attraction_ID VARCHAR); CREATE TABLE PHOTOS (Tourist_Attraction_ID VARCHAR, Name VARCHAR) ### question:What is the name of the tourist attraction that is associated with the photo ""game1""?","SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = ""game1""" "What are the names and descriptions of the photos taken at the tourist attraction ""film festival""?","CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, Name VARCHAR); CREATE TABLE PHOTOS (Name VARCHAR, Description VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name, T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = ""film festival""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, Name VARCHAR); CREATE TABLE PHOTOS (Name VARCHAR, Description VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:What are the names and descriptions of the photos taken at the tourist attraction ""film festival""?","SELECT T1.Name, T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = ""film festival""" What are the details and ways to get to tourist attractions related to royal family?,"CREATE TABLE TOURIST_ATTRACTIONS (How_to_Get_There VARCHAR, Tourist_Attraction_ID VARCHAR); CREATE TABLE ROYAL_FAMILY (Royal_Family_Details VARCHAR, Royal_Family_ID VARCHAR)","SELECT T1.Royal_Family_Details, T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (How_to_Get_There VARCHAR, Tourist_Attraction_ID VARCHAR); CREATE TABLE ROYAL_FAMILY (Royal_Family_Details VARCHAR, Royal_Family_ID VARCHAR) ### question:What are the details and ways to get to tourist attractions related to royal family?","SELECT T1.Royal_Family_Details, T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID" What are the details of the shops that can be accessed by walk?,"CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, How_to_Get_There VARCHAR); CREATE TABLE SHOPS (Shop_Details VARCHAR, Shop_ID VARCHAR)","SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = ""walk""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, How_to_Get_There VARCHAR); CREATE TABLE SHOPS (Shop_Details VARCHAR, Shop_ID VARCHAR) ### question:What are the details of the shops that can be accessed by walk?","SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = ""walk""" "What is the name of the staff that is in charge of the attraction named ""US museum""?","CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, Name VARCHAR); CREATE TABLE STAFF (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = ""US museum""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, Name VARCHAR); CREATE TABLE STAFF (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:What is the name of the staff that is in charge of the attraction named ""US museum""?","SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = ""US museum""" What are the details of the markets that can be accessed by walk or bus?,"CREATE TABLE Street_Markets (Market_Details VARCHAR, Market_ID VARCHAR); CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, How_to_Get_There VARCHAR)","SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = ""walk"" OR T2.How_to_Get_There = ""bus""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Street_Markets (Market_Details VARCHAR, Market_ID VARCHAR); CREATE TABLE TOURIST_ATTRACTIONS (Tourist_Attraction_ID VARCHAR, How_to_Get_There VARCHAR) ### question:What are the details of the markets that can be accessed by walk or bus?","SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = ""walk"" OR T2.How_to_Get_There = ""bus""" What are the visit date and details of the visitor whose detail is 'Vincent'?,"CREATE TABLE VISITORS (Tourist_ID VARCHAR, Tourist_Details VARCHAR); CREATE TABLE VISITS (Visit_Date VARCHAR, Visit_Details VARCHAR, Tourist_ID VARCHAR)","SELECT T2.Visit_Date, T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = ""Vincent""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITORS (Tourist_ID VARCHAR, Tourist_Details VARCHAR); CREATE TABLE VISITS (Visit_Date VARCHAR, Visit_Details VARCHAR, Tourist_ID VARCHAR) ### question:What are the visit date and details of the visitor whose detail is 'Vincent'?","SELECT T2.Visit_Date, T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = ""Vincent""" Which tourist attractions does the visitor with detail 'Vincent' visit?,"CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_ID VARCHAR, Tourist_Details VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = ""Vincent""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_ID VARCHAR, Tourist_Details VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:Which tourist attractions does the visitor with detail 'Vincent' visit?","SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = ""Vincent""" What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?,"CREATE TABLE VISITORS (Tourist_ID VARCHAR, Tourist_Details VARCHAR); CREATE TABLE VISITS (Visit_Date VARCHAR, Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name, T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Vincent"" OR T2.Tourist_Details = ""Vivian""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITORS (Tourist_ID VARCHAR, Tourist_Details VARCHAR); CREATE TABLE VISITS (Visit_Date VARCHAR, Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?","SELECT T1.Name, T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Vincent"" OR T2.Tourist_Details = ""Vivian""" Show the average price of hotels for each star rating code.,"CREATE TABLE HOTELS (star_rating_code VARCHAR, price_range INTEGER)","SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (star_rating_code VARCHAR, price_range INTEGER) ### question:Show the average price of hotels for each star rating code.","SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code" Show the average price of hotels for different pet policy.,"CREATE TABLE HOTELS (pets_allowed_yn VARCHAR, price_range INTEGER)","SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (pets_allowed_yn VARCHAR, price_range INTEGER) ### question:Show the average price of hotels for different pet policy.","SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn" "Show the id and star rating of each hotel, ordered by its price from low to high.","CREATE TABLE HOTELS (hotel_id VARCHAR, star_rating_code VARCHAR, price_range VARCHAR)","SELECT hotel_id, star_rating_code FROM HOTELS ORDER BY price_range","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (hotel_id VARCHAR, star_rating_code VARCHAR, price_range VARCHAR) ### question:Show the id and star rating of each hotel, ordered by its price from low to high.","SELECT hotel_id, star_rating_code FROM HOTELS ORDER BY price_range" Show the details of the top 3 most expensive hotels.,"CREATE TABLE HOTELS (other_hotel_details VARCHAR, price_range VARCHAR)",SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (other_hotel_details VARCHAR, price_range VARCHAR) ### question:Show the details of the top 3 most expensive hotels.",SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3 Show the details and star ratings of the 3 least expensive hotels.,"CREATE TABLE HOTELS (other_hotel_details VARCHAR, star_rating_code VARCHAR, price_range VARCHAR)","SELECT other_hotel_details, star_rating_code FROM HOTELS ORDER BY price_range LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE HOTELS (other_hotel_details VARCHAR, star_rating_code VARCHAR, price_range VARCHAR) ### question:Show the details and star ratings of the 3 least expensive hotels.","SELECT other_hotel_details, star_rating_code FROM HOTELS ORDER BY price_range LIMIT 3" Show the transportation method most people choose to get to tourist attractions.,CREATE TABLE Tourist_Attractions (How_to_Get_There VARCHAR),SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Tourist_Attractions (How_to_Get_There VARCHAR) ### question:Show the transportation method most people choose to get to tourist attractions.",SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1 Show the description and code of the attraction type most tourist attractions belong to.,"CREATE TABLE Ref_Attraction_Types (Attraction_Type_Description VARCHAR, Attraction_Type_Code VARCHAR); CREATE TABLE Tourist_Attractions (Attraction_Type_Code VARCHAR)","SELECT T1.Attraction_Type_Description, T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_Attraction_Types (Attraction_Type_Description VARCHAR, Attraction_Type_Code VARCHAR); CREATE TABLE Tourist_Attractions (Attraction_Type_Code VARCHAR) ### question:Show the description and code of the attraction type most tourist attractions belong to.","SELECT T1.Attraction_Type_Description, T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1" Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.,CREATE TABLE Tourist_Attractions (How_to_Get_There VARCHAR),"SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Tourist_Attractions (How_to_Get_There VARCHAR) ### question:Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.","SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There" "Show different tourist attractions' names, ids, and the corresponding number of visits.","CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name, T2.Tourist_Attraction_ID, COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:Show different tourist attractions' names, ids, and the corresponding number of visits.","SELECT T1.Name, T2.Tourist_Attraction_ID, COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID" Show the names and ids of tourist attractions that are visited at least two times.,"CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:Show the names and ids of tourist attractions that are visited at least two times.","SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) >= 2" Show the names and ids of tourist attractions that are visited at most once.,"CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) <= 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:Show the names and ids of tourist attractions that are visited at most once.","SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) <= 1" What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent?,"CREATE TABLE Tourist_Attractions (Name VARCHAR, Location_ID VARCHAR, How_to_Get_There VARCHAR); CREATE TABLE Locations (Location_ID VARCHAR, Address VARCHAR)","SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = ""660 Shea Crescent"" OR T2.How_to_Get_There = ""walk""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Tourist_Attractions (Name VARCHAR, Location_ID VARCHAR, How_to_Get_There VARCHAR); CREATE TABLE Locations (Location_ID VARCHAR, Address VARCHAR) ### question:What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent?","SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = ""660 Shea Crescent"" OR T2.How_to_Get_There = ""walk""" What are the names of the tourist attractions that have parking or shopping as their feature details?,"CREATE TABLE Tourist_Attraction_Features (tourist_attraction_id VARCHAR, Feature_ID VARCHAR); CREATE TABLE Features (Feature_ID VARCHAR, feature_Details VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, tourist_attraction_id VARCHAR)",SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Tourist_Attraction_Features (tourist_attraction_id VARCHAR, Feature_ID VARCHAR); CREATE TABLE Features (Feature_ID VARCHAR, feature_Details VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, tourist_attraction_id VARCHAR) ### question:What are the names of the tourist attractions that have parking or shopping as their feature details?",SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping' What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?,"CREATE TABLE Tourist_Attractions (Name VARCHAR, Location_ID VARCHAR, How_to_Get_There VARCHAR); CREATE TABLE Locations (Location_ID VARCHAR, Address VARCHAR)","SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = ""254 Ottilie Junction"" OR T2.How_to_Get_There = ""bus""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Tourist_Attractions (Name VARCHAR, Location_ID VARCHAR, How_to_Get_There VARCHAR); CREATE TABLE Locations (Location_ID VARCHAR, Address VARCHAR) ### question:What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?","SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = ""254 Ottilie Junction"" OR T2.How_to_Get_There = ""bus""" What are the names of the tourist attractions Vincent and Marcelle visit?,"CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_Details VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Vincent"" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Marcelle""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_Details VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:What are the names of the tourist attractions Vincent and Marcelle visit?","SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Vincent"" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Marcelle""" What are the names of tourist attraction that Alison visited but Rosalind did not visit?,"CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_Details VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)","SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Alison"" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Rosalind""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_Details VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR) ### question:What are the names of tourist attraction that Alison visited but Rosalind did not visit?","SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Alison"" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Rosalind""" How many tourists did not make any visit?,CREATE TABLE Visitors (Tourist_ID VARCHAR); CREATE TABLE Visits (Tourist_ID VARCHAR),SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Visitors (Tourist_ID VARCHAR); CREATE TABLE Visits (Tourist_ID VARCHAR) ### question:How many tourists did not make any visit?",SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits) How many video games exist?,CREATE TABLE Video_games (Id VARCHAR),SELECT COUNT(*) FROM Video_games,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (Id VARCHAR) ### question:How many video games exist?",SELECT COUNT(*) FROM Video_games How many video game types exist?,CREATE TABLE Video_games (gtype VARCHAR),SELECT COUNT(DISTINCT gtype) FROM Video_games,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gtype VARCHAR) ### question:How many video game types exist?",SELECT COUNT(DISTINCT gtype) FROM Video_games Show all video game types.,CREATE TABLE Video_games (gtype VARCHAR),SELECT DISTINCT gtype FROM Video_games,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gtype VARCHAR) ### question:Show all video game types.",SELECT DISTINCT gtype FROM Video_games Show all video games and their types in the order of their names.,"CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR)","SELECT gname, gtype FROM Video_games ORDER BY gname","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR) ### question:Show all video games and their types in the order of their names.","SELECT gname, gtype FROM Video_games ORDER BY gname" Show all video games with type Collectible card game.,"CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR)","SELECT gname FROM Video_games WHERE gtype = ""Collectible card game""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR) ### question:Show all video games with type Collectible card game.","SELECT gname FROM Video_games WHERE gtype = ""Collectible card game""" What is the type of video game Call of Destiny.,"CREATE TABLE Video_games (gtype VARCHAR, gname VARCHAR)","SELECT gtype FROM Video_games WHERE gname = ""Call of Destiny""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gtype VARCHAR, gname VARCHAR) ### question:What is the type of video game Call of Destiny.","SELECT gtype FROM Video_games WHERE gname = ""Call of Destiny""" How many video games have type Massively multiplayer online game?,CREATE TABLE Video_games (gtype VARCHAR),"SELECT COUNT(*) FROM Video_games WHERE gtype = ""Massively multiplayer online game""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gtype VARCHAR) ### question:How many video games have type Massively multiplayer online game?","SELECT COUNT(*) FROM Video_games WHERE gtype = ""Massively multiplayer online game""" Show all video game types and the number of video games in each type.,CREATE TABLE Video_games (gtype VARCHAR),"SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gtype VARCHAR) ### question:Show all video game types and the number of video games in each type.","SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype" Which game type has most number of games?,CREATE TABLE Video_games (gtype VARCHAR),SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gtype VARCHAR) ### question:Which game type has most number of games?",SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1 Which game type has least number of games?,CREATE TABLE Video_games (gtype VARCHAR),SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Video_games (gtype VARCHAR) ### question:Which game type has least number of games?",SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) LIMIT 1 Show ids for all students who live in CHI.,"CREATE TABLE Student (StuID VARCHAR, city_code VARCHAR)","SELECT StuID FROM Student WHERE city_code = ""CHI""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (StuID VARCHAR, city_code VARCHAR) ### question:Show ids for all students who live in CHI.","SELECT StuID FROM Student WHERE city_code = ""CHI""" Show ids for all students who have advisor 1121.,"CREATE TABLE Student (StuID VARCHAR, Advisor VARCHAR)",SELECT StuID FROM Student WHERE Advisor = 1121,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (StuID VARCHAR, Advisor VARCHAR) ### question:Show ids for all students who have advisor 1121.",SELECT StuID FROM Student WHERE Advisor = 1121 Show first name for all students with major 600.,"CREATE TABLE Student (Fname VARCHAR, Major VARCHAR)",SELECT Fname FROM Student WHERE Major = 600,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Fname VARCHAR, Major VARCHAR) ### question:Show first name for all students with major 600.",SELECT Fname FROM Student WHERE Major = 600 "Show the average, minimum, and maximum age for different majors.","CREATE TABLE Student (major VARCHAR, age INTEGER)","SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (major VARCHAR, age INTEGER) ### question:Show the average, minimum, and maximum age for different majors.","SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major" Show all advisors who have at least two students.,CREATE TABLE Student (advisor VARCHAR),SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (advisor VARCHAR) ### question:Show all advisors who have at least two students.",SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2 How many sports do we have?,CREATE TABLE Sportsinfo (sportname VARCHAR),SELECT COUNT(DISTINCT sportname) FROM Sportsinfo,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (sportname VARCHAR) ### question:How many sports do we have?",SELECT COUNT(DISTINCT sportname) FROM Sportsinfo How many students play sports?,CREATE TABLE Sportsinfo (StuID VARCHAR),SELECT COUNT(DISTINCT StuID) FROM Sportsinfo,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR) ### question:How many students play sports?",SELECT COUNT(DISTINCT StuID) FROM Sportsinfo List ids for all student who are on scholarship.,"CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR)",SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR) ### question:List ids for all student who are on scholarship.",SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y' Show last names for all student who are on scholarship.,"CREATE TABLE Student (Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR)",SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR) ### question:Show last names for all student who are on scholarship.",SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y' How many games are played for all students?,CREATE TABLE Sportsinfo (gamesplayed INTEGER),SELECT SUM(gamesplayed) FROM Sportsinfo,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (gamesplayed INTEGER) ### question:How many games are played for all students?",SELECT SUM(gamesplayed) FROM Sportsinfo How many games are played for all football games by students on scholarship?,"CREATE TABLE Sportsinfo (gamesplayed INTEGER, sportname VARCHAR, onscholarship VARCHAR)","SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = ""Football"" AND onscholarship = 'Y'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (gamesplayed INTEGER, sportname VARCHAR, onscholarship VARCHAR) ### question:How many games are played for all football games by students on scholarship?","SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = ""Football"" AND onscholarship = 'Y'" Show all sport name and the number of students.,CREATE TABLE Sportsinfo (sportname VARCHAR),"SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (sportname VARCHAR) ### question:Show all sport name and the number of students.","SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname" Show all student IDs with the number of sports and total number of games played,"CREATE TABLE Sportsinfo (StuID VARCHAR, gamesplayed INTEGER)","SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR, gamesplayed INTEGER) ### question:Show all student IDs with the number of sports and total number of games played","SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID" Show all student IDs with more than total 10 hours per week on all sports played.,"CREATE TABLE Sportsinfo (StuID VARCHAR, hoursperweek INTEGER)",SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR, hoursperweek INTEGER) ### question:Show all student IDs with more than total 10 hours per week on all sports played.",SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10 What is the first name and last name of the student who have most number of sports?,"CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR)","SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR) ### question:What is the first name and last name of the student who have most number of sports?","SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1" Which sport has most number of students on scholarship?,"CREATE TABLE Sportsinfo (sportname VARCHAR, onscholarship VARCHAR)",SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (sportname VARCHAR, onscholarship VARCHAR) ### question:Which sport has most number of students on scholarship?",SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1 Show student ids who don't have any sports.,CREATE TABLE Sportsinfo (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR),SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) ### question:Show student ids who don't have any sports.",SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo Show student ids who are on scholarship and have major 600.,"CREATE TABLE Sportsinfo (StuID VARCHAR, major VARCHAR, onscholarship VARCHAR); CREATE TABLE Student (StuID VARCHAR, major VARCHAR, onscholarship VARCHAR)",SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR, major VARCHAR, onscholarship VARCHAR); CREATE TABLE Student (StuID VARCHAR, major VARCHAR, onscholarship VARCHAR) ### question:Show student ids who are on scholarship and have major 600.",SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y' Show student ids who are female and play football.,"CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR)","SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = ""Football""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR) ### question:Show student ids who are female and play football.","SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = ""Football""" Show all male student ids who don't play football.,"CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR)","SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = ""Football""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR) ### question:Show all male student ids who don't play football.","SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = ""Football""" Show total hours per week and number of games played for student David Shieber.,"CREATE TABLE Student (StuID VARCHAR, Fname VARCHAR, Lname VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR)","SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = ""David"" AND T2.Lname = ""Shieber""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (StuID VARCHAR, Fname VARCHAR, Lname VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR) ### question:Show total hours per week and number of games played for student David Shieber.","SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = ""David"" AND T2.Lname = ""Shieber""" Show total hours per week and number of games played for students under 20.,"CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Sportsinfo (StuID VARCHAR)","SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Sportsinfo (StuID VARCHAR) ### question:Show total hours per week and number of games played for students under 20.","SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20" How many students play video games?,CREATE TABLE Plays_games (StuID VARCHAR),SELECT COUNT(DISTINCT StuID) FROM Plays_games,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (StuID VARCHAR) ### question:How many students play video games?",SELECT COUNT(DISTINCT StuID) FROM Plays_games Show ids of students who don't play video game.,CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR),SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) ### question:Show ids of students who don't play video game.",SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games Show ids of students who play video game and play sports.,CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR),SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR) ### question:Show ids of students who play video game and play sports.",SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games Show all game ids and the number of hours played.,"CREATE TABLE Plays_games (gameid VARCHAR, hours_played INTEGER)","SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (gameid VARCHAR, hours_played INTEGER) ### question:Show all game ids and the number of hours played.","SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid" Show all student ids and the number of hours played.,"CREATE TABLE Plays_games (Stuid VARCHAR, hours_played INTEGER)","SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (Stuid VARCHAR, hours_played INTEGER) ### question:Show all student ids and the number of hours played.","SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid" Show the game name that has most number of hours played.,CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR),SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR) ### question:Show the game name that has most number of hours played.",SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1 Show all game names played by at least 1000 hours.,CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR),SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR) ### question:Show all game names played by at least 1000 hours.",SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000 Show all game names played by Linda Smith,"CREATE TABLE Student (Stuid VARCHAR, Lname VARCHAR, Fname VARCHAR); CREATE TABLE Plays_games (gameid VARCHAR, Stuid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR)","SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = ""Smith"" AND T3.Fname = ""Linda""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (Stuid VARCHAR, Lname VARCHAR, Fname VARCHAR); CREATE TABLE Plays_games (gameid VARCHAR, Stuid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR) ### question:Show all game names played by Linda Smith","SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = ""Smith"" AND T3.Fname = ""Linda""" Find the last and first name of students who are playing Football or Lacrosse.,"CREATE TABLE SportsInfo (StuID VARCHAR, SportName VARCHAR); CREATE TABLE Student (lname VARCHAR, fname VARCHAR, StuID VARCHAR)","SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = ""Football"" OR T1.SportName = ""Lacrosse""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE SportsInfo (StuID VARCHAR, SportName VARCHAR); CREATE TABLE Student (lname VARCHAR, fname VARCHAR, StuID VARCHAR) ### question:Find the last and first name of students who are playing Football or Lacrosse.","SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = ""Football"" OR T1.SportName = ""Lacrosse""" Find the first name and age of the students who are playing both Football and Lacrosse.,"CREATE TABLE Student (fname VARCHAR, age VARCHAR, StuID VARCHAR, SportName VARCHAR); CREATE TABLE Sportsinfo (fname VARCHAR, age VARCHAR, StuID VARCHAR, SportName VARCHAR)","SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = ""Football"" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = ""Lacrosse"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (fname VARCHAR, age VARCHAR, StuID VARCHAR, SportName VARCHAR); CREATE TABLE Sportsinfo (fname VARCHAR, age VARCHAR, StuID VARCHAR, SportName VARCHAR) ### question:Find the first name and age of the students who are playing both Football and Lacrosse.","SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = ""Football"" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = ""Lacrosse"")" Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.,"CREATE TABLE Plays_games (StuID VARCHAR, GameID VARCHAR); CREATE TABLE Student (lname VARCHAR, sex VARCHAR, StuID VARCHAR); CREATE TABLE Video_games (GameID VARCHAR, Gname VARCHAR)","SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = ""Call of Destiny"" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = ""Works of Widenius"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Plays_games (StuID VARCHAR, GameID VARCHAR); CREATE TABLE Student (lname VARCHAR, sex VARCHAR, StuID VARCHAR); CREATE TABLE Video_games (GameID VARCHAR, Gname VARCHAR) ### question:Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.","SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = ""Call of Destiny"" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = ""Works of Widenius"")" Find the name of all customers.,CREATE TABLE customers (customer_name VARCHAR),SELECT customer_name FROM customers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR) ### question:Find the name of all customers.",SELECT customer_name FROM customers What is the average amount of items ordered in each order?,CREATE TABLE order_items (order_quantity INTEGER),SELECT AVG(order_quantity) FROM order_items,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_quantity INTEGER) ### question:What is the average amount of items ordered in each order?",SELECT AVG(order_quantity) FROM order_items "What are the names of customers who use payment method ""Cash""?","CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR)","SELECT customer_name FROM customers WHERE payment_method = ""Cash""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR) ### question:What are the names of customers who use payment method ""Cash""?","SELECT customer_name FROM customers WHERE payment_method = ""Cash""" "Find the ""date became customers"" of the customers whose ID is between 10 and 20.","CREATE TABLE customers (date_became_customer VARCHAR, customer_id INTEGER)",SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (date_became_customer VARCHAR, customer_id INTEGER) ### question:Find the ""date became customers"" of the customers whose ID is between 10 and 20.",SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20 Which payment method is used by most customers?,CREATE TABLE customers (payment_method VARCHAR),SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (payment_method VARCHAR) ### question:Which payment method is used by most customers?",SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1 What are the names of customers using the most popular payment method?,"CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR)",SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR) ### question:What are the names of customers using the most popular payment method?",SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1) What are all the payment methods?,CREATE TABLE customers (payment_method VARCHAR),SELECT DISTINCT payment_method FROM customers,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (payment_method VARCHAR) ### question:What are all the payment methods?",SELECT DISTINCT payment_method FROM customers What are the details of all products?,CREATE TABLE products (product_details VARCHAR),SELECT DISTINCT product_details FROM products,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_details VARCHAR) ### question:What are the details of all products?",SELECT DISTINCT product_details FROM products "Find the name of all customers whose name contains ""Alex"".",CREATE TABLE customers (customer_name VARCHAR),"SELECT customer_name FROM customers WHERE customer_name LIKE ""%Alex%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR) ### question:Find the name of all customers whose name contains ""Alex"".","SELECT customer_name FROM customers WHERE customer_name LIKE ""%Alex%""" "Find the detail of products whose detail contains the word ""Latte"" or the word ""Americano""",CREATE TABLE products (product_details VARCHAR),"SELECT product_details FROM products WHERE product_details LIKE ""%Latte%"" OR product_details LIKE ""%Americano%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_details VARCHAR) ### question:Find the detail of products whose detail contains the word ""Latte"" or the word ""Americano""","SELECT product_details FROM products WHERE product_details LIKE ""%Latte%"" OR product_details LIKE ""%Americano%""" "What is the address content of the customer named ""Maudie Kertzmann""?","CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE addresses (address_content VARCHAR, address_id VARCHAR)","SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = ""Maudie Kertzmann""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE addresses (address_content VARCHAR, address_id VARCHAR) ### question:What is the address content of the customer named ""Maudie Kertzmann""?","SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = ""Maudie Kertzmann""" "How many customers are living in city ""Lake Geovannyton""?","CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, city VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR)","SELECT COUNT(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = ""Lake Geovannyton""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, city VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR) ### question:How many customers are living in city ""Lake Geovannyton""?","SELECT COUNT(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = ""Lake Geovannyton""" Find the name of customers who are living in Colorado?,"CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)","SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = ""Colorado""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR) ### question:Find the name of customers who are living in Colorado?","SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = ""Colorado""" Find the list of cities that no customer is living in.,"CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE addresses (city VARCHAR)",SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE addresses (city VARCHAR) ### question:Find the list of cities that no customer is living in.",SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id) Which city has the most customers living in?,"CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR)",SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR) ### question:Which city has the most customers living in?",SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1 Find the city with post code 255.,"CREATE TABLE addresses (city VARCHAR, zip_postcode VARCHAR)",SELECT city FROM addresses WHERE zip_postcode = 255,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (city VARCHAR, zip_postcode VARCHAR) ### question:Find the city with post code 255.",SELECT city FROM addresses WHERE zip_postcode = 255 Find the state and country of all cities with post code starting with 4.,"CREATE TABLE addresses (state_province_county VARCHAR, country VARCHAR, zip_postcode VARCHAR)","SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE ""4%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (state_province_county VARCHAR, country VARCHAR, zip_postcode VARCHAR) ### question:Find the state and country of all cities with post code starting with 4.","SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE ""4%""" List the countries having more than 4 addresses listed.,"CREATE TABLE addresses (country VARCHAR, address_id VARCHAR)",SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (country VARCHAR, address_id VARCHAR) ### question:List the countries having more than 4 addresses listed.",SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4 List all the contact channel codes that were used less than 5 times.,"CREATE TABLE customer_contact_channels (channel_code VARCHAR, customer_id VARCHAR)",SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_contact_channels (channel_code VARCHAR, customer_id VARCHAR) ### question:List all the contact channel codes that were used less than 5 times.",SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5 "Which contact channel has been used by the customer with name ""Tillman Ernser""?","CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (customer_id VARCHAR)","SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = ""Tillman Ernser""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (customer_id VARCHAR) ### question:Which contact channel has been used by the customer with name ""Tillman Ernser""?","SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = ""Tillman Ernser""" "What is the ""active to date"" of the latest contact channel used by ""Tillman Ernser""?","CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (active_to_date INTEGER, customer_id VARCHAR)","SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = ""Tillman Ernser""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (active_to_date INTEGER, customer_id VARCHAR) ### question:What is the ""active to date"" of the latest contact channel used by ""Tillman Ernser""?","SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = ""Tillman Ernser""" What is the average time span of contact channels in the database?,"CREATE TABLE customer_contact_channels (active_to_date VARCHAR, active_from_date VARCHAR)",SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_contact_channels (active_to_date VARCHAR, active_from_date VARCHAR) ### question:What is the average time span of contact channels in the database?",SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels What is the channel code and contact number of the customer contact channel that was active for the longest time?,"CREATE TABLE customer_contact_channels (channel_code VARCHAR, contact_number VARCHAR, active_to_date VARCHAR, active_from_date VARCHAR)","SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_contact_channels (channel_code VARCHAR, contact_number VARCHAR, active_to_date VARCHAR, active_from_date VARCHAR) ### question:What is the channel code and contact number of the customer contact channel that was active for the longest time?","SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)" Find the name and active date of the customer that use email as the contact channel.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_contact_channels (active_from_date VARCHAR, customer_id VARCHAR, channel_code VARCHAR)","SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_contact_channels (active_from_date VARCHAR, customer_id VARCHAR, channel_code VARCHAR) ### question:Find the name and active date of the customer that use email as the contact channel.","SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'" What is the name of the customer that made the order with the largest quantity?,"CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (order_quantity INTEGER); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (order_quantity INTEGER); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:What is the name of the customer that made the order with the largest quantity?",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items) What is the name of the customer that has purchased the most items?,"CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:What is the name of the customer that has purchased the most items?",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1 What is the payment method of the customer that has purchased the least quantity of items?,"CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (payment_method VARCHAR, customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)",SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (payment_method VARCHAR, customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:What is the payment method of the customer that has purchased the least quantity of items?",SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) LIMIT 1 How many types of products have Rodrick Heaney bought in total?,"CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)","SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = ""Rodrick Heaney""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:How many types of products have Rodrick Heaney bought in total?","SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = ""Rodrick Heaney""" "What is the total quantity of products purchased by ""Rodrick Heaney""?","CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)","SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = ""Rodrick Heaney""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:What is the total quantity of products purchased by ""Rodrick Heaney""?","SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = ""Rodrick Heaney""" "How many customers have at least one order with status ""Cancelled""?","CREATE TABLE customer_orders (customer_id VARCHAR, order_status VARCHAR)","SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = ""Cancelled""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (customer_id VARCHAR, order_status VARCHAR) ### question:How many customers have at least one order with status ""Cancelled""?","SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = ""Cancelled""" "How many orders have detail ""Second time""?",CREATE TABLE customer_orders (order_details VARCHAR),"SELECT COUNT(*) FROM customer_orders WHERE order_details = ""Second time""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (order_details VARCHAR) ### question:How many orders have detail ""Second time""?","SELECT COUNT(*) FROM customer_orders WHERE order_details = ""Second time""" "Find the customer name and date of the orders that have the status ""Delivered"".","CREATE TABLE customer_orders (order_date VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)","SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = ""Delivered""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (order_date VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:Find the customer name and date of the orders that have the status ""Delivered"".","SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = ""Delivered""" "What is the total number of products that are in orders with status ""Cancelled""?","CREATE TABLE customer_orders (order_id VARCHAR, order_status VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR)","SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = ""Cancelled""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (order_id VARCHAR, order_status VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR) ### question:What is the total number of products that are in orders with status ""Cancelled""?","SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = ""Cancelled""" Find the total amount of products ordered before 2018-03-17 07:13:53.,"CREATE TABLE customer_orders (order_id VARCHAR, order_date INTEGER); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR)","SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < ""2018-03-17 07:13:53""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (order_id VARCHAR, order_date INTEGER); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR) ### question:Find the total amount of products ordered before 2018-03-17 07:13:53.","SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < ""2018-03-17 07:13:53""" Who made the latest order?,"CREATE TABLE customer_orders (customer_id VARCHAR, order_date VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customer_orders (customer_id VARCHAR, order_date VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:Who made the latest order?",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1 Which product has been ordered most number of times?,"CREATE TABLE products (product_details VARCHAR, product_id VARCHAR); CREATE TABLE order_items (product_id VARCHAR)",SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_details VARCHAR, product_id VARCHAR); CREATE TABLE order_items (product_id VARCHAR) ### question:Which product has been ordered most number of times?",SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1 Find the name and ID of the product whose total order quantity is the largest.,"CREATE TABLE order_items (product_id VARCHAR, order_quantity INTEGER); CREATE TABLE products (product_details VARCHAR, product_id VARCHAR)","SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (product_id VARCHAR, order_quantity INTEGER); CREATE TABLE products (product_details VARCHAR, product_id VARCHAR) ### question:Find the name and ID of the product whose total order quantity is the largest.","SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1" "Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.","CREATE TABLE addresses (address_content VARCHAR, city VARCHAR, state_province_county VARCHAR)","SELECT address_content FROM addresses WHERE city = ""East Julianaside"" AND state_province_county = ""Texas"" UNION SELECT address_content FROM addresses WHERE city = ""Gleasonmouth"" AND state_province_county = ""Arizona""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (address_content VARCHAR, city VARCHAR, state_province_county VARCHAR) ### question:Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.","SELECT address_content FROM addresses WHERE city = ""East Julianaside"" AND state_province_county = ""Texas"" UNION SELECT address_content FROM addresses WHERE city = ""Gleasonmouth"" AND state_province_county = ""Arizona""" Find the name of customers who did not pay with Cash.,"CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR)",SELECT customer_name FROM customers WHERE payment_method <> 'Cash',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR) ### question:Find the name of customers who did not pay with Cash.",SELECT customer_name FROM customers WHERE payment_method <> 'Cash' Find the names of customers who never ordered product Latte.,"CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)",SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:Find the names of customers who never ordered product Latte.",SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' Find the names of customers who never placed an order.,"CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)",SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) ### question:Find the names of customers who never placed an order.",SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id Find the names of customers who ordered both products Latte and Americano.,"CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR) ### question:Find the names of customers who ordered both products Latte and Americano.",SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano' List the age of all music artists.,CREATE TABLE artist (Age VARCHAR),SELECT Age FROM artist,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Age VARCHAR) ### question:List the age of all music artists.",SELECT Age FROM artist What is the average age of all artists?,CREATE TABLE artist (Age INTEGER),SELECT AVG(Age) FROM artist,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Age INTEGER) ### question:What is the average age of all artists?",SELECT AVG(Age) FROM artist "What are the famous titles of the artist ""Triumfall""?","CREATE TABLE artist (Famous_Title VARCHAR, Artist VARCHAR)","SELECT Famous_Title FROM artist WHERE Artist = ""Triumfall""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Famous_Title VARCHAR, Artist VARCHAR) ### question:What are the famous titles of the artist ""Triumfall""?","SELECT Famous_Title FROM artist WHERE Artist = ""Triumfall""" What are the distinct Famous release dates?,CREATE TABLE artist (Famous_Release_date VARCHAR),SELECT DISTINCT (Famous_Release_date) FROM artist,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Famous_Release_date VARCHAR) ### question:What are the distinct Famous release dates?",SELECT DISTINCT (Famous_Release_date) FROM artist Return the dates of ceremony and the results of all music festivals,"CREATE TABLE music_festival (Date_of_ceremony VARCHAR, RESULT VARCHAR)","SELECT Date_of_ceremony, RESULT FROM music_festival","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (Date_of_ceremony VARCHAR, RESULT VARCHAR) ### question:Return the dates of ceremony and the results of all music festivals","SELECT Date_of_ceremony, RESULT FROM music_festival" "What are the category of music festivals with result ""Awarded""?","CREATE TABLE music_festival (Category VARCHAR, RESULT VARCHAR)","SELECT Category FROM music_festival WHERE RESULT = ""Awarded""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (Category VARCHAR, RESULT VARCHAR) ### question:What are the category of music festivals with result ""Awarded""?","SELECT Category FROM music_festival WHERE RESULT = ""Awarded""" What are the maximum and minimum week on top of all volumes?,CREATE TABLE volume (Weeks_on_Top INTEGER),"SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Weeks_on_Top INTEGER) ### question:What are the maximum and minimum week on top of all volumes?","SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume" What are the songs in volumes with more than 1 week on top?,"CREATE TABLE volume (Song VARCHAR, Weeks_on_Top INTEGER)",SELECT Song FROM volume WHERE Weeks_on_Top > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Song VARCHAR, Weeks_on_Top INTEGER) ### question:What are the songs in volumes with more than 1 week on top?",SELECT Song FROM volume WHERE Weeks_on_Top > 1 Please list all songs in volumes in ascending alphabetical order.,CREATE TABLE volume (Song VARCHAR),SELECT Song FROM volume ORDER BY Song,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Song VARCHAR) ### question:Please list all songs in volumes in ascending alphabetical order.",SELECT Song FROM volume ORDER BY Song How many distinct artists do the volumes associate to?,CREATE TABLE volume (Artist_ID VARCHAR),SELECT COUNT(DISTINCT Artist_ID) FROM volume,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Artist_ID VARCHAR) ### question:How many distinct artists do the volumes associate to?",SELECT COUNT(DISTINCT Artist_ID) FROM volume Please show the date of ceremony of the volumes that last more than 2 weeks on top.,"CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Volume VARCHAR); CREATE TABLE volume (Volume_ID VARCHAR, Weeks_on_Top INTEGER)",SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Volume VARCHAR); CREATE TABLE volume (Volume_ID VARCHAR, Weeks_on_Top INTEGER) ### question:Please show the date of ceremony of the volumes that last more than 2 weeks on top.",SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2 "Please show the songs that have result ""nominated"" at music festivals.","CREATE TABLE volume (Song VARCHAR, Volume_ID VARCHAR); CREATE TABLE music_festival (Volume VARCHAR, Result VARCHAR)","SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = ""Nominated""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Song VARCHAR, Volume_ID VARCHAR); CREATE TABLE music_festival (Volume VARCHAR, Result VARCHAR) ### question:Please show the songs that have result ""nominated"" at music festivals.","SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = ""Nominated""" "What are the issue dates of volumes associated with the artist ""Gorgoroth""?","CREATE TABLE artist (Artist_ID VARCHAR, Artist VARCHAR); CREATE TABLE volume (Issue_Date VARCHAR, Artist_ID VARCHAR)","SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = ""Gorgoroth""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Artist_ID VARCHAR, Artist VARCHAR); CREATE TABLE volume (Issue_Date VARCHAR, Artist_ID VARCHAR) ### question:What are the issue dates of volumes associated with the artist ""Gorgoroth""?","SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = ""Gorgoroth""" What are the songs in volumes associated with the artist aged 32 or older?,"CREATE TABLE volume (Song VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR)",SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Song VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR) ### question:What are the songs in volumes associated with the artist aged 32 or older?",SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32 What is the average weeks on top of volumes associated with the artist aged 25 or younger?,"CREATE TABLE volume (Weeks_on_Top INTEGER, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR)",SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Weeks_on_Top INTEGER, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR) ### question:What is the average weeks on top of volumes associated with the artist aged 25 or younger?",SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25 What are the famous title of the artists associated with volumes with more than 2 weeks on top?,"CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE volume (Artist_ID VARCHAR, Weeks_on_Top INTEGER)",SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE volume (Artist_ID VARCHAR, Weeks_on_Top INTEGER) ### question:What are the famous title of the artists associated with volumes with more than 2 weeks on top?",SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 Please list the age and famous title of artists in descending order of age.,"CREATE TABLE artist (Famous_Title VARCHAR, Age VARCHAR)","SELECT Famous_Title, Age FROM artist ORDER BY Age DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Famous_Title VARCHAR, Age VARCHAR) ### question:Please list the age and famous title of artists in descending order of age.","SELECT Famous_Title, Age FROM artist ORDER BY Age DESC" What is the famous release date of the artist with the oldest age?,"CREATE TABLE artist (Famous_Release_date VARCHAR, Age VARCHAR)",SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Famous_Release_date VARCHAR, Age VARCHAR) ### question:What is the famous release date of the artist with the oldest age?",SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1 Please show the categories of the music festivals and the count.,CREATE TABLE music_festival (Category VARCHAR),"SELECT Category, COUNT(*) FROM music_festival GROUP BY Category","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (Category VARCHAR) ### question:Please show the categories of the music festivals and the count.","SELECT Category, COUNT(*) FROM music_festival GROUP BY Category" What is the most common result of the music festival?,CREATE TABLE music_festival (RESULT VARCHAR),SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (RESULT VARCHAR) ### question:What is the most common result of the music festival?",SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1 Please show the categories of the music festivals with count more than 1.,CREATE TABLE music_festival (Category VARCHAR),SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (Category VARCHAR) ### question:Please show the categories of the music festivals with count more than 1.",SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1 What is the song in the volume with the maximum weeks on top?,"CREATE TABLE volume (Song VARCHAR, Weeks_on_Top VARCHAR)",SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Song VARCHAR, Weeks_on_Top VARCHAR) ### question:What is the song in the volume with the maximum weeks on top?",SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1 Find the famous titles of artists that do not have any volume.,"CREATE TABLE volume (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR)",SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR) ### question:Find the famous titles of artists that do not have any volume.",SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume) Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.,"CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE volume (Artist_ID VARCHAR, Weeks_on_Top INTEGER)",SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE volume (Artist_ID VARCHAR, Weeks_on_Top INTEGER) ### question:Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.",SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2 "What are the date of ceremony of music festivals with category ""Best Song"" and result ""Awarded""?","CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Category VARCHAR, RESULT VARCHAR)","SELECT Date_of_ceremony FROM music_festival WHERE Category = ""Best Song"" AND RESULT = ""Awarded""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Category VARCHAR, RESULT VARCHAR) ### question:What are the date of ceremony of music festivals with category ""Best Song"" and result ""Awarded""?","SELECT Date_of_ceremony FROM music_festival WHERE Category = ""Best Song"" AND RESULT = ""Awarded""" What is the issue date of the volume with the minimum weeks on top?,"CREATE TABLE volume (Issue_Date VARCHAR, Weeks_on_Top VARCHAR)",SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Issue_Date VARCHAR, Weeks_on_Top VARCHAR) ### question:What is the issue date of the volume with the minimum weeks on top?",SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top LIMIT 1 "Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.",CREATE TABLE music_festival (RESULT VARCHAR),"SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE music_festival (RESULT VARCHAR) ### question:Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.","SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC" What are the issue dates of volumes associated with the artist aged 23 or younger?,"CREATE TABLE volume (Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR)",SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE volume (Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR) ### question:What are the issue dates of volumes associated with the artist aged 23 or younger?",SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23 How many roller coasters are there?,CREATE TABLE roller_coaster (Id VARCHAR),SELECT COUNT(*) FROM roller_coaster,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Id VARCHAR) ### question:How many roller coasters are there?",SELECT COUNT(*) FROM roller_coaster List the names of roller coasters by ascending order of length.,"CREATE TABLE roller_coaster (Name VARCHAR, LENGTH VARCHAR)",SELECT Name FROM roller_coaster ORDER BY LENGTH,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Name VARCHAR, LENGTH VARCHAR) ### question:List the names of roller coasters by ascending order of length.",SELECT Name FROM roller_coaster ORDER BY LENGTH What are the lengths and heights of roller coasters?,"CREATE TABLE roller_coaster (LENGTH VARCHAR, Height VARCHAR)","SELECT LENGTH, Height FROM roller_coaster","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (LENGTH VARCHAR, Height VARCHAR) ### question:What are the lengths and heights of roller coasters?","SELECT LENGTH, Height FROM roller_coaster" "List the names of countries whose language is not ""German"".","CREATE TABLE country (Name VARCHAR, Languages VARCHAR)","SELECT Name FROM country WHERE Languages <> ""German""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE country (Name VARCHAR, Languages VARCHAR) ### question:List the names of countries whose language is not ""German"".","SELECT Name FROM country WHERE Languages <> ""German""" Show the statuses of roller coasters longer than 3300 or higher than 100.,"CREATE TABLE roller_coaster (Status VARCHAR, LENGTH VARCHAR, Height VARCHAR)",SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Status VARCHAR, LENGTH VARCHAR, Height VARCHAR) ### question:Show the statuses of roller coasters longer than 3300 or higher than 100.",SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100 What are the speeds of the longest roller coaster?,"CREATE TABLE roller_coaster (Speed VARCHAR, LENGTH VARCHAR)",SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Speed VARCHAR, LENGTH VARCHAR) ### question:What are the speeds of the longest roller coaster?",SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1 What is the average speed of roller coasters?,CREATE TABLE roller_coaster (Speed INTEGER),SELECT AVG(Speed) FROM roller_coaster,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Speed INTEGER) ### question:What is the average speed of roller coasters?",SELECT AVG(Speed) FROM roller_coaster Show the different statuses and the numbers of roller coasters for each status.,CREATE TABLE roller_coaster (Status VARCHAR),"SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Status VARCHAR) ### question:Show the different statuses and the numbers of roller coasters for each status.","SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status" Please show the most common status of roller coasters.,CREATE TABLE roller_coaster (Status VARCHAR),SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Status VARCHAR) ### question:Please show the most common status of roller coasters.",SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1 List the status shared by more than two roller coaster.,CREATE TABLE roller_coaster (Status VARCHAR),SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Status VARCHAR) ### question:List the status shared by more than two roller coaster.",SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2 Show the park of the roller coaster with the highest speed.,"CREATE TABLE roller_coaster (Park VARCHAR, Speed VARCHAR)",SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Park VARCHAR, Speed VARCHAR) ### question:Show the park of the roller coaster with the highest speed.",SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1 Show the names of roller coasters and names of country they are in.,"CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR); CREATE TABLE roller_coaster (Name VARCHAR, Country_ID VARCHAR)","SELECT T2.Name, T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR); CREATE TABLE roller_coaster (Name VARCHAR, Country_ID VARCHAR) ### question:Show the names of roller coasters and names of country they are in.","SELECT T2.Name, T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID" Show the names of countries that have more than one roller coaster.,"CREATE TABLE roller_coaster (Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR)",SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR) ### question:Show the names of countries that have more than one roller coaster.",SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1 Show the name and population of the country that has the highest roller coaster.,"CREATE TABLE roller_coaster (Country_ID VARCHAR, Height VARCHAR); CREATE TABLE country (Name VARCHAR, population VARCHAR, Country_ID VARCHAR)","SELECT T1.Name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Country_ID VARCHAR, Height VARCHAR); CREATE TABLE country (Name VARCHAR, population VARCHAR, Country_ID VARCHAR) ### question:Show the name and population of the country that has the highest roller coaster.","SELECT T1.Name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1" Show the names of countries and the average speed of roller coasters from each country.,"CREATE TABLE roller_coaster (Speed INTEGER, Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR)","SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE roller_coaster (Speed INTEGER, Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR) ### question:Show the names of countries and the average speed of roller coasters from each country.","SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name" How many countries do not have an roller coaster longer than 3000?,"CREATE TABLE country (country_id VARCHAR, LENGTH INTEGER); CREATE TABLE roller_coaster (country_id VARCHAR, LENGTH INTEGER)",SELECT COUNT(*) FROM country WHERE NOT country_id IN (SELECT country_id FROM roller_coaster WHERE LENGTH > 3000),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE country (country_id VARCHAR, LENGTH INTEGER); CREATE TABLE roller_coaster (country_id VARCHAR, LENGTH INTEGER) ### question:How many countries do not have an roller coaster longer than 3000?",SELECT COUNT(*) FROM country WHERE NOT country_id IN (SELECT country_id FROM roller_coaster WHERE LENGTH > 3000) "What are the country names, area and population which has both roller coasters with speed higher","CREATE TABLE country (name VARCHAR, area VARCHAR, population VARCHAR, Country_ID VARCHAR); CREATE TABLE roller_coaster (Country_ID VARCHAR, speed INTEGER)","SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed < 55","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE country (name VARCHAR, area VARCHAR, population VARCHAR, Country_ID VARCHAR); CREATE TABLE roller_coaster (Country_ID VARCHAR, speed INTEGER) ### question:What are the country names, area and population which has both roller coasters with speed higher","SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed < 55" How many different captain ranks are there?,CREATE TABLE captain (rank VARCHAR),SELECT COUNT(DISTINCT rank) FROM captain,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (rank VARCHAR) ### question:How many different captain ranks are there?",SELECT COUNT(DISTINCT rank) FROM captain How many captains are in each rank?,CREATE TABLE captain (rank VARCHAR),"SELECT COUNT(*), rank FROM captain GROUP BY rank","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (rank VARCHAR) ### question:How many captains are in each rank?","SELECT COUNT(*), rank FROM captain GROUP BY rank" How many captains with younger than 50 are in each rank?,"CREATE TABLE captain (rank VARCHAR, age INTEGER)","SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (rank VARCHAR, age INTEGER) ### question:How many captains with younger than 50 are in each rank?","SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank" Sort all captain names by their ages from old to young.,"CREATE TABLE captain (name VARCHAR, age VARCHAR)",SELECT name FROM captain ORDER BY age DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (name VARCHAR, age VARCHAR) ### question:Sort all captain names by their ages from old to young.",SELECT name FROM captain ORDER BY age DESC "Find the name, class and rank of all captains.","CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, rank VARCHAR)","SELECT name, CLASS, rank FROM captain","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, rank VARCHAR) ### question:Find the name, class and rank of all captains.","SELECT name, CLASS, rank FROM captain" Which rank is the most common among captains?,CREATE TABLE captain (rank VARCHAR),SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (rank VARCHAR) ### question:Which rank is the most common among captains?",SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1 Which classes have more than two captains?,CREATE TABLE captain (CLASS VARCHAR),SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (CLASS VARCHAR) ### question:Which classes have more than two captains?",SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2 Find the name of captains whose rank are either Midshipman or Lieutenant.,"CREATE TABLE captain (name VARCHAR, rank VARCHAR)",SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (name VARCHAR, rank VARCHAR) ### question:Find the name of captains whose rank are either Midshipman or Lieutenant.",SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant' What are the average and minimum age of captains in different class?,"CREATE TABLE captain (CLASS VARCHAR, age INTEGER)","SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (CLASS VARCHAR, age INTEGER) ### question:What are the average and minimum age of captains in different class?","SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS" Find the captain rank that has some captains in both Cutter and Armed schooner classes.,"CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR)",SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR) ### question:Find the captain rank that has some captains in both Cutter and Armed schooner classes.",SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner' Find the captain rank that has no captain in Third-rate ship of the line class.,"CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR)",SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR) ### question:Find the captain rank that has no captain in Third-rate ship of the line class.",SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line' What is the name of the youngest captain?,"CREATE TABLE captain (name VARCHAR, age VARCHAR)",SELECT name FROM captain ORDER BY age LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (name VARCHAR, age VARCHAR) ### question:What is the name of the youngest captain?",SELECT name FROM captain ORDER BY age LIMIT 1 "Find the name, type, and flag of the ship that is built in the most recent year.","CREATE TABLE ship (name VARCHAR, TYPE VARCHAR, flag VARCHAR, built_year VARCHAR)","SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (name VARCHAR, TYPE VARCHAR, flag VARCHAR, built_year VARCHAR) ### question:Find the name, type, and flag of the ship that is built in the most recent year.","SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1" "Group by ships by flag, and return number of ships that have each flag.",CREATE TABLE ship (flag VARCHAR),"SELECT COUNT(*), flag FROM ship GROUP BY flag","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (flag VARCHAR) ### question:Group by ships by flag, and return number of ships that have each flag.","SELECT COUNT(*), flag FROM ship GROUP BY flag" Which flag is most widely used among all ships?,CREATE TABLE ship (flag VARCHAR),SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (flag VARCHAR) ### question:Which flag is most widely used among all ships?",SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1 List all ship names in the order of built year and class.,"CREATE TABLE ship (name VARCHAR, built_year VARCHAR, CLASS VARCHAR)","SELECT name FROM ship ORDER BY built_year, CLASS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (name VARCHAR, built_year VARCHAR, CLASS VARCHAR) ### question:List all ship names in the order of built year and class.","SELECT name FROM ship ORDER BY built_year, CLASS" Find the ship type that are used by both ships with Panama and Malta flags.,"CREATE TABLE ship (TYPE VARCHAR, flag VARCHAR)",SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (TYPE VARCHAR, flag VARCHAR) ### question:Find the ship type that are used by both ships with Panama and Malta flags.",SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta' In which year were most of ships built?,CREATE TABLE ship (built_year VARCHAR),SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (built_year VARCHAR) ### question:In which year were most of ships built?",SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1 Find the name of the ships that have more than one captain.,"CREATE TABLE captain (ship_id VARCHAR); CREATE TABLE ship (name VARCHAR, ship_id VARCHAR)",SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (ship_id VARCHAR); CREATE TABLE ship (name VARCHAR, ship_id VARCHAR) ### question:Find the name of the ships that have more than one captain.",SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1 what are the names and classes of the ships that do not have any captain yet?,"CREATE TABLE ship (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR); CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR)","SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR); CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR) ### question:what are the names and classes of the ships that do not have any captain yet?","SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)" Find the name of the ship that is steered by the youngest captain.,"CREATE TABLE ship (name VARCHAR, ship_id VARCHAR); CREATE TABLE captain (ship_id VARCHAR, age VARCHAR)",SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (name VARCHAR, ship_id VARCHAR); CREATE TABLE captain (ship_id VARCHAR, age VARCHAR) ### question:Find the name of the ship that is steered by the youngest captain.",SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1 Find the name and flag of ships that are not steered by any captain with Midshipman rank.,"CREATE TABLE captain (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR); CREATE TABLE ship (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR)","SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE captain (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR); CREATE TABLE ship (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR) ### question:Find the name and flag of ships that are not steered by any captain with Midshipman rank.","SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')" Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.,"CREATE TABLE ship (name VARCHAR, ship_id VARCHAR); CREATE TABLE captain (ship_id VARCHAR, rank VARCHAR)",SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE ship (name VARCHAR, ship_id VARCHAR); CREATE TABLE captain (ship_id VARCHAR, rank VARCHAR) ### question:Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.",SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant' What is id of the city that hosted events in the most recent year?,"CREATE TABLE hosting_city (host_city VARCHAR, YEAR VARCHAR)",SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE hosting_city (host_city VARCHAR, YEAR VARCHAR) ### question:What is id of the city that hosted events in the most recent year?",SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1 "Find the match ids of the cities that hosted competition ""1994 FIFA World Cup qualification""?","CREATE TABLE MATCH (match_id VARCHAR, competition VARCHAR)","SELECT match_id FROM MATCH WHERE competition = ""1994 FIFA World Cup qualification""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (match_id VARCHAR, competition VARCHAR) ### question:Find the match ids of the cities that hosted competition ""1994 FIFA World Cup qualification""?","SELECT match_id FROM MATCH WHERE competition = ""1994 FIFA World Cup qualification""" Find the cities which were once a host city after 2010?,"CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR, year INTEGER)",SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR, year INTEGER) ### question:Find the cities which were once a host city after 2010?",SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010 Which city has hosted the most events?,"CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR)",SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR) ### question:Which city has hosted the most events?",SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1 "What is the venue of the competition ""1994 FIFA World Cup qualification"" hosted by ""Nanjing ( Jiangsu )""?","CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE MATCH (venue VARCHAR, match_id VARCHAR, competition VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR, match_id VARCHAR)","SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = ""Nanjing ( Jiangsu )"" AND T3.competition = ""1994 FIFA World Cup qualification""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE MATCH (venue VARCHAR, match_id VARCHAR, competition VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR, match_id VARCHAR) ### question:What is the venue of the competition ""1994 FIFA World Cup qualification"" hosted by ""Nanjing ( Jiangsu )""?","SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = ""Nanjing ( Jiangsu )"" AND T3.competition = ""1994 FIFA World Cup qualification""" Give me the temperature of Shanghai in January.,"CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE temperature (Jan VARCHAR, city_id VARCHAR)","SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = ""Shanghai""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE temperature (Jan VARCHAR, city_id VARCHAR) ### question:Give me the temperature of Shanghai in January.","SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = ""Shanghai""" "What is the host year of city ""Taizhou ( Zhejiang )""?","CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE hosting_city (year VARCHAR, host_city VARCHAR)","SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = ""Taizhou ( Zhejiang )""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE hosting_city (year VARCHAR, host_city VARCHAR) ### question:What is the host year of city ""Taizhou ( Zhejiang )""?","SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = ""Taizhou ( Zhejiang )""" Which three cities have the largest regional population?,"CREATE TABLE city (city VARCHAR, regional_population VARCHAR)",SELECT city FROM city ORDER BY regional_population DESC LIMIT 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, regional_population VARCHAR) ### question:Which three cities have the largest regional population?",SELECT city FROM city ORDER BY regional_population DESC LIMIT 3 Which city has the lowest GDP? Please list the city name and its GDP.,"CREATE TABLE city (city VARCHAR, GDP VARCHAR)","SELECT city, GDP FROM city ORDER BY GDP LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, GDP VARCHAR) ### question:Which city has the lowest GDP? Please list the city name and its GDP.","SELECT city, GDP FROM city ORDER BY GDP LIMIT 1" Which city has the highest temperature in February?,"CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Feb VARCHAR)",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Feb VARCHAR) ### question:Which city has the highest temperature in February?",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1 Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?,"CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar VARCHAR, Jul VARCHAR, Oct VARCHAR)",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar VARCHAR, Jul VARCHAR, Oct VARCHAR) ### question:Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?,"CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar INTEGER, Jul VARCHAR)",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar INTEGER, Jul VARCHAR) ### question:Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.,"CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar INTEGER, Dec VARCHAR)",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar INTEGER, Dec VARCHAR) ### question:Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?,"CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Feb INTEGER, Jun VARCHAR)",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Feb INTEGER, Jun VARCHAR) ### question:Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?",SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city Please give me a list of cities whose regional population is over 10000000.,"CREATE TABLE city (city VARCHAR, regional_population INTEGER)",SELECT city FROM city WHERE regional_population > 10000000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, regional_population INTEGER) ### question:Please give me a list of cities whose regional population is over 10000000.",SELECT city FROM city WHERE regional_population > 10000000 Please give me a list of cities whose regional population is over 8000000 or under 5000000.,"CREATE TABLE city (city VARCHAR, regional_population INTEGER)",SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (city VARCHAR, regional_population INTEGER) ### question:Please give me a list of cities whose regional population is over 8000000 or under 5000000.",SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000 Find the number of matches in different competitions.,CREATE TABLE MATCH (Competition VARCHAR),"SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (Competition VARCHAR) ### question:Find the number of matches in different competitions.","SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition" List venues of all matches in the order of their dates starting from the most recent one.,"CREATE TABLE MATCH (venue VARCHAR, date VARCHAR)",SELECT venue FROM MATCH ORDER BY date DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE MATCH (venue VARCHAR, date VARCHAR) ### question:List venues of all matches in the order of their dates starting from the most recent one.",SELECT venue FROM MATCH ORDER BY date DESC what is the GDP of the city with the largest population.,"CREATE TABLE city (gdp VARCHAR, Regional_Population VARCHAR)",SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE city (gdp VARCHAR, Regional_Population VARCHAR) ### question:what is the GDP of the city with the largest population.",SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1 What are the GDP and population of the city that already served as a host more than once?,CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE city (city_id VARCHAR),"SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE city (city_id VARCHAR) ### question:What are the GDP and population of the city that already served as a host more than once?","SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1" "List every individual's first name, middle name and last name in alphabetical order by last name.","CREATE TABLE individuals (individual_first_name VARCHAR, individual_middle_name VARCHAR, individual_last_name VARCHAR)","SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE individuals (individual_first_name VARCHAR, individual_middle_name VARCHAR, individual_last_name VARCHAR) ### question:List every individual's first name, middle name and last name in alphabetical order by last name.","SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name" List all the types of forms.,CREATE TABLE forms (form_type_code VARCHAR),SELECT DISTINCT form_type_code FROM forms,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE forms (form_type_code VARCHAR) ### question:List all the types of forms.",SELECT DISTINCT form_type_code FROM forms Find the name of the most popular party form.,"CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE forms (form_name VARCHAR, form_id VARCHAR)",SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE forms (form_name VARCHAR, form_id VARCHAR) ### question:Find the name of the most popular party form.",SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1 "Find the payment method and phone of the party with email ""enrico09@example.com"".","CREATE TABLE parties (payment_method_code VARCHAR, party_phone VARCHAR, party_email VARCHAR)","SELECT payment_method_code, party_phone FROM parties WHERE party_email = ""enrico09@example.com""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE parties (payment_method_code VARCHAR, party_phone VARCHAR, party_email VARCHAR) ### question:Find the payment method and phone of the party with email ""enrico09@example.com"".","SELECT payment_method_code, party_phone FROM parties WHERE party_email = ""enrico09@example.com""" Find the emails of parties with the most popular party form.,"CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE parties (party_email VARCHAR, party_id VARCHAR); CREATE TABLE party_forms (party_id VARCHAR, form_id VARCHAR)",SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE parties (party_email VARCHAR, party_id VARCHAR); CREATE TABLE party_forms (party_id VARCHAR, form_id VARCHAR) ### question:Find the emails of parties with the most popular party form.",SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1) List all the name of organizations in order of the date formed.,"CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR)",SELECT organization_name FROM organizations ORDER BY date_formed,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR) ### question:List all the name of organizations in order of the date formed.",SELECT organization_name FROM organizations ORDER BY date_formed Find the name of the youngest organization.,"CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR)",SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR) ### question:Find the name of the youngest organization.",SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1 "Find the last name of the latest contact individual of the organization ""Labour Party"".","CREATE TABLE organizations (organization_id VARCHAR, organization_name VARCHAR); CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organization_contact_individuals (organization_id VARCHAR, individual_id VARCHAR, date_contact_to VARCHAR)","SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = ""Labour Party"" ORDER BY t2.date_contact_to DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organizations (organization_id VARCHAR, organization_name VARCHAR); CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organization_contact_individuals (organization_id VARCHAR, individual_id VARCHAR, date_contact_to VARCHAR) ### question:Find the last name of the latest contact individual of the organization ""Labour Party"".","SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = ""Labour Party"" ORDER BY t2.date_contact_to DESC LIMIT 1" Find the last name of the first ever contact person of the organization with the highest UK Vat number.,"CREATE TABLE organizations (uk_vat_number INTEGER); CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organizations (organization_id VARCHAR, uk_vat_number INTEGER); CREATE TABLE organization_contact_individuals (organization_id VARCHAR, individual_id VARCHAR, date_contact_to VARCHAR)",SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organizations (uk_vat_number INTEGER); CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organizations (organization_id VARCHAR, uk_vat_number INTEGER); CREATE TABLE organization_contact_individuals (organization_id VARCHAR, individual_id VARCHAR, date_contact_to VARCHAR) ### question:Find the last name of the first ever contact person of the organization with the highest UK Vat number.",SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to LIMIT 1 Find name of the services that has never been used.,"CREATE TABLE services (service_name VARCHAR); CREATE TABLE party_services (service_id VARCHAR); CREATE TABLE services (service_name VARCHAR, service_id VARCHAR)",SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE services (service_name VARCHAR); CREATE TABLE party_services (service_id VARCHAR); CREATE TABLE services (service_name VARCHAR, service_id VARCHAR) ### question:Find name of the services that has never been used.",SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id Find the name of all the cities and states.,"CREATE TABLE addresses (town_city VARCHAR, state_province_county VARCHAR)",SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (town_city VARCHAR, state_province_county VARCHAR) ### question:Find the name of all the cities and states.",SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses "How many cities are there in state ""Colorado""?",CREATE TABLE addresses (state_province_county VARCHAR),"SELECT COUNT(*) FROM addresses WHERE state_province_county = ""Colorado""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (state_province_county VARCHAR) ### question:How many cities are there in state ""Colorado""?","SELECT COUNT(*) FROM addresses WHERE state_province_county = ""Colorado""" Find the payment method code used by more than 3 parties.,CREATE TABLE parties (payment_method_code VARCHAR),SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE parties (payment_method_code VARCHAR) ### question:Find the payment method code used by more than 3 parties.",SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3 "Find the name of organizations whose names contain ""Party"".",CREATE TABLE organizations (organization_name VARCHAR),"SELECT organization_name FROM organizations WHERE organization_name LIKE ""%Party%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organizations (organization_name VARCHAR) ### question:Find the name of organizations whose names contain ""Party"".","SELECT organization_name FROM organizations WHERE organization_name LIKE ""%Party%""" How many distinct payment methods are used by parties?,CREATE TABLE parties (payment_method_code VARCHAR),SELECT COUNT(DISTINCT payment_method_code) FROM parties,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE parties (payment_method_code VARCHAR) ### question:How many distinct payment methods are used by parties?",SELECT COUNT(DISTINCT payment_method_code) FROM parties Which is the email of the party that has used the services the most number of times?,"CREATE TABLE parties (party_email VARCHAR, party_id VARCHAR); CREATE TABLE party_services (customer_id VARCHAR)",SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE parties (party_email VARCHAR, party_id VARCHAR); CREATE TABLE party_services (customer_id VARCHAR) ### question:Which is the email of the party that has used the services the most number of times?",SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1 "Which state can address ""6862 Kaitlyn Knolls"" possibly be in?","CREATE TABLE addresses (state_province_county VARCHAR, line_1_number_building VARCHAR)","SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE ""%6862 Kaitlyn Knolls%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE addresses (state_province_county VARCHAR, line_1_number_building VARCHAR) ### question:Which state can address ""6862 Kaitlyn Knolls"" possibly be in?","SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE ""%6862 Kaitlyn Knolls%""" What is the name of organization that has the greatest number of contact individuals?,"CREATE TABLE organization_contact_individuals (organization_id VARCHAR); CREATE TABLE organizations (organization_name VARCHAR, organization_id VARCHAR)",SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE organization_contact_individuals (organization_id VARCHAR); CREATE TABLE organizations (organization_name VARCHAR, organization_id VARCHAR) ### question:What is the name of organization that has the greatest number of contact individuals?",SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1 Find the last name of the individuals that have been contact individuals of an organization.,"CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organization_contact_individuals (individual_id VARCHAR)",SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organization_contact_individuals (individual_id VARCHAR) ### question:Find the last name of the individuals that have been contact individuals of an organization.",SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id How many drivers are there?,CREATE TABLE driver (Id VARCHAR),SELECT COUNT(*) FROM driver,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (Id VARCHAR) ### question:How many drivers are there?",SELECT COUNT(*) FROM driver "Show the name, home city, and age for all drivers.","CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR)","SELECT name, home_city, age FROM driver","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR) ### question:Show the name, home city, and age for all drivers.","SELECT name, home_city, age FROM driver" Show the party and the number of drivers in each party.,CREATE TABLE driver (party VARCHAR),"SELECT party, COUNT(*) FROM driver GROUP BY party","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (party VARCHAR) ### question:Show the party and the number of drivers in each party.","SELECT party, COUNT(*) FROM driver GROUP BY party" Show the name of drivers in descending order of age.,"CREATE TABLE driver (name VARCHAR, age VARCHAR)",SELECT name FROM driver ORDER BY age DESC,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (name VARCHAR, age VARCHAR) ### question:Show the name of drivers in descending order of age.",SELECT name FROM driver ORDER BY age DESC Show all different home cities.,CREATE TABLE driver (home_city VARCHAR),SELECT DISTINCT home_city FROM driver,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (home_city VARCHAR) ### question:Show all different home cities.",SELECT DISTINCT home_city FROM driver Show the home city with the most number of drivers.,CREATE TABLE driver (home_city VARCHAR),SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (home_city VARCHAR) ### question:Show the home city with the most number of drivers.",SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1 Show the party with drivers from Hartford and drivers older than 40.,"CREATE TABLE driver (party VARCHAR, home_city VARCHAR, age VARCHAR)",SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (party VARCHAR, home_city VARCHAR, age VARCHAR) ### question:Show the party with drivers from Hartford and drivers older than 40.",SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40 Show home city where at least two drivers older than 40 are from.,"CREATE TABLE driver (home_city VARCHAR, age INTEGER)",SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (home_city VARCHAR, age INTEGER) ### question:Show home city where at least two drivers older than 40 are from.",SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2 Show all home cities except for those having a driver older than 40.,"CREATE TABLE driver (home_city VARCHAR, age INTEGER)",SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (home_city VARCHAR, age INTEGER) ### question:Show all home cities except for those having a driver older than 40.",SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40 Show the names of the drivers without a school bus.,"CREATE TABLE school_bus (name VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR)",SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school_bus (name VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR) ### question:Show the names of the drivers without a school bus.",SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus) Show the types of schools that have two schools.,CREATE TABLE school (TYPE VARCHAR),SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (TYPE VARCHAR) ### question:Show the types of schools that have two schools.",SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2 Show the school name and driver name for all school buses.,"CREATE TABLE school (school VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR)","SELECT T2.school, T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (school VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR) ### question:Show the school name and driver name for all school buses.","SELECT T2.school, T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id" "What is the maximum, minimum and average years spent working on a school bus?",CREATE TABLE school_bus (years_working INTEGER),"SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school_bus (years_working INTEGER) ### question:What is the maximum, minimum and average years spent working on a school bus?","SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus" Show the school name and type for schools without a school bus.,"CREATE TABLE school_bus (school VARCHAR, TYPE VARCHAR, school_id VARCHAR); CREATE TABLE school (school VARCHAR, TYPE VARCHAR, school_id VARCHAR)","SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school_bus (school VARCHAR, TYPE VARCHAR, school_id VARCHAR); CREATE TABLE school (school VARCHAR, TYPE VARCHAR, school_id VARCHAR) ### question:Show the school name and type for schools without a school bus.","SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)" Show the type of school and the number of buses for each type.,"CREATE TABLE school (type VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR)","SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school (type VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR) ### question:Show the type of school and the number of buses for each type.","SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type" How many drivers are from Hartford city or younger than 40?,"CREATE TABLE driver (home_city VARCHAR, age VARCHAR)",SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (home_city VARCHAR, age VARCHAR) ### question:How many drivers are from Hartford city or younger than 40?",SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40 List names for drivers from Hartford city and younger than 40.,"CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR)",SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR) ### question:List names for drivers from Hartford city and younger than 40.",SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40 find the name of driver who is driving the school bus with the longest working history.,"CREATE TABLE school_bus (driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR)",SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER BY years_working DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE school_bus (driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR) ### question:find the name of driver who is driving the school bus with the longest working history.",SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER BY years_working DESC LIMIT 1 How many flights have a velocity larger than 200?,CREATE TABLE flight (velocity INTEGER),SELECT COUNT(*) FROM flight WHERE velocity > 200,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE flight (velocity INTEGER) ### question:How many flights have a velocity larger than 200?",SELECT COUNT(*) FROM flight WHERE velocity > 200 "List the vehicle flight number, date and pilot of all the flights, ordered by altitude.","CREATE TABLE flight (vehicle_flight_number VARCHAR, date VARCHAR, pilot VARCHAR, altitude VARCHAR)","SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE flight (vehicle_flight_number VARCHAR, date VARCHAR, pilot VARCHAR, altitude VARCHAR) ### question:List the vehicle flight number, date and pilot of all the flights, ordered by altitude.","SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude" "List the id, country, city and name of the airports ordered alphabetically by the name.","CREATE TABLE airport (id VARCHAR, country VARCHAR, city VARCHAR, name VARCHAR)","SELECT id, country, city, name FROM airport ORDER BY name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (id VARCHAR, country VARCHAR, city VARCHAR, name VARCHAR) ### question:List the id, country, city and name of the airports ordered alphabetically by the name.","SELECT id, country, city, name FROM airport ORDER BY name" What is maximum group equity shareholding of the companies?,CREATE TABLE operate_company (group_equity_shareholding INTEGER),SELECT MAX(group_equity_shareholding) FROM operate_company,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE operate_company (group_equity_shareholding INTEGER) ### question:What is maximum group equity shareholding of the companies?",SELECT MAX(group_equity_shareholding) FROM operate_company What is the velocity of the pilot named 'Thompson'?,"CREATE TABLE flight (velocity INTEGER, pilot VARCHAR)",SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE flight (velocity INTEGER, pilot VARCHAR) ### question:What is the velocity of the pilot named 'Thompson'?",SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' What are the names and types of the companies that have ever operated a flight?,"CREATE TABLE operate_company (name VARCHAR, type VARCHAR, id VARCHAR); CREATE TABLE flight (Id VARCHAR)","SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE operate_company (name VARCHAR, type VARCHAR, id VARCHAR); CREATE TABLE flight (Id VARCHAR) ### question:What are the names and types of the companies that have ever operated a flight?","SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id" What are the names of the airports which are not in the country 'Iceland'?,"CREATE TABLE airport (name VARCHAR, country VARCHAR)",SELECT name FROM airport WHERE country <> 'Iceland',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (name VARCHAR, country VARCHAR) ### question:What are the names of the airports which are not in the country 'Iceland'?",SELECT name FROM airport WHERE country <> 'Iceland' What are the distinct types of the companies that have operated any flights with velocity less than 200?,"CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (type VARCHAR, id VARCHAR)",SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (type VARCHAR, id VARCHAR) ### question:What are the distinct types of the companies that have operated any flights with velocity less than 200?",SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200 What are the ids and names of the companies that operated more than one flight?,"CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR, name VARCHAR)","SELECT T1.id, T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR, name VARCHAR) ### question:What are the ids and names of the companies that operated more than one flight?","SELECT T1.id, T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING COUNT(*) > 1" "What is the id, name and IATA code of the airport that had most number of flights?","CREATE TABLE airport (id VARCHAR, name VARCHAR, IATA VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR)","SELECT T1.id, T1.name, T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (id VARCHAR, name VARCHAR, IATA VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR) ### question:What is the id, name and IATA code of the airport that had most number of flights?","SELECT T1.id, T1.name, T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1" What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?,"CREATE TABLE airport (id VARCHAR, country VARCHAR, name VARCHAR); CREATE TABLE flight (pilot VARCHAR, airport_id VARCHAR)",SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (id VARCHAR, country VARCHAR, name VARCHAR); CREATE TABLE flight (pilot VARCHAR, airport_id VARCHAR) ### question:What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?",SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport' "What is the most common company type, and how many are there?",CREATE TABLE operate_company (TYPE VARCHAR),"SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE operate_company (TYPE VARCHAR) ### question:What is the most common company type, and how many are there?","SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1" How many airports haven't the pilot 'Thompson' driven an aircraft?,"CREATE TABLE airport (id VARCHAR, airport_id VARCHAR, pilot VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR, pilot VARCHAR)",SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (id VARCHAR, airport_id VARCHAR, pilot VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR, pilot VARCHAR) ### question:How many airports haven't the pilot 'Thompson' driven an aircraft?",SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson') List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.,"CREATE TABLE operate_company (id VARCHAR, principal_activities VARCHAR); CREATE TABLE flight (Id VARCHAR)",SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE operate_company (id VARCHAR, principal_activities VARCHAR); CREATE TABLE flight (Id VARCHAR) ### question:List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.",SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services' Which of the airport names contains the word 'international'?,CREATE TABLE airport (name VARCHAR),SELECT name FROM airport WHERE name LIKE '%international%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (name VARCHAR) ### question:Which of the airport names contains the word 'international'?",SELECT name FROM airport WHERE name LIKE '%international%' How many companies operates airlines in each airport?,CREATE TABLE airport (id VARCHAR); CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR),"SELECT T3.id, COUNT(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (id VARCHAR); CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR) ### question:How many companies operates airlines in each airport?","SELECT T3.id, COUNT(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id" how many airports are there in each country?,CREATE TABLE airport (country VARCHAR),"SELECT COUNT(*), country FROM airport GROUP BY country","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (country VARCHAR) ### question:how many airports are there in each country?","SELECT COUNT(*), country FROM airport GROUP BY country" which countries have more than 2 airports?,CREATE TABLE airport (country VARCHAR),SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airport (country VARCHAR) ### question:which countries have more than 2 airports?",SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2 which pilot is in charge of the most number of flights?,CREATE TABLE flight (pilot VARCHAR),SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE flight (pilot VARCHAR) ### question:which pilot is in charge of the most number of flights?",SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1 Show all account ids and account details.,"CREATE TABLE Accounts (account_id VARCHAR, account_details VARCHAR)","SELECT account_id, account_details FROM Accounts","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Accounts (account_id VARCHAR, account_details VARCHAR) ### question:Show all account ids and account details.","SELECT account_id, account_details FROM Accounts" How many statements do we have?,CREATE TABLE Statements (Id VARCHAR),SELECT COUNT(*) FROM Statements,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Statements (Id VARCHAR) ### question:How many statements do we have?",SELECT COUNT(*) FROM Statements List all statement ids and statement details.,"CREATE TABLE Statements (STATEMENT_ID VARCHAR, statement_details VARCHAR)","SELECT STATEMENT_ID, statement_details FROM Statements","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Statements (STATEMENT_ID VARCHAR, statement_details VARCHAR) ### question:List all statement ids and statement details.","SELECT STATEMENT_ID, statement_details FROM Statements" "Show statement id, statement detail, account detail for accounts.","CREATE TABLE Accounts (statement_id VARCHAR, account_details VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR)","SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Accounts (statement_id VARCHAR, account_details VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR) ### question:Show statement id, statement detail, account detail for accounts.","SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id" Show all statement id and the number of accounts for each statement.,CREATE TABLE Accounts (STATEMENT_ID VARCHAR),"SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Accounts (STATEMENT_ID VARCHAR) ### question:Show all statement id and the number of accounts for each statement.","SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID" Show the statement id and the statement detail for the statement with most number of accounts.,"CREATE TABLE Accounts (statement_id VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR)","SELECT T1.statement_id, T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Accounts (statement_id VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR) ### question:Show the statement id and the statement detail for the statement with most number of accounts.","SELECT T1.statement_id, T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT(*) DESC LIMIT 1" Show the number of documents.,CREATE TABLE Documents (Id VARCHAR),SELECT COUNT(*) FROM Documents,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (Id VARCHAR) ### question:Show the number of documents.",SELECT COUNT(*) FROM Documents "List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.","CREATE TABLE Documents (document_type_code VARCHAR, document_name VARCHAR, document_description VARCHAR)","SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_type_code VARCHAR, document_name VARCHAR, document_description VARCHAR) ### question:List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.","SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'" Show the ids and names of all documents.,"CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR)","SELECT document_id, document_name FROM Documents","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR) ### question:Show the ids and names of all documents.","SELECT document_id, document_name FROM Documents" Find names and ids of all documents with document type code BK.,"CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR, document_type_code VARCHAR)","SELECT document_name, document_id FROM Documents WHERE document_type_code = ""BK""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR, document_type_code VARCHAR) ### question:Find names and ids of all documents with document type code BK.","SELECT document_name, document_id FROM Documents WHERE document_type_code = ""BK""" How many documents are with document type code BK for each product id?,"CREATE TABLE Documents (project_id VARCHAR, document_type_code VARCHAR)","SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = ""BK"" GROUP BY project_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (project_id VARCHAR, document_type_code VARCHAR) ### question:How many documents are with document type code BK for each product id?","SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = ""BK"" GROUP BY project_id" Show the document name and the document date for all documents on project with details 'Graph Database project'.,"CREATE TABLE Documents (project_id VARCHAR); CREATE TABLE projects (project_id VARCHAR, project_details VARCHAR)","SELECT document_name, document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (project_id VARCHAR); CREATE TABLE projects (project_id VARCHAR, project_details VARCHAR) ### question:Show the document name and the document date for all documents on project with details 'Graph Database project'.","SELECT document_name, document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project'" Show project ids and the number of documents in each project.,CREATE TABLE Documents (project_id VARCHAR),"SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (project_id VARCHAR) ### question:Show project ids and the number of documents in each project.","SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id" What is the id of the project with least number of documents?,CREATE TABLE Documents (project_id VARCHAR),SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (project_id VARCHAR) ### question:What is the id of the project with least number of documents?",SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1 Show the ids for projects with at least 2 documents.,CREATE TABLE Documents (project_id VARCHAR),SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (project_id VARCHAR) ### question:Show the ids for projects with at least 2 documents.",SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2 List document type codes and the number of documents in each code.,CREATE TABLE Documents (document_type_code VARCHAR),"SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_type_code VARCHAR) ### question:List document type codes and the number of documents in each code.","SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code" What is the document type code with most number of documents?,CREATE TABLE Documents (document_type_code VARCHAR),SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_type_code VARCHAR) ### question:What is the document type code with most number of documents?",SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 Show the document type code with fewer than 3 documents.,CREATE TABLE Documents (document_type_code VARCHAR),SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_type_code VARCHAR) ### question:Show the document type code with fewer than 3 documents.",SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3 Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.,"CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR); CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR)","SELECT T1.statement_details, T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR); CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR) ### question:Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.","SELECT T1.statement_details, T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project'" "Show all document type codes, document type names, document type descriptions.","CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR, document_type_description VARCHAR)","SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR, document_type_description VARCHAR) ### question:Show all document type codes, document type names, document type descriptions.","SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types" What is the document type description for document type named Film?,"CREATE TABLE Ref_document_types (document_type_description VARCHAR, document_type_name VARCHAR)","SELECT document_type_description FROM Ref_document_types WHERE document_type_name = ""Film""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (document_type_description VARCHAR, document_type_name VARCHAR) ### question:What is the document type description for document type named Film?","SELECT document_type_description FROM Ref_document_types WHERE document_type_name = ""Film""" What is the document type name and the document type description and creation date for all the documents?,"CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type_description VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (Document_date VARCHAR, document_type_code VARCHAR)","SELECT T1.document_type_name, T1.document_type_description, T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type_description VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (Document_date VARCHAR, document_type_code VARCHAR) ### question:What is the document type name and the document type description and creation date for all the documents?","SELECT T1.document_type_name, T1.document_type_description, T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code" Show the number of projects.,CREATE TABLE Projects (Id VARCHAR),SELECT COUNT(*) FROM Projects,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (Id VARCHAR) ### question:Show the number of projects.",SELECT COUNT(*) FROM Projects List ids and details for all projects.,"CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR)","SELECT project_id, project_details FROM Projects","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) ### question:List ids and details for all projects.","SELECT project_id, project_details FROM Projects" What is the project id and detail for the project with at least two documents?,"CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Documents (project_id VARCHAR)","SELECT T1.project_id, T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Documents (project_id VARCHAR) ### question:What is the project id and detail for the project with at least two documents?","SELECT T1.project_id, T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2" "What is the project detail for the project with document ""King Book""?","CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Documents (project_id VARCHAR, document_name VARCHAR)","SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = ""King Book""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Documents (project_id VARCHAR, document_name VARCHAR) ### question:What is the project detail for the project with document ""King Book""?","SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = ""King Book""" How many budget types do we have?,CREATE TABLE Ref_budget_codes (Id VARCHAR),SELECT COUNT(*) FROM Ref_budget_codes,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_budget_codes (Id VARCHAR) ### question:How many budget types do we have?",SELECT COUNT(*) FROM Ref_budget_codes List all budget type codes and descriptions.,"CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR)","SELECT budget_type_code, budget_type_description FROM Ref_budget_codes","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR) ### question:List all budget type codes and descriptions.","SELECT budget_type_code, budget_type_description FROM Ref_budget_codes" What is the description for the budget type with code ORG?,"CREATE TABLE Ref_budget_codes (budget_type_description VARCHAR, budget_type_code VARCHAR)","SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = ""ORG""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_budget_codes (budget_type_description VARCHAR, budget_type_code VARCHAR) ### question:What is the description for the budget type with code ORG?","SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = ""ORG""" How many documents have expenses?,CREATE TABLE Documents_with_expenses (Id VARCHAR),SELECT COUNT(*) FROM Documents_with_expenses,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_expenses (Id VARCHAR) ### question:How many documents have expenses?",SELECT COUNT(*) FROM Documents_with_expenses What are the document ids for the budget type code 'SF'?,"CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR)",SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR) ### question:What are the document ids for the budget type code 'SF'?",SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF' Show the budget type code and description and the corresponding document id.,"CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR)","SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR) ### question:Show the budget type code and description and the corresponding document id.","SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code" Show ids for all documents with budget types described as 'Government'.,"CREATE TABLE Documents_with_expenses (document_id VARCHAR, Budget_Type_code VARCHAR); CREATE TABLE Ref_Budget_Codes (Budget_Type_code VARCHAR, budget_type_Description VARCHAR)","SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = ""Government""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_expenses (document_id VARCHAR, Budget_Type_code VARCHAR); CREATE TABLE Ref_Budget_Codes (Budget_Type_code VARCHAR, budget_type_Description VARCHAR) ### question:Show ids for all documents with budget types described as 'Government'.","SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = ""Government""" Show budget type codes and the number of documents in each budget type.,CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR),"SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) ### question:Show budget type codes and the number of documents in each budget type.","SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code" What is the budget type code with most number of documents.,CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR),SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) ### question:What is the budget type code with most number of documents.",SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1 What are the ids of documents which don't have expense budgets?,CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR),SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR) ### question:What are the ids of documents which don't have expense budgets?",SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses Show ids for all documents in type CV without expense budgets.,"CREATE TABLE Documents_with_expenses (document_id VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_type_code VARCHAR)","SELECT document_id FROM Documents WHERE document_type_code = ""CV"" EXCEPT SELECT document_id FROM Documents_with_expenses","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_expenses (document_id VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_type_code VARCHAR) ### question:Show ids for all documents in type CV without expense budgets.","SELECT document_id FROM Documents WHERE document_type_code = ""CV"" EXCEPT SELECT document_id FROM Documents_with_expenses" What are the ids of documents with letter 's' in the name with any expense budgets.,"CREATE TABLE Documents_with_expenses (document_id VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR)",SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_expenses (document_id VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR) ### question:What are the ids of documents with letter 's' in the name with any expense budgets.",SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%' How many documents do not have any expense?,CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR),SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR) ### question:How many documents do not have any expense?",SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses) What are the dates for the documents with both 'GV' type and 'SF' type expenses?,"CREATE TABLE Documents_with_Expenses (document_id VARCHAR, budget_type_code VARCHAR); CREATE TABLE Documents (document_date VARCHAR, document_id VARCHAR)",SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Documents_with_Expenses (document_id VARCHAR, budget_type_code VARCHAR); CREATE TABLE Documents (document_date VARCHAR, document_id VARCHAR) ### question:What are the dates for the documents with both 'GV' type and 'SF' type expenses?",SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF' What are the account details with the largest value or with value having char '5' in it?,CREATE TABLE Accounts (Account_details INTEGER),"SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE ""%5%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Accounts (Account_details INTEGER) ### question:What are the account details with the largest value or with value having char '5' in it?","SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE ""%5%""" Find the total number of scientists.,CREATE TABLE scientists (Id VARCHAR),SELECT COUNT(*) FROM scientists,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (Id VARCHAR) ### question:Find the total number of scientists.",SELECT COUNT(*) FROM scientists Find the total hours of all projects.,CREATE TABLE projects (hours INTEGER),SELECT SUM(hours) FROM projects,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE projects (hours INTEGER) ### question:Find the total hours of all projects.",SELECT SUM(hours) FROM projects How many different scientists are assigned to any project?,CREATE TABLE assignedto (scientist VARCHAR),SELECT COUNT(DISTINCT scientist) FROM assignedto,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE assignedto (scientist VARCHAR) ### question:How many different scientists are assigned to any project?",SELECT COUNT(DISTINCT scientist) FROM assignedto Find the number of distinct projects.,CREATE TABLE projects (name VARCHAR),SELECT COUNT(DISTINCT name) FROM projects,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE projects (name VARCHAR) ### question:Find the number of distinct projects.",SELECT COUNT(DISTINCT name) FROM projects Find the average hours of all projects.,CREATE TABLE projects (hours INTEGER),SELECT AVG(hours) FROM projects,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE projects (hours INTEGER) ### question:Find the average hours of all projects.",SELECT AVG(hours) FROM projects Find the name of project that continues for the longest time.,"CREATE TABLE projects (name VARCHAR, hours VARCHAR)",SELECT name FROM projects ORDER BY hours DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE projects (name VARCHAR, hours VARCHAR) ### question:Find the name of project that continues for the longest time.",SELECT name FROM projects ORDER BY hours DESC LIMIT 1 List the name of all projects that are operated longer than the average working hours of all projects.,"CREATE TABLE projects (name VARCHAR, hours INTEGER)",SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE projects (name VARCHAR, hours INTEGER) ### question:List the name of all projects that are operated longer than the average working hours of all projects.",SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects) Find the name and hours of project that has the most number of scientists.,"CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, hours VARCHAR, code VARCHAR)","SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, hours VARCHAR, code VARCHAR) ### question:Find the name and hours of project that has the most number of scientists.","SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1" Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.,"CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR)",SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR) ### question:Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.",SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%' Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.,"CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE projects (hours INTEGER, code VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR)",SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE projects (hours INTEGER, code VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR) ### question:Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.",SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith' Find the name of projects that require between 100 and 300 hours of work.,"CREATE TABLE projects (name VARCHAR, hours INTEGER)",SELECT name FROM projects WHERE hours BETWEEN 100 AND 300,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE projects (name VARCHAR, hours INTEGER) ### question:Find the name of projects that require between 100 and 300 hours of work.",SELECT name FROM projects WHERE hours BETWEEN 100 AND 300 Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.,"CREATE TABLE projects (code VARCHAR, name VARCHAR); CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR)",SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Puzzling Parallax',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE projects (code VARCHAR, name VARCHAR); CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR) ### question:Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.",SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Puzzling Parallax' List the names of all scientists sorted in alphabetical order.,CREATE TABLE scientists (name VARCHAR),SELECT name FROM scientists ORDER BY name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (name VARCHAR) ### question:List the names of all scientists sorted in alphabetical order.",SELECT name FROM scientists ORDER BY name Find the number of scientists involved for each project name.,"CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR)","SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR) ### question:Find the number of scientists involved for each project name.","SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name" Find the number of scientists involved for the projects that require more than 300 hours.,"CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER)","SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER) ### question:Find the number of scientists involved for the projects that require more than 300 hours.","SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name" Find the number of projects which each scientist is working on and scientist's name.,"CREATE TABLE scientists (name VARCHAR, ssn VARCHAR); CREATE TABLE assignedto (scientist VARCHAR)","SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (name VARCHAR, ssn VARCHAR); CREATE TABLE assignedto (scientist VARCHAR) ### question:Find the number of projects which each scientist is working on and scientist's name.","SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name" Find the SSN and name of scientists who are assigned to the project with the longest hours.,"CREATE TABLE scientists (ssn VARCHAR, name VARCHAR, SSN VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (hours INTEGER)","SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (ssn VARCHAR, name VARCHAR, SSN VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (hours INTEGER) ### question:Find the SSN and name of scientists who are assigned to the project with the longest hours.","SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)" Find the name of scientists who are assigned to some project.,"CREATE TABLE assignedto (scientist VARCHAR); CREATE TABLE scientists (name VARCHAR, ssn VARCHAR)",SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE assignedto (scientist VARCHAR); CREATE TABLE scientists (name VARCHAR, ssn VARCHAR) ### question:Find the name of scientists who are assigned to some project.",SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn Select the project names which are not assigned yet.,"CREATE TABLE Projects (Name VARCHAR, Code VARCHAR, Project VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, Code VARCHAR, Project VARCHAR)",SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Projects (Name VARCHAR, Code VARCHAR, Project VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, Code VARCHAR, Project VARCHAR) ### question:Select the project names which are not assigned yet.",SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo) Find the name of scientists who are not assigned to any project.,"CREATE TABLE scientists (Name VARCHAR, ssn VARCHAR, scientist VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, ssn VARCHAR, scientist VARCHAR)",SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (Name VARCHAR, ssn VARCHAR, scientist VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, ssn VARCHAR, scientist VARCHAR) ### question:Find the name of scientists who are not assigned to any project.",SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) Find the number of scientists who are not assigned to any project.,"CREATE TABLE AssignedTo (ssn VARCHAR, scientist VARCHAR); CREATE TABLE scientists (ssn VARCHAR, scientist VARCHAR)",SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE AssignedTo (ssn VARCHAR, scientist VARCHAR); CREATE TABLE scientists (ssn VARCHAR, scientist VARCHAR) ### question:Find the number of scientists who are not assigned to any project.",SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) Find the names of scientists who are not working on the project with the highest hours.,"CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE scientists (name VARCHAR, hours INTEGER); CREATE TABLE projects (name VARCHAR, hours INTEGER)",SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE scientists (name VARCHAR, hours INTEGER); CREATE TABLE projects (name VARCHAR, hours INTEGER) ### question:Find the names of scientists who are not working on the project with the highest hours.",SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects) "List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.","CREATE TABLE AssignedTo (Scientist VARCHAR, Project VARCHAR); CREATE TABLE Projects (Name VARCHAR, Hours VARCHAR, Code VARCHAR); CREATE TABLE Scientists (Name VARCHAR, SSN VARCHAR)","SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE AssignedTo (Scientist VARCHAR, Project VARCHAR); CREATE TABLE Projects (Name VARCHAR, Hours VARCHAR, Code VARCHAR); CREATE TABLE Scientists (Name VARCHAR, SSN VARCHAR) ### question:List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.","SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name" Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.,"CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER); CREATE TABLE projects (hours INTEGER)","SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER); CREATE TABLE projects (hours INTEGER) ### question:Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.","SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)" What is the name of the highest rated wine?,"CREATE TABLE WINE (Name VARCHAR, Score VARCHAR)",SELECT Name FROM WINE ORDER BY Score LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) ### question:What is the name of the highest rated wine?",SELECT Name FROM WINE ORDER BY Score LIMIT 1 Which winery is the wine that has the highest score from?,"CREATE TABLE WINE (Winery VARCHAR, SCORE VARCHAR)",SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Winery VARCHAR, SCORE VARCHAR) ### question:Which winery is the wine that has the highest score from?",SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1 Find the names of all wines produced in 2008.,"CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR)","SELECT Name FROM WINE WHERE YEAR = ""2008""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR) ### question:Find the names of all wines produced in 2008.","SELECT Name FROM WINE WHERE YEAR = ""2008""" List the grapes and appelations of all wines.,"CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR)","SELECT Grape, Appelation FROM WINE","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR) ### question:List the grapes and appelations of all wines.","SELECT Grape, Appelation FROM WINE" List the names and scores of all wines.,"CREATE TABLE WINE (Name VARCHAR, Score VARCHAR)","SELECT Name, Score FROM WINE","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) ### question:List the names and scores of all wines.","SELECT Name, Score FROM WINE" List the area and county of all appelations.,"CREATE TABLE APPELLATIONS (Area VARCHAR, County VARCHAR)","SELECT Area, County FROM APPELLATIONS","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE APPELLATIONS (Area VARCHAR, County VARCHAR) ### question:List the area and county of all appelations.","SELECT Area, County FROM APPELLATIONS" What are the prices of wines produced before the year of 2010?,"CREATE TABLE WINE (Price VARCHAR, YEAR INTEGER)",SELECT Price FROM WINE WHERE YEAR < 2010,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Price VARCHAR, YEAR INTEGER) ### question:What are the prices of wines produced before the year of 2010?",SELECT Price FROM WINE WHERE YEAR < 2010 List the names of all distinct wines that have scores higher than 90.,"CREATE TABLE WINE (Name VARCHAR, score INTEGER)",SELECT Name FROM WINE WHERE score > 90,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, score INTEGER) ### question:List the names of all distinct wines that have scores higher than 90.",SELECT Name FROM WINE WHERE score > 90 List the names of all distinct wines that are made of red color grape.,"CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR)","SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""Red""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR) ### question:List the names of all distinct wines that are made of red color grape.","SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""Red""" Find the names of all distinct wines that have appellations in North Coast area.,"CREATE TABLE APPELLATIONs (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR)","SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = ""North Coast""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE APPELLATIONs (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR) ### question:Find the names of all distinct wines that have appellations in North Coast area.","SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = ""North Coast""" How many wines are produced at Robert Biale winery?,CREATE TABLE WINE (Winery VARCHAR),"SELECT COUNT(*) FROM WINE WHERE Winery = ""Robert Biale""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Winery VARCHAR) ### question:How many wines are produced at Robert Biale winery?","SELECT COUNT(*) FROM WINE WHERE Winery = ""Robert Biale""" How many appelations are in Napa Country?,CREATE TABLE APPELLATIONS (County VARCHAR),"SELECT COUNT(*) FROM APPELLATIONS WHERE County = ""Napa""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE APPELLATIONS (County VARCHAR) ### question:How many appelations are in Napa Country?","SELECT COUNT(*) FROM APPELLATIONS WHERE County = ""Napa""" Give me the average prices of wines that are produced by appelations in Sonoma County.,"CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR)","SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = ""Sonoma""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR) ### question:Give me the average prices of wines that are produced by appelations in Sonoma County.","SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = ""Sonoma""" What are the names and scores of wines that are made of white color grapes?,"CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Score VARCHAR, Grape VARCHAR)","SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""White""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Score VARCHAR, Grape VARCHAR) ### question:What are the names and scores of wines that are made of white color grapes?","SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""White""" Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.,"CREATE TABLE APPELLATIONS (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR, year VARCHAR)","SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = ""Central Coast"" AND T2.year < 2005","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE APPELLATIONS (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR, year VARCHAR) ### question:Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.","SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = ""Central Coast"" AND T2.year < 2005" Find the the grape whose white color grapes are used to produce wines with scores higher than 90.,"CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Grape VARCHAR, score VARCHAR)","SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""White"" AND T2.score > 90","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Grape VARCHAR, score VARCHAR) ### question:Find the the grape whose white color grapes are used to produce wines with scores higher than 90.","SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""White"" AND T2.score > 90" What are the wines that have prices higher than 50 and made of Red color grapes?,"CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR, price VARCHAR); CREATE TABLE Grapes (Grape VARCHAR, Color VARCHAR)","SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""Red"" AND T2.price > 50","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR, price VARCHAR); CREATE TABLE Grapes (Grape VARCHAR, Color VARCHAR) ### question:What are the wines that have prices higher than 50 and made of Red color grapes?","SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""Red"" AND T2.price > 50" What are the wines that have prices lower than 50 and have appelations in Monterey county?,"CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR, price VARCHAR)","SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = ""Monterey"" AND T2.price < 50","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR, price VARCHAR) ### question:What are the wines that have prices lower than 50 and have appelations in Monterey county?","SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = ""Monterey"" AND T2.price < 50" What are the numbers of wines for different grapes?,CREATE TABLE WINE (Grape VARCHAR),"SELECT COUNT(*), Grape FROM WINE GROUP BY Grape","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Grape VARCHAR) ### question:What are the numbers of wines for different grapes?","SELECT COUNT(*), Grape FROM WINE GROUP BY Grape" What are the average prices of wines for different years?,"CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER)","SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER) ### question:What are the average prices of wines for different years?","SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR" Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.,"CREATE TABLE wine (Name VARCHAR, Price INTEGER, Winery VARCHAR); CREATE TABLE WINE (Name VARCHAR, Price INTEGER, Winery VARCHAR)","SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = ""John Anthony"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wine (Name VARCHAR, Price INTEGER, Winery VARCHAR); CREATE TABLE WINE (Name VARCHAR, Price INTEGER, Winery VARCHAR) ### question:Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.","SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = ""John Anthony"")" List the names of all distinct wines in alphabetical order.,CREATE TABLE WINE (Name VARCHAR),SELECT DISTINCT Name FROM WINE ORDER BY Name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR) ### question:List the names of all distinct wines in alphabetical order.",SELECT DISTINCT Name FROM WINE ORDER BY Name List the names of all distinct wines ordered by price.,"CREATE TABLE WINE (Name VARCHAR, price VARCHAR)",SELECT DISTINCT Name FROM WINE ORDER BY price,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, price VARCHAR) ### question:List the names of all distinct wines ordered by price.",SELECT DISTINCT Name FROM WINE ORDER BY price What is the area of the appelation that produces the highest number of wines before the year of 2010?,"CREATE TABLE WINE (Appelation VARCHAR, year VARCHAR); CREATE TABLE APPELLATIONS (Area VARCHAR, Appelation VARCHAR)",SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Appelation VARCHAR, year VARCHAR); CREATE TABLE APPELLATIONS (Area VARCHAR, Appelation VARCHAR) ### question:What is the area of the appelation that produces the highest number of wines before the year of 2010?",SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1 What is the color of the grape whose wine products has the highest average price?,"CREATE TABLE GRAPES (Color VARCHAR, Grape VARCHAR); CREATE TABLE WINE (Grape VARCHAR)",SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE GRAPES (Color VARCHAR, Grape VARCHAR); CREATE TABLE WINE (Grape VARCHAR) ### question:What is the color of the grape whose wine products has the highest average price?",SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1 Find the distinct names of wines produced before the year of 2000 or after the year of 2010.,"CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR)",SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR) ### question:Find the distinct names of wines produced before the year of 2000 or after the year of 2010.",SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010 Find the distinct winery of wines having price between 50 and 100.,"CREATE TABLE WINE (Winery VARCHAR, Price INTEGER)",SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Winery VARCHAR, Price INTEGER) ### question:Find the distinct winery of wines having price between 50 and 100.",SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100 What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?,"CREATE TABLE WINE (Price INTEGER, Cases INTEGER, YEAR VARCHAR, Grape VARCHAR)","SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = ""Zinfandel""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Price INTEGER, Cases INTEGER, YEAR VARCHAR, Grape VARCHAR) ### question:What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?","SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = ""Zinfandel""" What are the maximum price and score of wines produced by St. Helena appelation?,"CREATE TABLE WINE (Price INTEGER, Score INTEGER, Appelation VARCHAR)","SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = ""St. Helena""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Price INTEGER, Score INTEGER, Appelation VARCHAR) ### question:What are the maximum price and score of wines produced by St. Helena appelation?","SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = ""St. Helena""" What are the maximum price and score of wines in each year?,"CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER, Score INTEGER)","SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER, Score INTEGER) ### question:What are the maximum price and score of wines in each year?","SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR" What are the average price and score of wines grouped by appelation?,"CREATE TABLE WINE (Appelation VARCHAR, Price INTEGER, Score INTEGER)","SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Appelation VARCHAR, Price INTEGER, Score INTEGER) ### question:What are the average price and score of wines grouped by appelation?","SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation" Find the wineries that have at least four wines.,CREATE TABLE WINE (Winery VARCHAR),SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Winery VARCHAR) ### question:Find the wineries that have at least four wines.",SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4 Find the country of all appelations who have at most three wines.,"CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR); CREATE TABLE WINE (Appelation VARCHAR)",SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR); CREATE TABLE WINE (Appelation VARCHAR) ### question:Find the country of all appelations who have at most three wines.",SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3 What are the names of wines whose production year are before the year of all wines by Brander winery?,"CREATE TABLE WINE (Name VARCHAR, YEAR INTEGER, Winery VARCHAR)","SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = ""Brander"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, YEAR INTEGER, Winery VARCHAR) ### question:What are the names of wines whose production year are before the year of all wines by Brander winery?","SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = ""Brander"")" What are the names of wines that are more expensive then all wines made in the year 2006?,"CREATE TABLE WINE (Name VARCHAR, Price INTEGER, YEAR VARCHAR)",SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Name VARCHAR, Price INTEGER, YEAR VARCHAR) ### question:What are the names of wines that are more expensive then all wines made in the year 2006?",SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006) Find the top 3 wineries with the greatest number of wines made of white color grapes.,"CREATE TABLE GRAPES (GRAPE VARCHAR, Color VARCHAR); CREATE TABLE WINE (Winery VARCHAR, GRAPE VARCHAR)","SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = ""White"" GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE GRAPES (GRAPE VARCHAR, Color VARCHAR); CREATE TABLE WINE (Winery VARCHAR, GRAPE VARCHAR) ### question:Find the top 3 wineries with the greatest number of wines made of white color grapes.","SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = ""White"" GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3" "List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.","CREATE TABLE WINE (Grape VARCHAR, Winery VARCHAR, YEAR VARCHAR, Price INTEGER)","SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Grape VARCHAR, Winery VARCHAR, YEAR VARCHAR, Price INTEGER) ### question:List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.","SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR" "List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.","CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR, Name VARCHAR, Score INTEGER)","SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR, Name VARCHAR, Score INTEGER) ### question:List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.","SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name" Find the appelations that produce wines after the year of 2008 but not in Central Coast area.,"CREATE TABLE WINE (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR)","SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = ""Central Coast""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR) ### question:Find the appelations that produce wines after the year of 2008 but not in Central Coast area.","SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = ""Central Coast""" Find the average price of wines that are not produced from Sonoma county.,"CREATE TABLE wine (price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Appelation VARCHAR)",SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE wine (price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Appelation VARCHAR) ### question:Find the average price of wines that are not produced from Sonoma county.",SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma') Find the county where produces the most number of wines with score higher than 90.,"CREATE TABLE WINE (Appelation VARCHAR, Score INTEGER); CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR)",SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE WINE (Appelation VARCHAR, Score INTEGER); CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR) ### question:Find the county where produces the most number of wines with score higher than 90.",SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1 How many train stations are there?,CREATE TABLE station (Id VARCHAR),SELECT COUNT(*) FROM station,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (Id VARCHAR) ### question:How many train stations are there?",SELECT COUNT(*) FROM station "Show the name, location, and number of platforms for all stations.","CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, number_of_platforms VARCHAR)","SELECT name, LOCATION, number_of_platforms FROM station","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, number_of_platforms VARCHAR) ### question:Show the name, location, and number of platforms for all stations.","SELECT name, LOCATION, number_of_platforms FROM station" What are all locations of train stations?,CREATE TABLE station (LOCATION VARCHAR),SELECT DISTINCT LOCATION FROM station,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (LOCATION VARCHAR) ### question:What are all locations of train stations?",SELECT DISTINCT LOCATION FROM station Show the names and total passengers for all train stations not in London.,"CREATE TABLE station (name VARCHAR, total_passengers VARCHAR, LOCATION VARCHAR)","SELECT name, total_passengers FROM station WHERE LOCATION <> 'London'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, total_passengers VARCHAR, LOCATION VARCHAR) ### question:Show the names and total passengers for all train stations not in London.","SELECT name, total_passengers FROM station WHERE LOCATION <> 'London'" Show the names and main services for train stations that have the top three total number of passengers.,"CREATE TABLE station (name VARCHAR, main_services VARCHAR, total_passengers VARCHAR)","SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, main_services VARCHAR, total_passengers VARCHAR) ### question:Show the names and main services for train stations that have the top three total number of passengers.","SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3" What is the average and maximum number of total passengers for train stations in London or Glasgow?,"CREATE TABLE station (total_passengers INTEGER, LOCATION VARCHAR)","SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (total_passengers INTEGER, LOCATION VARCHAR) ### question:What is the average and maximum number of total passengers for train stations in London or Glasgow?","SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow'" Show all locations and the total number of platforms and passengers for all train stations in each location.,"CREATE TABLE station (LOCATION VARCHAR, number_of_platforms INTEGER, total_passengers INTEGER)","SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (LOCATION VARCHAR, number_of_platforms INTEGER, total_passengers INTEGER) ### question:Show all locations and the total number of platforms and passengers for all train stations in each location.","SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION" Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.,"CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR, total_passengers VARCHAR)",SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR, total_passengers VARCHAR) ### question:Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.",SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25 Show all locations which don't have a train station with at least 15 platforms.,"CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR)",SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR) ### question:Show all locations which don't have a train station with at least 15 platforms.",SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15 Show the location with most number of train stations.,CREATE TABLE station (LOCATION VARCHAR),SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (LOCATION VARCHAR) ### question:Show the location with most number of train stations.",SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 "Show the name, time, and service for all trains.","CREATE TABLE train (name VARCHAR, TIME VARCHAR, service VARCHAR)","SELECT name, TIME, service FROM train","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (name VARCHAR, TIME VARCHAR, service VARCHAR) ### question:Show the name, time, and service for all trains.","SELECT name, TIME, service FROM train" Show the number of trains,CREATE TABLE train (Id VARCHAR),SELECT COUNT(*) FROM train,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (Id VARCHAR) ### question:Show the number of trains",SELECT COUNT(*) FROM train Show the name and service for all trains in order by time.,"CREATE TABLE train (name VARCHAR, service VARCHAR, TIME VARCHAR)","SELECT name, service FROM train ORDER BY TIME","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train (name VARCHAR, service VARCHAR, TIME VARCHAR) ### question:Show the name and service for all trains in order by time.","SELECT name, service FROM train ORDER BY TIME" Show the station name and number of trains in each station.,"CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR)","SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) ### question:Show the station name and number of trains in each station.","SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id" show the train name and station name for each train.,"CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR)","SELECT T2.name, T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR) ### question:show the train name and station name for each train.","SELECT T2.name, T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id" Show all train names and times in stations in London in descending order by train time.,"CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR); CREATE TABLE station (station_id VARCHAR, location VARCHAR); CREATE TABLE train (name VARCHAR, time VARCHAR, train_id VARCHAR)","SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR); CREATE TABLE station (station_id VARCHAR, location VARCHAR); CREATE TABLE train (name VARCHAR, time VARCHAR, train_id VARCHAR) ### question:Show all train names and times in stations in London in descending order by train time.","SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC" Show the station name with greatest number of trains.,"CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR)",SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) ### question:Show the station name with greatest number of trains.",SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY COUNT(*) DESC LIMIT 1 Show the station name with at least two trains.,"CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR)",SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) ### question:Show the station name with at least two trains.",SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING COUNT(*) >= 2 Show all locations with only 1 station.,CREATE TABLE station (LOCATION VARCHAR),SELECT LOCATION FROM station GROUP BY LOCATION HAVING COUNT(*) = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (LOCATION VARCHAR) ### question:Show all locations with only 1 station.",SELECT LOCATION FROM station GROUP BY LOCATION HAVING COUNT(*) = 1 Show station names without any trains.,"CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (name VARCHAR, station_id VARCHAR)",SELECT name FROM station WHERE NOT station_id IN (SELECT station_id FROM train_station),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (name VARCHAR, station_id VARCHAR) ### question:Show station names without any trains.",SELECT name FROM station WHERE NOT station_id IN (SELECT station_id FROM train_station) "What are the names of the stations which serve both ""Ananthapuri Express"" and ""Guruvayur Express"" trains?","CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (train_id VARCHAR, Name VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR)","SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = ""Ananthapuri Express"" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = ""Guruvayur Express""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (train_id VARCHAR, Name VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR) ### question:What are the names of the stations which serve both ""Ananthapuri Express"" and ""Guruvayur Express"" trains?","SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = ""Ananthapuri Express"" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = ""Guruvayur Express""" Find the names of the trains that do not pass any station located in London.,"CREATE TABLE station (station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR); CREATE TABLE train_station (train_id VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR)","SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE NOT T1.station_id IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = ""London"")","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR); CREATE TABLE train_station (train_id VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR) ### question:Find the names of the trains that do not pass any station located in London.","SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE NOT T1.station_id IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = ""London"")" List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.,"CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, Annual_entry_exit VARCHAR, Annual_interchanges VARCHAR)","SELECT name, LOCATION FROM station ORDER BY Annual_entry_exit, Annual_interchanges","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, Annual_entry_exit VARCHAR, Annual_interchanges VARCHAR) ### question:List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.","SELECT name, LOCATION FROM station ORDER BY Annual_entry_exit, Annual_interchanges" List all vehicle id,CREATE TABLE Vehicles (vehicle_id VARCHAR),SELECT vehicle_id FROM Vehicles,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Vehicles (vehicle_id VARCHAR) ### question:List all vehicle id",SELECT vehicle_id FROM Vehicles How many vehicle in total?,CREATE TABLE Vehicles (Id VARCHAR),SELECT COUNT(*) FROM Vehicles,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Vehicles (Id VARCHAR) ### question:How many vehicle in total?",SELECT COUNT(*) FROM Vehicles Show the detail of vehicle with id 1.,"CREATE TABLE Vehicles (vehicle_details VARCHAR, vehicle_id VARCHAR)",SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Vehicles (vehicle_details VARCHAR, vehicle_id VARCHAR) ### question:Show the detail of vehicle with id 1.",SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1 List the first name middle name and last name of all staff.,"CREATE TABLE Staff (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR)","SELECT first_name, middle_name, last_name FROM Staff","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR) ### question:List the first name middle name and last name of all staff.","SELECT first_name, middle_name, last_name FROM Staff" What is the birthday of the staff member with first name as Janessa and last name as Sawayn?,"CREATE TABLE Staff (date_of_birth VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT date_of_birth FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (date_of_birth VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:What is the birthday of the staff member with first name as Janessa and last name as Sawayn?","SELECT date_of_birth FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""" When did the staff member with first name as Janessa and last name as Sawayn join the company?,"CREATE TABLE Staff (date_joined_staff VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT date_joined_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (date_joined_staff VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:When did the staff member with first name as Janessa and last name as Sawayn join the company?","SELECT date_joined_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""" When did the staff member with first name as Janessa and last name as Sawayn leave the company?,"CREATE TABLE Staff (date_left_staff VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT date_left_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (date_left_staff VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:When did the staff member with first name as Janessa and last name as Sawayn leave the company?","SELECT date_left_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""" How many staff have the first name Ludie?,CREATE TABLE Staff (first_name VARCHAR),"SELECT COUNT(*) FROM Staff WHERE first_name = ""Ludie""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (first_name VARCHAR) ### question:How many staff have the first name Ludie?","SELECT COUNT(*) FROM Staff WHERE first_name = ""Ludie""" What is the nickname of staff with first name as Janessa and last name as Sawayn?,"CREATE TABLE Staff (nickname VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT nickname FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (nickname VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:What is the nickname of staff with first name as Janessa and last name as Sawayn?","SELECT nickname FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn""" How many staff in total?,CREATE TABLE Staff (Id VARCHAR),SELECT COUNT(*) FROM Staff,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (Id VARCHAR) ### question:How many staff in total?",SELECT COUNT(*) FROM Staff Which city does staff with first name as Janessa and last name as Sawayn live?,"CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR)","SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) ### question:Which city does staff with first name as Janessa and last name as Sawayn live?","SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""" Which country and state does staff with first name as Janessa and last name as Sawayn lived?,"CREATE TABLE Addresses (country VARCHAR, state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (country VARCHAR, state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:Which country and state does staff with first name as Janessa and last name as Sawayn lived?","SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""" How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?,"CREATE TABLE Lessons (lesson_time INTEGER, customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (lesson_time INTEGER, customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?","SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin""" What is the zip code of staff with first name as Janessa and last name as Sawayn lived?,"CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:What is the zip code of staff with first name as Janessa and last name as Sawayn lived?","SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""" How many staff live in state Georgia?,CREATE TABLE Addresses (state_province_county VARCHAR),"SELECT COUNT(*) FROM Addresses WHERE state_province_county = ""Georgia""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (state_province_county VARCHAR) ### question:How many staff live in state Georgia?","SELECT COUNT(*) FROM Addresses WHERE state_province_county = ""Georgia""" Find out the first name and last name of staff lived in city Damianfort.,"CREATE TABLE Staff (first_name VARCHAR, last_name VARCHAR, staff_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR)","SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = ""Damianfort""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (first_name VARCHAR, last_name VARCHAR, staff_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR) ### question:Find out the first name and last name of staff lived in city Damianfort.","SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = ""Damianfort""" Which city lives most of staffs? List the city name and number of staffs.,"CREATE TABLE Staff (staff_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR)","SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Staff (staff_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) ### question:Which city lives most of staffs? List the city name and number of staffs.","SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1" List the states which have between 2 to 4 staffs living there.,"CREATE TABLE Addresses (state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR)",SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR) ### question:List the states which have between 2 to 4 staffs living there.",SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4 List the first name and last name of all customers.,"CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR)","SELECT first_name, last_name FROM Customers","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR) ### question:List the first name and last name of all customers.","SELECT first_name, last_name FROM Customers" List email address and birthday of customer whose first name as Carole.,"CREATE TABLE Customers (email_address VARCHAR, date_of_birth VARCHAR, first_name VARCHAR)","SELECT email_address, date_of_birth FROM Customers WHERE first_name = ""Carole""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (email_address VARCHAR, date_of_birth VARCHAR, first_name VARCHAR) ### question:List email address and birthday of customer whose first name as Carole.","SELECT email_address, date_of_birth FROM Customers WHERE first_name = ""Carole""" List phone number and email address of customer with more than 2000 outstanding balance.,"CREATE TABLE Customers (phone_number VARCHAR, email_address VARCHAR, amount_outstanding INTEGER)","SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (phone_number VARCHAR, email_address VARCHAR, amount_outstanding INTEGER) ### question:List phone number and email address of customer with more than 2000 outstanding balance.","SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000" "What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?","CREATE TABLE Customers (customer_status_code VARCHAR, cell_mobile_phone_number VARCHAR, email_address VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT customer_status_code, cell_mobile_phone_number, email_address FROM Customers WHERE first_name = ""Marina"" OR last_name = ""Kohler""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_status_code VARCHAR, cell_mobile_phone_number VARCHAR, email_address VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?","SELECT customer_status_code, cell_mobile_phone_number, email_address FROM Customers WHERE first_name = ""Marina"" OR last_name = ""Kohler""" When are the birthdays of customer who are classified as 'Good Customer' status?,"CREATE TABLE Customers (date_of_birth VARCHAR, customer_status_code VARCHAR)",SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (date_of_birth VARCHAR, customer_status_code VARCHAR) ### question:When are the birthdays of customer who are classified as 'Good Customer' status?",SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer' When did customer with first name as Carole and last name as Bernhard became a customer?,"CREATE TABLE Customers (date_became_customer VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT date_became_customer FROM Customers WHERE first_name = ""Carole"" AND last_name = ""Bernhard""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (date_became_customer VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:When did customer with first name as Carole and last name as Bernhard became a customer?","SELECT date_became_customer FROM Customers WHERE first_name = ""Carole"" AND last_name = ""Bernhard""" List all customer status codes and the number of customers having each status code.,CREATE TABLE Customers (customer_status_code VARCHAR),"SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_status_code VARCHAR) ### question:List all customer status codes and the number of customers having each status code.","SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code" Which customer status code has least number of customers?,CREATE TABLE Customers (customer_status_code VARCHAR),SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_status_code VARCHAR) ### question:Which customer status code has least number of customers?",SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1 How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?,"CREATE TABLE Lessons (customer_id VARCHAR, lesson_status_code VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin"" AND T1.lesson_status_code = ""Completed""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (customer_id VARCHAR, lesson_status_code VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?","SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin"" AND T1.lesson_status_code = ""Completed""" "What is maximum, minimum and average amount of outstanding of customer?",CREATE TABLE Customers (amount_outstanding INTEGER),"SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (amount_outstanding INTEGER) ### question:What is maximum, minimum and average amount of outstanding of customer?","SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers" List the first name and last name of customers have the amount of outstanding between 1000 and 3000.,"CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, amount_outstanding INTEGER)","SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, amount_outstanding INTEGER) ### question:List the first name and last name of customers have the amount of outstanding between 1000 and 3000.","SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000" List first name and last name of customers lived in city Lockmanfurt.,"CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR)","SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = ""Lockmanfurt""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR) ### question:List first name and last name of customers lived in city Lockmanfurt.","SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = ""Lockmanfurt""" Which country does customer with first name as Carole and last name as Bernhard lived in?,"CREATE TABLE Addresses (country VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (country VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:Which country does customer with first name as Carole and last name as Bernhard lived in?","SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""" What is zip code of customer with first name as Carole and last name as Bernhard?,"CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:What is zip code of customer with first name as Carole and last name as Bernhard?","SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""" Which city does has most number of customers?,"CREATE TABLE Customers (customer_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR)",SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) ### question:Which city does has most number of customers?",SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1 How much in total does customer with first name as Carole and last name as Bernhard paid?,"CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Customer_Payments (amount_payment INTEGER, customer_id VARCHAR)","SELECT SUM(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Carole"" AND T2.last_name = ""Bernhard""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Customer_Payments (amount_payment INTEGER, customer_id VARCHAR) ### question:How much in total does customer with first name as Carole and last name as Bernhard paid?","SELECT SUM(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Carole"" AND T2.last_name = ""Bernhard""" List the number of customers that did not have any payment history.,CREATE TABLE Customers (customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR),SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR) ### question:List the number of customers that did not have any payment history.",SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments) List first name and last name of customers that have more than 2 payments.,"CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR)","SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR) ### question:List first name and last name of customers that have more than 2 payments.","SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2" List all payment methods and number of payments using each payment methods.,CREATE TABLE Customer_Payments (payment_method_code VARCHAR),"SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customer_Payments (payment_method_code VARCHAR) ### question:List all payment methods and number of payments using each payment methods.","SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code" How many lessons were in cancelled state?,CREATE TABLE Lessons (lesson_status_code VARCHAR),"SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = ""Cancelled""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (lesson_status_code VARCHAR) ### question:How many lessons were in cancelled state?","SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = ""Cancelled""" "List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'.","CREATE TABLE Lessons (lesson_id VARCHAR, staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"" AND nickname LIKE ""%s%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (lesson_id VARCHAR, staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'.","SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"" AND nickname LIKE ""%s%""" How many lessons taught by staff whose first name has letter 'a' in it?,"CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR)","SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE ""%a%""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR) ### question:How many lessons taught by staff whose first name has letter 'a' in it?","SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE ""%a%""" How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?,"CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT SUM(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?","SELECT SUM(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""" What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?,"CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR)","SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ### question:What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?","SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn""" How many lesson does customer with first name Ray took?,"CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR); CREATE TABLE Lessons (customer_id VARCHAR)","SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Ray""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR); CREATE TABLE Lessons (customer_id VARCHAR) ### question:How many lesson does customer with first name Ray took?","SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Ray""" Which last names are both used by customers and by staff?,CREATE TABLE Customers (last_name VARCHAR); CREATE TABLE Staff (last_name VARCHAR),SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Customers (last_name VARCHAR); CREATE TABLE Staff (last_name VARCHAR) ### question:Which last names are both used by customers and by staff?",SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff What is the first name of the staff who did not give any lesson?,"CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (first_name VARCHAR); CREATE TABLE Staff (first_name VARCHAR, staff_id VARCHAR)",SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (first_name VARCHAR); CREATE TABLE Staff (first_name VARCHAR, staff_id VARCHAR) ### question:What is the first name of the staff who did not give any lesson?",SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id What is the id and detail of the vehicle used in lessons for most of the times?,"CREATE TABLE Lessons (vehicle_id VARCHAR); CREATE TABLE Vehicles (vehicle_id VARCHAR, vehicle_details VARCHAR)","SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Lessons (vehicle_id VARCHAR); CREATE TABLE Vehicles (vehicle_id VARCHAR, vehicle_details VARCHAR) ### question:What is the id and detail of the vehicle used in lessons for most of the times?","SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1" How many faculty do we have?,CREATE TABLE Faculty (Id VARCHAR),SELECT COUNT(*) FROM Faculty,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (Id VARCHAR) ### question:How many faculty do we have?",SELECT COUNT(*) FROM Faculty What ranks do we have for faculty?,CREATE TABLE Faculty (rank VARCHAR),SELECT DISTINCT rank FROM Faculty,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (rank VARCHAR) ### question:What ranks do we have for faculty?",SELECT DISTINCT rank FROM Faculty Show all the distinct buildings that have faculty rooms.,CREATE TABLE Faculty (building VARCHAR),SELECT DISTINCT building FROM Faculty,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (building VARCHAR) ### question:Show all the distinct buildings that have faculty rooms.",SELECT DISTINCT building FROM Faculty "Show the rank, first name, and last name for all the faculty.","CREATE TABLE Faculty (rank VARCHAR, Fname VARCHAR, Lname VARCHAR)","SELECT rank, Fname, Lname FROM Faculty","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (rank VARCHAR, Fname VARCHAR, Lname VARCHAR) ### question:Show the rank, first name, and last name for all the faculty.","SELECT rank, Fname, Lname FROM Faculty" "Show the first name, last name, and phone number for all female faculty members.","CREATE TABLE Faculty (Fname VARCHAR, Lname VARCHAR, phone VARCHAR, Sex VARCHAR)","SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (Fname VARCHAR, Lname VARCHAR, phone VARCHAR, Sex VARCHAR) ### question:Show the first name, last name, and phone number for all female faculty members.","SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F'" Show ids for all the male faculty.,"CREATE TABLE Faculty (FacID VARCHAR, Sex VARCHAR)",SELECT FacID FROM Faculty WHERE Sex = 'M',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (FacID VARCHAR, Sex VARCHAR) ### question:Show ids for all the male faculty.",SELECT FacID FROM Faculty WHERE Sex = 'M' How many female Professors do we have?,"CREATE TABLE Faculty (Sex VARCHAR, Rank VARCHAR)","SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = ""Professor""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (Sex VARCHAR, Rank VARCHAR) ### question:How many female Professors do we have?","SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = ""Professor""" "Show the phone, room, and building for the faculty named Jerry Prince.","CREATE TABLE Faculty (phone VARCHAR, room VARCHAR, building VARCHAR, Fname VARCHAR, Lname VARCHAR)","SELECT phone, room, building FROM Faculty WHERE Fname = ""Jerry"" AND Lname = ""Prince""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (phone VARCHAR, room VARCHAR, building VARCHAR, Fname VARCHAR, Lname VARCHAR) ### question:Show the phone, room, and building for the faculty named Jerry Prince.","SELECT phone, room, building FROM Faculty WHERE Fname = ""Jerry"" AND Lname = ""Prince""" How many Professors are in building NEB?,"CREATE TABLE Faculty (Rank VARCHAR, building VARCHAR)","SELECT COUNT(*) FROM Faculty WHERE Rank = ""Professor"" AND building = ""NEB""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (Rank VARCHAR, building VARCHAR) ### question:How many Professors are in building NEB?","SELECT COUNT(*) FROM Faculty WHERE Rank = ""Professor"" AND building = ""NEB""" Show the first name and last name for all the instructors.,"CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, Rank VARCHAR)","SELECT fname, lname FROM Faculty WHERE Rank = ""Instructor""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, Rank VARCHAR) ### question:Show the first name and last name for all the instructors.","SELECT fname, lname FROM Faculty WHERE Rank = ""Instructor""" Show all the buildings along with the number of faculty members the buildings have.,CREATE TABLE Faculty (building VARCHAR),"SELECT building, COUNT(*) FROM Faculty GROUP BY building","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (building VARCHAR) ### question:Show all the buildings along with the number of faculty members the buildings have.","SELECT building, COUNT(*) FROM Faculty GROUP BY building" Which building has most faculty members?,CREATE TABLE Faculty (building VARCHAR),SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (building VARCHAR) ### question:Which building has most faculty members?",SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1 Show all the buildings that have at least 10 professors.,"CREATE TABLE Faculty (building VARCHAR, rank VARCHAR)","SELECT building FROM Faculty WHERE rank = ""Professor"" GROUP BY building HAVING COUNT(*) >= 10","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (building VARCHAR, rank VARCHAR) ### question:Show all the buildings that have at least 10 professors.","SELECT building FROM Faculty WHERE rank = ""Professor"" GROUP BY building HAVING COUNT(*) >= 10" "For each faculty rank, show the number of faculty members who have it.",CREATE TABLE Faculty (rank VARCHAR),"SELECT rank, COUNT(*) FROM Faculty GROUP BY rank","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (rank VARCHAR) ### question:For each faculty rank, show the number of faculty members who have it.","SELECT rank, COUNT(*) FROM Faculty GROUP BY rank" Show all the ranks and the number of male and female faculty for each rank.,"CREATE TABLE Faculty (rank VARCHAR, sex VARCHAR)","SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (rank VARCHAR, sex VARCHAR) ### question:Show all the ranks and the number of male and female faculty for each rank.","SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex" Which rank has the smallest number of faculty members?,CREATE TABLE Faculty (rank VARCHAR),SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (rank VARCHAR) ### question:Which rank has the smallest number of faculty members?",SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1 Show the number of male and female assistant professors.,"CREATE TABLE Faculty (sex VARCHAR, rank VARCHAR)","SELECT sex, COUNT(*) FROM Faculty WHERE rank = ""AsstProf"" GROUP BY sex","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (sex VARCHAR, rank VARCHAR) ### question:Show the number of male and female assistant professors.","SELECT sex, COUNT(*) FROM Faculty WHERE rank = ""AsstProf"" GROUP BY sex" What are the first name and last name of Linda Smith's advisor?,"CREATE TABLE Student (advisor VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR)","SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = ""Linda"" AND T2.lname = ""Smith""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (advisor VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR) ### question:What are the first name and last name of Linda Smith's advisor?","SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = ""Linda"" AND T2.lname = ""Smith""" Show the ids of students whose advisors are professors.,"CREATE TABLE Student (StuID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty (FacID VARCHAR, rank VARCHAR)","SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = ""Professor""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (StuID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty (FacID VARCHAR, rank VARCHAR) ### question:Show the ids of students whose advisors are professors.","SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = ""Professor""" Show first name and last name for all the students advised by Michael Goodrich.,"CREATE TABLE Faculty (FacID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Student (fname VARCHAR, lname VARCHAR, advisor VARCHAR)","SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = ""Michael"" AND T1.lname = ""Goodrich""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (FacID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Student (fname VARCHAR, lname VARCHAR, advisor VARCHAR) ### question:Show first name and last name for all the students advised by Michael Goodrich.","SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = ""Michael"" AND T1.lname = ""Goodrich""" "Show the faculty id of each faculty member, along with the number of students he or she advises.",CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR),"SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) ### question:Show the faculty id of each faculty member, along with the number of students he or she advises.","SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID" Show all the faculty ranks and the number of students advised by each rank.,"CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (rank VARCHAR, FacID VARCHAR)","SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (rank VARCHAR, FacID VARCHAR) ### question:Show all the faculty ranks and the number of students advised by each rank.","SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank" What are the first and last name of the faculty who has the most students?,"CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR)","SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR) ### question:What are the first and last name of the faculty who has the most students?","SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1" Show the ids for all the faculty members who have at least 2 students.,CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR),SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) ### question:Show the ids for all the faculty members who have at least 2 students.",SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2 Show ids for the faculty members who don't advise any student.,"CREATE TABLE Faculty (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR)",SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR) ### question:Show ids for the faculty members who don't advise any student.",SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student What activities do we have?,CREATE TABLE Activity (activity_name VARCHAR),SELECT activity_name FROM Activity,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Activity (activity_name VARCHAR) ### question:What activities do we have?",SELECT activity_name FROM Activity How many activities do we have?,CREATE TABLE Activity (Id VARCHAR),SELECT COUNT(*) FROM Activity,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Activity (Id VARCHAR) ### question:How many activities do we have?",SELECT COUNT(*) FROM Activity How many faculty members participate in an activity?,CREATE TABLE Faculty_participates_in (FacID VARCHAR),SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty_participates_in (FacID VARCHAR) ### question:How many faculty members participate in an activity?",SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in Show the ids of the faculty who don't participate in any activity.,CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR),SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR) ### question:Show the ids of the faculty who don't participate in any activity.",SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in Show the ids of all the faculty members who participate in an activity and advise a student.,"CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR, advisor VARCHAR)",SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR, advisor VARCHAR) ### question:Show the ids of all the faculty members who participate in an activity and advise a student.",SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student How many activities does Mark Giuliano participate in?,"CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR)","SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = ""Mark"" AND T1.lname = ""Giuliano""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR) ### question:How many activities does Mark Giuliano participate in?","SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = ""Mark"" AND T1.lname = ""Giuliano""" Show the names of all the activities Mark Giuliano participates in.,"CREATE TABLE Activity (activity_name VARCHAR, actid VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR)","SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = ""Mark"" AND T1.lname = ""Giuliano""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Activity (activity_name VARCHAR, actid VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR) ### question:Show the names of all the activities Mark Giuliano participates in.","SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = ""Mark"" AND T1.lname = ""Giuliano""" "Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in.","CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR)","SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR) ### question:Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in.","SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID" Show all the activity names and the number of faculty involved in each activity.,"CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR)","SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) ### question:Show all the activity names and the number of faculty involved in each activity.","SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID" What is the first and last name of the faculty participating in the most activities?,"CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR)","SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR) ### question:What is the first and last name of the faculty participating in the most activities?","SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1" What is the name of the activity that has the most faculty members involved in?,"CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR)",SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) ### question:What is the name of the activity that has the most faculty members involved in?",SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 Show the ids of the students who don't participate in any activity.,CREATE TABLE Participates_in (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR),SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participates_in (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) ### question:Show the ids of the students who don't participate in any activity.",SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in Show the ids for all the students who participate in an activity and are under 20.,"CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Participates_in (StuID VARCHAR, age INTEGER)",SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Participates_in (StuID VARCHAR, age INTEGER) ### question:Show the ids for all the students who participate in an activity and are under 20.",SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20 What is the first and last name of the student participating in the most activities?,"CREATE TABLE Student (fname VARCHAR, lname VARCHAR, StuID VARCHAR); CREATE TABLE Participates_in (StuID VARCHAR)","SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Student (fname VARCHAR, lname VARCHAR, StuID VARCHAR); CREATE TABLE Participates_in (StuID VARCHAR) ### question:What is the first and last name of the student participating in the most activities?","SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1" What is the name of the activity with the most students?,"CREATE TABLE Participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR)",SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) ### question:What is the name of the activity with the most students?",SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 Find the first names of the faculty members who are playing Canoeing or Kayaking.,"CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR)",SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) ### question:Find the first names of the faculty members who are playing Canoeing or Kayaking.",SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' Find the first names of professors who are not playing Canoeing or Kayaking.,"CREATE TABLE faculty (lname VARCHAR, rank VARCHAR); CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR)",SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE faculty (lname VARCHAR, rank VARCHAR); CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) ### question:Find the first names of professors who are not playing Canoeing or Kayaking.",SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' Find the first names of the faculty members who participate in Canoeing and Kayaking.,"CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR)",SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) ### question:Find the first names of the faculty members who participate in Canoeing and Kayaking.",SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking' Find the ids of the students who participate in Canoeing and Kayaking.,"CREATE TABLE activity (actid VARCHAR, activity_name VARCHAR); CREATE TABLE participates_in (stuid VARCHAR)",SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE activity (actid VARCHAR, activity_name VARCHAR); CREATE TABLE participates_in (stuid VARCHAR) ### question:Find the ids of the students who participate in Canoeing and Kayaking.",SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' Find the name of the airport in the city of Goroka.,"CREATE TABLE airports (name VARCHAR, city VARCHAR)",SELECT name FROM airports WHERE city = 'Goroka',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, city VARCHAR) ### question:Find the name of the airport in the city of Goroka.",SELECT name FROM airports WHERE city = 'Goroka' "Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.","CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR)","SELECT name, city, country, elevation FROM airports WHERE city = 'New York'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) ### question:Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.","SELECT name, city, country, elevation FROM airports WHERE city = 'New York'" How many airlines are there?,CREATE TABLE airlines (Id VARCHAR),SELECT COUNT(*) FROM airlines,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (Id VARCHAR) ### question:How many airlines are there?",SELECT COUNT(*) FROM airlines How many airlines does Russia has?,CREATE TABLE airlines (country VARCHAR),SELECT COUNT(*) FROM airlines WHERE country = 'Russia',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (country VARCHAR) ### question:How many airlines does Russia has?",SELECT COUNT(*) FROM airlines WHERE country = 'Russia' What is the maximum elevation of all airports in the country of Iceland?,"CREATE TABLE airports (elevation INTEGER, country VARCHAR)",SELECT MAX(elevation) FROM airports WHERE country = 'Iceland',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (elevation INTEGER, country VARCHAR) ### question:What is the maximum elevation of all airports in the country of Iceland?",SELECT MAX(elevation) FROM airports WHERE country = 'Iceland' Find the name of the airports located in Cuba or Argentina.,"CREATE TABLE airports (name VARCHAR, country VARCHAR)",SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, country VARCHAR) ### question:Find the name of the airports located in Cuba or Argentina.",SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' Find the country of the airlines whose name starts with 'Orbit'.,"CREATE TABLE airlines (country VARCHAR, name VARCHAR)",SELECT country FROM airlines WHERE name LIKE 'Orbit%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (country VARCHAR, name VARCHAR) ### question:Find the country of the airlines whose name starts with 'Orbit'.",SELECT country FROM airlines WHERE name LIKE 'Orbit%' Find the name of airports whose altitude is between -50 and 50.,"CREATE TABLE airports (name VARCHAR, elevation INTEGER)",SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, elevation INTEGER) ### question:Find the name of airports whose altitude is between -50 and 50.",SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 Which country is the airport that has the highest altitude located in?,"CREATE TABLE airports (country VARCHAR, elevation VARCHAR)",SELECT country FROM airports ORDER BY elevation DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (country VARCHAR, elevation VARCHAR) ### question:Which country is the airport that has the highest altitude located in?",SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 Find the number of airports whose name contain the word 'International'.,CREATE TABLE airports (name VARCHAR),SELECT COUNT(*) FROM airports WHERE name LIKE '%International%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR) ### question:Find the number of airports whose name contain the word 'International'.",SELECT COUNT(*) FROM airports WHERE name LIKE '%International%' How many different cities do have some airport in the country of Greenland?,"CREATE TABLE airports (city VARCHAR, country VARCHAR)",SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (city VARCHAR, country VARCHAR) ### question:How many different cities do have some airport in the country of Greenland?",SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland' Find the number of routes operated by American Airlines.,"CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR)",SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) ### question:Find the number of routes operated by American Airlines.",SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' Find the number of routes whose destination airports are in Canada.,CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR),SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR) ### question:Find the number of routes whose destination airports are in Canada.",SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' "Find the name, city, and country of the airport that has the lowest altitude.","CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR)","SELECT name, city, country FROM airports ORDER BY elevation LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) ### question:Find the name, city, and country of the airport that has the lowest altitude.","SELECT name, city, country FROM airports ORDER BY elevation LIMIT 1" "Find the name, city, and country of the airport that has the highest latitude.","CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR)","SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) ### question:Find the name, city, and country of the airport that has the highest latitude.","SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1" Find the name and city of the airport which is the destination of the most number of routes.,"CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (dst_apid VARCHAR)","SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (dst_apid VARCHAR) ### question:Find the name and city of the airport which is the destination of the most number of routes.","SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1" Find the names of the top 10 airlines that operate the most number of routes.,"CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR)","SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) ### question:Find the names of the top 10 airlines that operate the most number of routes.","SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10" Find the name and city of the airport which is the source for the most number of flight routes.,"CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR)","SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) ### question:Find the name and city of the airport which is the source for the most number of flight routes.","SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1" Find the number of different airports which are the destinations of the American Airlines.,"CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR)",SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) ### question:Find the number of different airports which are the destinations of the American Airlines.",SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' Which countries has the most number of airlines?,CREATE TABLE airlines (country VARCHAR),SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (country VARCHAR) ### question:Which countries has the most number of airlines?",SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 Which countries has the most number of airlines whose active status is 'Y'?,"CREATE TABLE airlines (country VARCHAR, active VARCHAR)",SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (country VARCHAR, active VARCHAR) ### question:Which countries has the most number of airlines whose active status is 'Y'?",SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 List all countries and their number of airlines in the descending order of number of airlines.,CREATE TABLE airlines (country VARCHAR),"SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (country VARCHAR) ### question:List all countries and their number of airlines in the descending order of number of airlines.","SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC" How many airports are there per country? Order the countries by decreasing number of airports.,CREATE TABLE airports (country VARCHAR),"SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (country VARCHAR) ### question:How many airports are there per country? Order the countries by decreasing number of airports.","SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC" How many airports are there per city in the United States? Order the cities by decreasing number of airports.,"CREATE TABLE airports (city VARCHAR, country VARCHAR)","SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (city VARCHAR, country VARCHAR) ### question:How many airports are there per city in the United States? Order the cities by decreasing number of airports.","SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC" Return the cities with more than 3 airports in the United States.,"CREATE TABLE airports (city VARCHAR, country VARCHAR)",SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (city VARCHAR, country VARCHAR) ### question:Return the cities with more than 3 airports in the United States.",SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3 How many cities are there that have more than 3 airports?,CREATE TABLE airports (city VARCHAR),SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (city VARCHAR) ### question:How many cities are there that have more than 3 airports?",SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3) List the cities which have more than one airport and number of airports.,CREATE TABLE airports (city VARCHAR),"SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (city VARCHAR) ### question:List the cities which have more than one airport and number of airports.","SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1" List the cities which have more than 2 airports sorted by the number of airports.,CREATE TABLE airports (city VARCHAR),SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (city VARCHAR) ### question:List the cities which have more than 2 airports sorted by the number of airports.",SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) Find the number of routes for each source airport and the airport name.,"CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR)","SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) ### question:Find the number of routes for each source airport and the airport name.","SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name" "Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.","CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR)","SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) ### question:Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.","SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC" Find the average elevation of all airports for each country.,"CREATE TABLE airports (country VARCHAR, elevation INTEGER)","SELECT AVG(elevation), country FROM airports GROUP BY country","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (country VARCHAR, elevation INTEGER) ### question:Find the average elevation of all airports for each country.","SELECT AVG(elevation), country FROM airports GROUP BY country" Find the cities which have exactly two airports.,CREATE TABLE airports (city VARCHAR),SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (city VARCHAR) ### question:Find the cities which have exactly two airports.",SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2 "For each country and airline name, how many routes are there?","CREATE TABLE airlines (country VARCHAR, name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR)","SELECT T1.country, T1.name, COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (country VARCHAR, name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) ### question:For each country and airline name, how many routes are there?","SELECT T1.country, T1.name, COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name" Find the number of routes with destination airports in Italy.,"CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR)",SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR) ### question:Find the number of routes with destination airports in Italy.",SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.,"CREATE TABLE routes (dst_apid VARCHAR, alid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR)",SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (dst_apid VARCHAR, alid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) ### question:Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.",SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' Find the number of routes that have destination John F Kennedy International Airport.,"CREATE TABLE airports (apid VARCHAR, name VARCHAR); CREATE TABLE routes (dst_apid VARCHAR)",SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (apid VARCHAR, name VARCHAR); CREATE TABLE routes (dst_apid VARCHAR) ### question:Find the number of routes that have destination John F Kennedy International Airport.",SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' Find the number of routes from the United States to Canada.,"CREATE TABLE airports (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE routes (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR)",SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airports (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE routes (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR) ### question:Find the number of routes from the United States to Canada.",SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') Find the id of routes whose source and destination airports are in the United States.,"CREATE TABLE routes (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE airports (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR)",SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States'),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE airports (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR) ### question:Find the id of routes whose source and destination airports are in the United States.",SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') Find the name of airline which runs the most number of routes.,"CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR)",SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) ### question:Find the name of airline which runs the most number of routes.",SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 Find the busiest source airport that runs most number of routes in China.,"CREATE TABLE routes (src_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR)",SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (src_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR) ### question:Find the busiest source airport that runs most number of routes in China.",SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 Find the busiest destination airport that runs most number of routes in China.,"CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR)",SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR) ### question:Find the busiest destination airport that runs most number of routes in China.",SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 What is the id of the most recent order?,"CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR)",SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) ### question:What is the id of the most recent order?",SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1 what are the order id and customer id of the oldest order?,"CREATE TABLE orders (order_id VARCHAR, customer_id VARCHAR, date_order_placed VARCHAR)","SELECT order_id, customer_id FROM orders ORDER BY date_order_placed LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (order_id VARCHAR, customer_id VARCHAR, date_order_placed VARCHAR) ### question:what are the order id and customer id of the oldest order?","SELECT order_id, customer_id FROM orders ORDER BY date_order_placed LIMIT 1" "Find the id of the order whose shipment tracking number is ""3452"".","CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR)","SELECT order_id FROM shipments WHERE shipment_tracking_number = ""3452""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR) ### question:Find the id of the order whose shipment tracking number is ""3452"".","SELECT order_id FROM shipments WHERE shipment_tracking_number = ""3452""" Find the ids of all the order items whose product id is 11.,"CREATE TABLE order_items (order_item_id VARCHAR, product_id VARCHAR)",SELECT order_item_id FROM order_items WHERE product_id = 11,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (order_item_id VARCHAR, product_id VARCHAR) ### question:Find the ids of all the order items whose product id is 11.",SELECT order_item_id FROM order_items WHERE product_id = 11 "List the name of all the distinct customers who have orders with status ""Packing"".","CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)","SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Packing""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:List the name of all the distinct customers who have orders with status ""Packing"".","SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Packing""" "Find the details of all the distinct customers who have orders with status ""On Road"".","CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_details VARCHAR, customer_id VARCHAR)","SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_details VARCHAR, customer_id VARCHAR) ### question:Find the details of all the distinct customers who have orders with status ""On Road"".","SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road""" What is the name of the customer who has the most orders?,"CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)",SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:What is the name of the customer who has the most orders?",SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 What is the customer id of the customer who has the most orders?,CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR),SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR) ### question:What is the customer id of the customer who has the most orders?",SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 "Give me a list of id and status of orders which belong to the customer named ""Jeramie"".","CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE orders (order_id VARCHAR, order_status VARCHAR, customer_id VARCHAR)","SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = ""Jeramie""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE orders (order_id VARCHAR, order_status VARCHAR, customer_id VARCHAR) ### question:Give me a list of id and status of orders which belong to the customer named ""Jeramie"".","SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = ""Jeramie""" "Find the dates of orders which belong to the customer named ""Jeramie"".","CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE orders (date_order_placed VARCHAR, customer_id VARCHAR)","SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = ""Jeramie""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE orders (date_order_placed VARCHAR, customer_id VARCHAR) ### question:Find the dates of orders which belong to the customer named ""Jeramie"".","SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = ""Jeramie""" Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.,"CREATE TABLE orders (customer_id VARCHAR, date_order_placed VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= ""2009-01-01"" AND T2.date_order_placed <= ""2010-01-01""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR, date_order_placed VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= ""2009-01-01"" AND T2.date_order_placed <= ""2010-01-01""" Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01?,"CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR)","SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= ""1975-01-01"" AND T1.date_order_placed <= ""1976-01-01""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) ### question:Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01?","SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= ""1975-01-01"" AND T1.date_order_placed <= ""1976-01-01""" "Find the names of the customers who have order status both ""On Road"" and ""Shipped"".","CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road"" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Shipped""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:Find the names of the customers who have order status both ""On Road"" and ""Shipped"".","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road"" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Shipped""" "Find the id of the customers who have order status both ""On Road"" and ""Shipped"".","CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR)","SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road"" INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Shipped""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR) ### question:Find the id of the customers who have order status both ""On Road"" and ""Shipped"".","SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road"" INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Shipped""" When was the order placed whose shipment tracking number is 3452? Give me the date.,"CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR); CREATE TABLE orders (date_order_placed VARCHAR, order_id VARCHAR)",SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR); CREATE TABLE orders (date_order_placed VARCHAR, order_id VARCHAR) ### question:When was the order placed whose shipment tracking number is 3452? Give me the date.",SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452 What is the placement date of the order whose invoice number is 10?,"CREATE TABLE orders (date_order_placed VARCHAR, order_id VARCHAR); CREATE TABLE shipments (order_id VARCHAR, invoice_number VARCHAR)",SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (date_order_placed VARCHAR, order_id VARCHAR); CREATE TABLE shipments (order_id VARCHAR, invoice_number VARCHAR) ### question:What is the placement date of the order whose invoice number is 10?",SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10 List the count and id of each product in all the orders.,"CREATE TABLE orders (order_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE products (product_id VARCHAR)","SELECT COUNT(*), T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (order_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE products (product_id VARCHAR) ### question:List the count and id of each product in all the orders.","SELECT COUNT(*), T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id" List the name and count of each product in all orders.,"CREATE TABLE orders (order_id VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR)","SELECT T3.product_name, COUNT(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (order_id VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR) ### question:List the name and count of each product in all orders.","SELECT T3.product_name, COUNT(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id" Find the ids of orders which are shipped after 2000-01-01.,"CREATE TABLE shipments (order_id VARCHAR, shipment_date INTEGER)","SELECT order_id FROM shipments WHERE shipment_date > ""2000-01-01""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shipments (order_id VARCHAR, shipment_date INTEGER) ### question:Find the ids of orders which are shipped after 2000-01-01.","SELECT order_id FROM shipments WHERE shipment_date > ""2000-01-01""" Find the id of the order which is shipped most recently.,"CREATE TABLE shipments (order_id VARCHAR, shipment_date INTEGER)",SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE shipments (order_id VARCHAR, shipment_date INTEGER) ### question:Find the id of the order which is shipped most recently.",SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments) List the names of all distinct products in alphabetical order.,CREATE TABLE products (product_name VARCHAR),SELECT DISTINCT product_name FROM products ORDER BY product_name,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR) ### question:List the names of all distinct products in alphabetical order.",SELECT DISTINCT product_name FROM products ORDER BY product_name List the ids of all distinct orders ordered by placed date.,"CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR)",SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) ### question:List the ids of all distinct orders ordered by placed date.",SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed What is the id of the order which has the most items?,CREATE TABLE orders (order_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR),SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (order_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR) ### question:What is the id of the order which has the most items?",SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1 Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.,"CREATE TABLE invoices (invoice_number VARCHAR, invoice_date VARCHAR)","SELECT invoice_number FROM invoices WHERE invoice_date < ""1989-09-03"" OR invoice_date > ""2007-12-25""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE invoices (invoice_number VARCHAR, invoice_date VARCHAR) ### question:Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.","SELECT invoice_number FROM invoices WHERE invoice_date < ""1989-09-03"" OR invoice_date > ""2007-12-25""" Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25.,"CREATE TABLE invoices (invoice_details VARCHAR, invoice_date VARCHAR)","SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < ""1989-09-03"" OR invoice_date > ""2007-12-25""","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE invoices (invoice_details VARCHAR, invoice_date VARCHAR) ### question:Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25.","SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < ""1989-09-03"" OR invoice_date > ""2007-12-25""" "For each customer who has at least two orders, find the customer name and number of orders made.","CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)","SELECT T2.customer_name, COUNT(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) >= 2","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:For each customer who has at least two orders, find the customer name and number of orders made.","SELECT T2.customer_name, COUNT(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) >= 2" Find the name of the customers who have at most two orders.,"CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)",SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) ### question:Find the name of the customers who have at most two orders.",SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2 "List the names of the customers who have once bought product ""food"".","CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR)","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = ""food"" GROUP BY T1.customer_id HAVING COUNT(*) >= 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR) ### question:List the names of the customers who have once bought product ""food"".","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = ""food"" GROUP BY T1.customer_id HAVING COUNT(*) >= 1" "List the names of customers who have once canceled the purchase of the product ""food"" (the item status is ""Cancel"").","CREATE TABLE orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_item_status VARCHAR, order_id VARCHAR)","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = ""Cancel"" AND T4.product_name = ""food"" GROUP BY T1.customer_id HAVING COUNT(*) >= 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_item_status VARCHAR, order_id VARCHAR) ### question:List the names of customers who have once canceled the purchase of the product ""food"" (the item status is ""Cancel"").","SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = ""Cancel"" AND T4.product_name = ""food"" GROUP BY T1.customer_id HAVING COUNT(*) >= 1" How many architects are female?,CREATE TABLE architect (gender VARCHAR),SELECT COUNT(*) FROM architect WHERE gender = 'female',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE architect (gender VARCHAR) ### question:How many architects are female?",SELECT COUNT(*) FROM architect WHERE gender = 'female' "List the name, nationality and id of all male architects ordered by their names lexicographically.","CREATE TABLE architect (name VARCHAR, nationality VARCHAR, id VARCHAR, gender VARCHAR)","SELECT name, nationality, id FROM architect WHERE gender = 'male' ORDER BY name","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE architect (name VARCHAR, nationality VARCHAR, id VARCHAR, gender VARCHAR) ### question:List the name, nationality and id of all male architects ordered by their names lexicographically.","SELECT name, nationality, id FROM architect WHERE gender = 'male' ORDER BY name" What is the maximum length in meters for the bridges and what are the architects' names?,"CREATE TABLE architect (name VARCHAR, id VARCHAR); CREATE TABLE bridge (length_meters INTEGER, architect_id VARCHAR)","SELECT MAX(T1.length_meters), T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE architect (name VARCHAR, id VARCHAR); CREATE TABLE bridge (length_meters INTEGER, architect_id VARCHAR) ### question:What is the maximum length in meters for the bridges and what are the architects' names?","SELECT MAX(T1.length_meters), T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id" What is the average length in feet of the bridges?,CREATE TABLE bridge (length_feet INTEGER),SELECT AVG(length_feet) FROM bridge,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bridge (length_feet INTEGER) ### question:What is the average length in feet of the bridges?",SELECT AVG(length_feet) FROM bridge What are the names and year of construction for the mills of 'Grondzeiler' type?,"CREATE TABLE mill (name VARCHAR, built_year VARCHAR, TYPE VARCHAR)","SELECT name, built_year FROM mill WHERE TYPE = 'Grondzeiler'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mill (name VARCHAR, built_year VARCHAR, TYPE VARCHAR) ### question:What are the names and year of construction for the mills of 'Grondzeiler' type?","SELECT name, built_year FROM mill WHERE TYPE = 'Grondzeiler'" What are the distinct names and nationalities of the architects who have ever built a mill?,"CREATE TABLE mill (Id VARCHAR); CREATE TABLE architect (name VARCHAR, nationality VARCHAR, id VARCHAR)","SELECT DISTINCT T1.name, T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mill (Id VARCHAR); CREATE TABLE architect (name VARCHAR, nationality VARCHAR, id VARCHAR) ### question:What are the distinct names and nationalities of the architects who have ever built a mill?","SELECT DISTINCT T1.name, T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id" What are the names of the mills which are not located in 'Donceel'?,"CREATE TABLE mill (name VARCHAR, LOCATION VARCHAR)",SELECT name FROM mill WHERE LOCATION <> 'Donceel',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mill (name VARCHAR, LOCATION VARCHAR) ### question:What are the names of the mills which are not located in 'Donceel'?",SELECT name FROM mill WHERE LOCATION <> 'Donceel' What are the distinct types of mills that are built by American or Canadian architects?,"CREATE TABLE architect (Id VARCHAR); CREATE TABLE mill (type VARCHAR, architect_id VARCHAR)",SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE architect (Id VARCHAR); CREATE TABLE mill (type VARCHAR, architect_id VARCHAR) ### question:What are the distinct types of mills that are built by American or Canadian architects?",SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian' What are the ids and names of the architects who built at least 3 bridges ?,"CREATE TABLE architect (id VARCHAR, name VARCHAR); CREATE TABLE bridge (architect_id VARCHAR)","SELECT T1.id, T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) >= 3","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE architect (id VARCHAR, name VARCHAR); CREATE TABLE bridge (architect_id VARCHAR) ### question:What are the ids and names of the architects who built at least 3 bridges ?","SELECT T1.id, T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) >= 3" "What is the id, name and nationality of the architect who built most mills?","CREATE TABLE architect (id VARCHAR, name VARCHAR, nationality VARCHAR); CREATE TABLE mill (architect_id VARCHAR)","SELECT T1.id, T1.name, T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE architect (id VARCHAR, name VARCHAR, nationality VARCHAR); CREATE TABLE mill (architect_id VARCHAR) ### question:What is the id, name and nationality of the architect who built most mills?","SELECT T1.id, T1.name, T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1" "What are the ids, names and genders of the architects who built two bridges or one mill?","CREATE TABLE mill (architect_id VARCHAR); CREATE TABLE architect (id VARCHAR, name VARCHAR, gender VARCHAR); CREATE TABLE bridge (architect_id VARCHAR)","SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 2 UNION SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mill (architect_id VARCHAR); CREATE TABLE architect (id VARCHAR, name VARCHAR, gender VARCHAR); CREATE TABLE bridge (architect_id VARCHAR) ### question:What are the ids, names and genders of the architects who built two bridges or one mill?","SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 2 UNION SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 1" What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'?,"CREATE TABLE bridge (LOCATION VARCHAR, name VARCHAR)",SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch' OR name = 'Rainbow Bridge',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bridge (LOCATION VARCHAR, name VARCHAR) ### question:What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'?",SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch' OR name = 'Rainbow Bridge' Which of the mill names contains the french word 'Moulin'?,CREATE TABLE mill (name VARCHAR),SELECT name FROM mill WHERE name LIKE '%Moulin%',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mill (name VARCHAR) ### question:Which of the mill names contains the french word 'Moulin'?",SELECT name FROM mill WHERE name LIKE '%Moulin%' What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters?,"CREATE TABLE architect (Id VARCHAR); CREATE TABLE mill (name VARCHAR, architect_id VARCHAR); CREATE TABLE bridge (architect_id VARCHAR, length_meters INTEGER)",SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE architect (Id VARCHAR); CREATE TABLE mill (name VARCHAR, architect_id VARCHAR); CREATE TABLE bridge (architect_id VARCHAR, length_meters INTEGER) ### question:What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters?",SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80 "What is the most common mill type, and how many are there?",CREATE TABLE mill (TYPE VARCHAR),"SELECT TYPE, COUNT(*) FROM mill GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mill (TYPE VARCHAR) ### question:What is the most common mill type, and how many are there?","SELECT TYPE, COUNT(*) FROM mill GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1" How many architects haven't built a mill before year 1850?,"CREATE TABLE mill (id VARCHAR, architect_id VARCHAR, built_year INTEGER); CREATE TABLE architect (id VARCHAR, architect_id VARCHAR, built_year INTEGER)",SELECT COUNT(*) FROM architect WHERE NOT id IN (SELECT architect_id FROM mill WHERE built_year < 1850),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE mill (id VARCHAR, architect_id VARCHAR, built_year INTEGER); CREATE TABLE architect (id VARCHAR, architect_id VARCHAR, built_year INTEGER) ### question:How many architects haven't built a mill before year 1850?",SELECT COUNT(*) FROM architect WHERE NOT id IN (SELECT architect_id FROM mill WHERE built_year < 1850) "show the name of all bridges that was designed by american archtect, and sort the result by the bridge feet length.","CREATE TABLE bridge (name VARCHAR, architect_id VARCHAR, length_feet VARCHAR); CREATE TABLE architect (id VARCHAR, nationality VARCHAR)",SELECT t1.name FROM bridge AS t1 JOIN architect AS t2 ON t1.architect_id = t2.id WHERE t2.nationality = 'American' ORDER BY t1.length_feet,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE bridge (name VARCHAR, architect_id VARCHAR, length_feet VARCHAR); CREATE TABLE architect (id VARCHAR, nationality VARCHAR) ### question:show the name of all bridges that was designed by american archtect, and sort the result by the bridge feet length.",SELECT t1.name FROM bridge AS t1 JOIN architect AS t2 ON t1.architect_id = t2.id WHERE t2.nationality = 'American' ORDER BY t1.length_feet How many book clubs are there?,CREATE TABLE book_club (Id VARCHAR),SELECT COUNT(*) FROM book_club,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (Id VARCHAR) ### question:How many book clubs are there?",SELECT COUNT(*) FROM book_club "show the titles, and authors or editors for all books made after the year 1989.","CREATE TABLE book_club (book_title VARCHAR, author_or_editor VARCHAR, YEAR INTEGER)","SELECT book_title, author_or_editor FROM book_club WHERE YEAR > 1989","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (book_title VARCHAR, author_or_editor VARCHAR, YEAR INTEGER) ### question:show the titles, and authors or editors for all books made after the year 1989.","SELECT book_title, author_or_editor FROM book_club WHERE YEAR > 1989" Show all distinct publishers for books.,CREATE TABLE book_club (publisher VARCHAR),SELECT DISTINCT publisher FROM book_club,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (publisher VARCHAR) ### question:Show all distinct publishers for books.",SELECT DISTINCT publisher FROM book_club "Show the years, book titles, and publishers for all books, in descending order by year.","CREATE TABLE book_club (YEAR VARCHAR, book_title VARCHAR, publisher VARCHAR)","SELECT YEAR, book_title, publisher FROM book_club ORDER BY YEAR DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (YEAR VARCHAR, book_title VARCHAR, publisher VARCHAR) ### question:Show the years, book titles, and publishers for all books, in descending order by year.","SELECT YEAR, book_title, publisher FROM book_club ORDER BY YEAR DESC" Show all publishers and the number of books for each publisher.,CREATE TABLE book_club (publisher VARCHAR),"SELECT publisher, COUNT(*) FROM book_club GROUP BY publisher","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (publisher VARCHAR) ### question:Show all publishers and the number of books for each publisher.","SELECT publisher, COUNT(*) FROM book_club GROUP BY publisher" What is the publisher with most number of books?,CREATE TABLE book_club (publisher VARCHAR),SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (publisher VARCHAR) ### question:What is the publisher with most number of books?",SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1 Show all book categories and the number of books in each category.,CREATE TABLE book_club (category VARCHAR),"SELECT category, COUNT(*) FROM book_club GROUP BY category","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (category VARCHAR) ### question:Show all book categories and the number of books in each category.","SELECT category, COUNT(*) FROM book_club GROUP BY category" List categories that have at least two books after year 1989.,"CREATE TABLE book_club (category VARCHAR, YEAR INTEGER)",SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (category VARCHAR, YEAR INTEGER) ### question:List categories that have at least two books after year 1989.",SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2 Show publishers with a book published in 1989 and a book in 1990.,"CREATE TABLE book_club (publisher VARCHAR, YEAR VARCHAR)",SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (publisher VARCHAR, YEAR VARCHAR) ### question:Show publishers with a book published in 1989 and a book in 1990.",SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990 Show all publishers which do not have a book in 1989.,"CREATE TABLE book_club (publisher VARCHAR, YEAR VARCHAR)",SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE book_club (publisher VARCHAR, YEAR VARCHAR) ### question:Show all publishers which do not have a book in 1989.",SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989 "Show all movie titles, years, and directors, ordered by budget.","CREATE TABLE movie (title VARCHAR, YEAR VARCHAR, director VARCHAR, budget_million VARCHAR)","SELECT title, YEAR, director FROM movie ORDER BY budget_million","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (title VARCHAR, YEAR VARCHAR, director VARCHAR, budget_million VARCHAR) ### question:Show all movie titles, years, and directors, ordered by budget.","SELECT title, YEAR, director FROM movie ORDER BY budget_million" How many movie directors are there?,CREATE TABLE movie (director VARCHAR),SELECT COUNT(DISTINCT director) FROM movie,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (director VARCHAR) ### question:How many movie directors are there?",SELECT COUNT(DISTINCT director) FROM movie What is the title and director for the movie with highest worldwide gross in the year 2000 or before?,"CREATE TABLE movie (title VARCHAR, director VARCHAR, YEAR VARCHAR, gross_worldwide VARCHAR)","SELECT title, director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (title VARCHAR, director VARCHAR, YEAR VARCHAR, gross_worldwide VARCHAR) ### question:What is the title and director for the movie with highest worldwide gross in the year 2000 or before?","SELECT title, director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1" Show all director names who have a movie in both year 1999 and 2000.,"CREATE TABLE movie (director VARCHAR, YEAR VARCHAR)",SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (director VARCHAR, YEAR VARCHAR) ### question:Show all director names who have a movie in both year 1999 and 2000.",SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999 Show all director names who have a movie in the year 1999 or 2000.,"CREATE TABLE movie (director VARCHAR, YEAR VARCHAR)",SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (director VARCHAR, YEAR VARCHAR) ### question:Show all director names who have a movie in the year 1999 or 2000.",SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000 "What is the average, maximum, and minimum budget for all movies before 2000.","CREATE TABLE movie (budget_million INTEGER, YEAR INTEGER)","SELECT AVG(budget_million), MAX(budget_million), MIN(budget_million) FROM movie WHERE YEAR < 2000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (budget_million INTEGER, YEAR INTEGER) ### question:What is the average, maximum, and minimum budget for all movies before 2000.","SELECT AVG(budget_million), MAX(budget_million), MIN(budget_million) FROM movie WHERE YEAR < 2000" List all company names with a book published by Alyson.,"CREATE TABLE culture_company (company_name VARCHAR, book_club_id VARCHAR); CREATE TABLE book_club (book_club_id VARCHAR, publisher VARCHAR)",SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE culture_company (company_name VARCHAR, book_club_id VARCHAR); CREATE TABLE book_club (book_club_id VARCHAR, publisher VARCHAR) ### question:List all company names with a book published by Alyson.",SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson' Show the movie titles and book titles for all companies in China.,"CREATE TABLE movie (title VARCHAR, movie_id VARCHAR); CREATE TABLE culture_company (movie_id VARCHAR, book_club_id VARCHAR, incorporated_in VARCHAR); CREATE TABLE book_club (book_title VARCHAR, book_club_id VARCHAR)","SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (title VARCHAR, movie_id VARCHAR); CREATE TABLE culture_company (movie_id VARCHAR, book_club_id VARCHAR, incorporated_in VARCHAR); CREATE TABLE book_club (book_title VARCHAR, book_club_id VARCHAR) ### question:Show the movie titles and book titles for all companies in China.","SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'" Show all company names with a movie directed in year 1999.,"CREATE TABLE movie (movie_id VARCHAR, year VARCHAR); CREATE TABLE culture_company (company_name VARCHAR, movie_id VARCHAR)",SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE movie (movie_id VARCHAR, year VARCHAR); CREATE TABLE culture_company (company_name VARCHAR, movie_id VARCHAR) ### question:Show all company names with a movie directed in year 1999.",SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999 How many singers do we have?,CREATE TABLE singer (Id VARCHAR),SELECT COUNT(*) FROM singer,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (Id VARCHAR) ### question:How many singers do we have?",SELECT COUNT(*) FROM singer "Show name, country, age for all singers ordered by age from the oldest to the youngest.","CREATE TABLE singer (name VARCHAR, country VARCHAR, age VARCHAR)","SELECT name, country, age FROM singer ORDER BY age DESC","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (name VARCHAR, country VARCHAR, age VARCHAR) ### question:Show name, country, age for all singers ordered by age from the oldest to the youngest.","SELECT name, country, age FROM singer ORDER BY age DESC" "What is the average, minimum, and maximum age of all singers from France?","CREATE TABLE singer (age INTEGER, country VARCHAR)","SELECT AVG(age), MIN(age), MAX(age) FROM singer WHERE country = 'France'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (age INTEGER, country VARCHAR) ### question:What is the average, minimum, and maximum age of all singers from France?","SELECT AVG(age), MIN(age), MAX(age) FROM singer WHERE country = 'France'" Show the name and the release year of the song by the youngest singer.,"CREATE TABLE singer (song_name VARCHAR, song_release_year VARCHAR, age VARCHAR)","SELECT song_name, song_release_year FROM singer ORDER BY age LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (song_name VARCHAR, song_release_year VARCHAR, age VARCHAR) ### question:Show the name and the release year of the song by the youngest singer.","SELECT song_name, song_release_year FROM singer ORDER BY age LIMIT 1" What are all distinct countries where singers above age 20 are from?,"CREATE TABLE singer (country VARCHAR, age INTEGER)",SELECT DISTINCT country FROM singer WHERE age > 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (country VARCHAR, age INTEGER) ### question:What are all distinct countries where singers above age 20 are from?",SELECT DISTINCT country FROM singer WHERE age > 20 Show all countries and the number of singers in each country.,CREATE TABLE singer (country VARCHAR),"SELECT country, COUNT(*) FROM singer GROUP BY country","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (country VARCHAR) ### question:Show all countries and the number of singers in each country.","SELECT country, COUNT(*) FROM singer GROUP BY country" List all song names by singers above the average age.,"CREATE TABLE singer (song_name VARCHAR, age INTEGER)",SELECT song_name FROM singer WHERE age > (SELECT AVG(age) FROM singer),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (song_name VARCHAR, age INTEGER) ### question:List all song names by singers above the average age.",SELECT song_name FROM singer WHERE age > (SELECT AVG(age) FROM singer) Show location and name for all stadiums with a capacity between 5000 and 10000.,"CREATE TABLE stadium (LOCATION VARCHAR, name VARCHAR, capacity INTEGER)","SELECT LOCATION, name FROM stadium WHERE capacity BETWEEN 5000 AND 10000","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (LOCATION VARCHAR, name VARCHAR, capacity INTEGER) ### question:Show location and name for all stadiums with a capacity between 5000 and 10000.","SELECT LOCATION, name FROM stadium WHERE capacity BETWEEN 5000 AND 10000" What is the maximum capacity and the average of all stadiums ?,"CREATE TABLE stadium (average VARCHAR, capacity INTEGER)","SELECT MAX(capacity), average FROM stadium","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (average VARCHAR, capacity INTEGER) ### question:What is the maximum capacity and the average of all stadiums ?","SELECT MAX(capacity), average FROM stadium" What is the average and maximum capacities for all stadiums ?,CREATE TABLE stadium (capacity INTEGER),"SELECT AVG(capacity), MAX(capacity) FROM stadium","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (capacity INTEGER) ### question:What is the average and maximum capacities for all stadiums ?","SELECT AVG(capacity), MAX(capacity) FROM stadium" What is the name and capacity for the stadium with highest average attendance?,"CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, average VARCHAR)","SELECT name, capacity FROM stadium ORDER BY average DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, average VARCHAR) ### question:What is the name and capacity for the stadium with highest average attendance?","SELECT name, capacity FROM stadium ORDER BY average DESC LIMIT 1" How many concerts are there in year 2014 or 2015?,CREATE TABLE concert (YEAR VARCHAR),SELECT COUNT(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE concert (YEAR VARCHAR) ### question:How many concerts are there in year 2014 or 2015?",SELECT COUNT(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015 Show the stadium name and the number of concerts in each stadium.,"CREATE TABLE stadium (name VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR)","SELECT T2.name, COUNT(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR) ### question:Show the stadium name and the number of concerts in each stadium.","SELECT T2.name, COUNT(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id" Show the stadium name and capacity with most number of concerts in year 2014 or after.,"CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR, year VARCHAR)","SELECT T2.name, T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year >= 2014 GROUP BY T2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR, year VARCHAR) ### question:Show the stadium name and capacity with most number of concerts in year 2014 or after.","SELECT T2.name, T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year >= 2014 GROUP BY T2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1" What is the name and capacity of the stadium with the most concerts after 2013 ?,"CREATE TABLE concert (stadium_id VARCHAR, year INTEGER); CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, stadium_id VARCHAR)","SELECT t2.name, t2.capacity FROM concert AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.stadium_id WHERE t1.year > 2013 GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE concert (stadium_id VARCHAR, year INTEGER); CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, stadium_id VARCHAR) ### question:What is the name and capacity of the stadium with the most concerts after 2013 ?","SELECT t2.name, t2.capacity FROM concert AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.stadium_id WHERE t1.year > 2013 GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1" Which year has most number of concerts?,CREATE TABLE concert (YEAR VARCHAR),SELECT YEAR FROM concert GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE concert (YEAR VARCHAR) ### question:Which year has most number of concerts?",SELECT YEAR FROM concert GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1 Show the stadium names without any concert.,"CREATE TABLE stadium (name VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (name VARCHAR, stadium_id VARCHAR)",SELECT name FROM stadium WHERE NOT stadium_id IN (SELECT stadium_id FROM concert),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (name VARCHAR, stadium_id VARCHAR) ### question:Show the stadium names without any concert.",SELECT name FROM stadium WHERE NOT stadium_id IN (SELECT stadium_id FROM concert) Show countries where a singer above age 40 and a singer below 30 are from.,"CREATE TABLE singer (country VARCHAR, age INTEGER)",SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (country VARCHAR, age INTEGER) ### question:Show countries where a singer above age 40 and a singer below 30 are from.",SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30 Show names for all stadiums except for stadiums having a concert in year 2014.,"CREATE TABLE stadium (name VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR, year VARCHAR); CREATE TABLE stadium (name VARCHAR)",SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR, year VARCHAR); CREATE TABLE stadium (name VARCHAR) ### question:Show names for all stadiums except for stadiums having a concert in year 2014.",SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014 Show the name and theme for all concerts and the number of singers in each concert.,"CREATE TABLE singer_in_concert (concert_id VARCHAR); CREATE TABLE concert (concert_name VARCHAR, theme VARCHAR, concert_id VARCHAR)","SELECT T2.concert_name, T2.theme, COUNT(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer_in_concert (concert_id VARCHAR); CREATE TABLE concert (concert_name VARCHAR, theme VARCHAR, concert_id VARCHAR) ### question:Show the name and theme for all concerts and the number of singers in each concert.","SELECT T2.concert_name, T2.theme, COUNT(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id" "What are the names , themes , and number of singers for every concert ?","CREATE TABLE singer_in_concert (concert_id VARCHAR); CREATE TABLE concert (concert_name VARCHAR, theme VARCHAR, concert_id VARCHAR)","SELECT t2.concert_name, t2.theme, COUNT(*) FROM singer_in_concert AS t1 JOIN concert AS t2 ON t1.concert_id = t2.concert_id GROUP BY t2.concert_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer_in_concert (concert_id VARCHAR); CREATE TABLE concert (concert_name VARCHAR, theme VARCHAR, concert_id VARCHAR) ### question:What are the names , themes , and number of singers for every concert ?","SELECT t2.concert_name, t2.theme, COUNT(*) FROM singer_in_concert AS t1 JOIN concert AS t2 ON t1.concert_id = t2.concert_id GROUP BY t2.concert_id" List singer names and number of concerts for each singer.,"CREATE TABLE singer_in_concert (singer_id VARCHAR); CREATE TABLE singer (name VARCHAR, singer_id VARCHAR)","SELECT T2.name, COUNT(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer_in_concert (singer_id VARCHAR); CREATE TABLE singer (name VARCHAR, singer_id VARCHAR) ### question:List singer names and number of concerts for each singer.","SELECT T2.name, COUNT(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id" List all singer names in concerts in year 2014.,"CREATE TABLE singer_in_concert (singer_id VARCHAR, concert_id VARCHAR); CREATE TABLE concert (concert_id VARCHAR, year VARCHAR); CREATE TABLE singer (name VARCHAR, singer_id VARCHAR)",SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer_in_concert (singer_id VARCHAR, concert_id VARCHAR); CREATE TABLE concert (concert_id VARCHAR, year VARCHAR); CREATE TABLE singer (name VARCHAR, singer_id VARCHAR) ### question:List all singer names in concerts in year 2014.",SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014 what is the name and nation of the singer who have a song having 'Hey' in its name?,"CREATE TABLE singer (name VARCHAR, country VARCHAR, song_name VARCHAR)","SELECT name, country FROM singer WHERE song_name LIKE '%Hey%'","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE singer (name VARCHAR, country VARCHAR, song_name VARCHAR) ### question:what is the name and nation of the singer who have a song having 'Hey' in its name?","SELECT name, country FROM singer WHERE song_name LIKE '%Hey%'" Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.,"CREATE TABLE stadium (name VARCHAR, location VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR, Year VARCHAR)","SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE stadium (name VARCHAR, location VARCHAR, stadium_id VARCHAR); CREATE TABLE concert (stadium_id VARCHAR, Year VARCHAR) ### question:Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.","SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015" Find the number of concerts happened in the stadium with the highest capacity .,"CREATE TABLE concert (stadium_id VARCHAR, capacity VARCHAR); CREATE TABLE stadium (stadium_id VARCHAR, capacity VARCHAR)",SELECT COUNT(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1),"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE concert (stadium_id VARCHAR, capacity VARCHAR); CREATE TABLE stadium (stadium_id VARCHAR, capacity VARCHAR) ### question:Find the number of concerts happened in the stadium with the highest capacity .",SELECT COUNT(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1) Find the number of pets whose weight is heavier than 10.,CREATE TABLE pets (weight INTEGER),SELECT COUNT(*) FROM pets WHERE weight > 10,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pets (weight INTEGER) ### question:Find the number of pets whose weight is heavier than 10.",SELECT COUNT(*) FROM pets WHERE weight > 10 Find the weight of the youngest dog.,"CREATE TABLE pets (weight VARCHAR, pet_age VARCHAR)",SELECT weight FROM pets ORDER BY pet_age LIMIT 1,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pets (weight VARCHAR, pet_age VARCHAR) ### question:Find the weight of the youngest dog.",SELECT weight FROM pets ORDER BY pet_age LIMIT 1 Find the maximum weight for each type of pet. List the maximum weight and pet type.,"CREATE TABLE pets (petType VARCHAR, weight INTEGER)","SELECT MAX(weight), petType FROM pets GROUP BY petType","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pets (petType VARCHAR, weight INTEGER) ### question:Find the maximum weight for each type of pet. List the maximum weight and pet type.","SELECT MAX(weight), petType FROM pets GROUP BY petType" Find number of pets owned by students who are older than 20.,"CREATE TABLE student (stuid VARCHAR, age INTEGER); CREATE TABLE has_pet (stuid VARCHAR)",SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR, age INTEGER); CREATE TABLE has_pet (stuid VARCHAR) ### question:Find number of pets owned by students who are older than 20.",SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20 Find the number of dog pets that are raised by female students (with sex F).,"CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR); CREATE TABLE student (stuid VARCHAR, sex VARCHAR)",SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR); CREATE TABLE student (stuid VARCHAR, sex VARCHAR) ### question:Find the number of dog pets that are raised by female students (with sex F).",SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog' Find the number of distinct type of pets.,CREATE TABLE pets (pettype VARCHAR),SELECT COUNT(DISTINCT pettype) FROM pets,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pets (pettype VARCHAR) ### question:Find the number of distinct type of pets.",SELECT COUNT(DISTINCT pettype) FROM pets Find the first name of students who have cat or dog pet.,"CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE student (Fname VARCHAR, stuid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR)",SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE student (Fname VARCHAR, stuid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR) ### question:Find the first name of students who have cat or dog pet.",SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog' Find the first name of students who have both cat and dog pets .,"CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR)",SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'cat' INTERSECT SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'dog',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR) ### question:Find the first name of students who have both cat and dog pets .",SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'cat' INTERSECT SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'dog' What are the students' first names who have both cats and dogs as pets?,"CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE student (Fname VARCHAR, stuid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR)",SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE student (Fname VARCHAR, stuid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR) ### question:What are the students' first names who have both cats and dogs as pets?",SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' Find the major and age of students who do not have a cat pet.,"CREATE TABLE student (stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR); CREATE TABLE student (major VARCHAR, age VARCHAR, stuid VARCHAR)","SELECT major, age FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE student (stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR); CREATE TABLE student (major VARCHAR, age VARCHAR, stuid VARCHAR) ### question:Find the major and age of students who do not have a cat pet.","SELECT major, age FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')" Find the id of students who do not have a cat pet.,"CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR); CREATE TABLE student (stuid VARCHAR)",SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat',"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR); CREATE TABLE student (stuid VARCHAR) ### question:Find the id of students who do not have a cat pet.",SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' Find the first name and age of students who have a dog but do not have a cat as a pet.,"CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE student (fname VARCHAR, age VARCHAR, stuid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR)","SELECT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND NOT T1.stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE student (fname VARCHAR, age VARCHAR, stuid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR) ### question:Find the first name and age of students who have a dog but do not have a cat as a pet.","SELECT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND NOT T1.stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')" Find the type and weight of the youngest pet.,"CREATE TABLE pets (pettype VARCHAR, weight VARCHAR, pet_age VARCHAR)","SELECT pettype, weight FROM pets ORDER BY pet_age LIMIT 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pets (pettype VARCHAR, weight VARCHAR, pet_age VARCHAR) ### question:Find the type and weight of the youngest pet.","SELECT pettype, weight FROM pets ORDER BY pet_age LIMIT 1" Find the id and weight of all pets whose age is older than 1.,"CREATE TABLE pets (petid VARCHAR, weight VARCHAR, pet_age INTEGER)","SELECT petid, weight FROM pets WHERE pet_age > 1","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pets (petid VARCHAR, weight VARCHAR, pet_age INTEGER) ### question:Find the id and weight of all pets whose age is older than 1.","SELECT petid, weight FROM pets WHERE pet_age > 1" Find the average and maximum age for each type of pet.,"CREATE TABLE pets (pettype VARCHAR, pet_age INTEGER)","SELECT AVG(pet_age), MAX(pet_age), pettype FROM pets GROUP BY pettype","Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pets (pettype VARCHAR, pet_age INTEGER) ### question:Find the average and maximum age for each type of pet.","SELECT AVG(pet_age), MAX(pet_age), pettype FROM pets GROUP BY pettype" ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:how many user are uses windows10 and signed in via application?",SELECT COUNT(*) FROM all_sign_ins WHERE device_os = 'Windows 10' AND signed_in_via = 'application'; ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:count how many time the user Viswanathan has signed in from 01-08-2023 14:35:06 to 04-08-2023 15:25:53 ",SELECT COUNT(*) FROM all_sign_ins WHERE user_display_name = 'Viswanathan' AND sign_in_time BETWEEN '01-08-2023 14:35:06' AND '04-08-2023 15:25:53'; ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:which country user uses this domain name 'test.onmicrosoft.com' more apart from China?","SELECT country, COUNT(*) as count FROM all_sign_ins WHERE domain_name = 'test.onmicrosoft.com' AND country != 'China' GROUP BY country ORDER BY count DESC;" ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:Display the name of the user who are all signed in using chrome whose MFA is not configured",SELECT user_display_name FROM all_sign_ins WHERE signed_in_browser = 'Chrome' AND mfa_authentication = 'not_configured' GROUP BY user_display_name; ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:Display the user name who uses both chrome and edge to login","SELECT user_display_name FROM all_sign_ins WHERE device_browser IN ('chrome', 'edge') GROUP BY user_display_name HAVING COUNT(DISTINCT device_browser) = 2;" ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:Display the user name whose signed in to the application Teams from Chennai is failed","SELECT user_display_name FROM all_sign_ins WHERE signed_in_application_name = 'Teams' AND sign_in_status = 'failure' AND country = 'Chennai'; " ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:Which browser and OS is used most of the people in country India?","SELECT device_browser, device_os FROM all_sign_ins WHERE country = 'India' GROUP BY device_browser, device_os ORDER BY COUNT(device_browser) DESC, COUNT(device_os) DESC;" ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:Display the domain name whose sign-in is failure with mfa configured",SELECT domain_name FROM all_sign_ins WHERE sign_in_status = 'failure' AND mfa_authentication = 'configured'; ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:what are the application that the user Viswa signed in with IP 122.165.56.80",SELECT signed_in_application_name FROM all_sign_ins WHERE signed_in_user = 'Viswa' AND ip_address = '122.165.56.80' ORDER BY signed_in_application_name; ,,,"Translate the question into SQL query by using the schema. ### schema:CREATE TABLE all_sign_ins (id SERIAL PRIMARY KEY, user_display_name VARCHAR(255), sign_in_time TIMESTAMP, signed_in_user VARCHAR(255), signed_in_application_name VARCHAR(255), mfa_authentication JSONB, country VARCHAR(255), state VARCHAR(255), city VARCHAR(255), device_os VARCHAR(255), device_browser VARCHAR(255), signed_in_via VARCHAR(255), domain_name VARCHAR(255), ip_address VARCHAR(45), tenant VARCHAR(255), sign_in_status VARCHAR(10)); ### question:How many signed in failed in the tenant MSFT who has mfa is configured and from India",SELECT COUNT(DISTINCT sign_in_status) FROM all_sign_ins WHERE tenant = 'MSFT' AND mfa_authentication = 'configured' AND country = 'India' AND sign_in_status = 'failure';