interaction_utterance
sequencelengths
0
6
interaction_query
sequencelengths
0
6
final_utterance
stringlengths
19
224
final_query
stringlengths
22
577
db_id
stringclasses
140 values
[ "What are the policies of each customer? Give the names and policy type codes.", "Of these, show only those with jurisdiction policies.", "How about either deputy policy or uniformed policy?", "Now show just the unique names for these." ]
[ "SELECT t2.customer_details, t1.policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id", "SELECT t2.customer_details, t1.policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = \"Jurisdiction\"", "SELECT t2.customer_details, t1.policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = \"Deputy\" OR t1.policy_type_code = \"Uniformed\"", "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = \"Deputy\" OR t1.policy_type_code = \"Uniformed\"" ]
Find the names of customers who either have an deputy policy or uniformed policy.
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" OR t1.policy_type_code = "Uniformed"
insurance_and_eClaims
[ "Who are the staff members?", "Customers?", "Who are both customers and staff?", "How about either of them?" ]
[ "SELECT staff_Details FROM staff", "SELECT customer_details FROM customers", "SELECT customer_details FROM customers INTERSECT SELECT staff_details FROM staff", "SELECT customer_details FROM customers UNION SELECT staff_details FROM staff" ]
Find the names of all the customers and staff members.
SELECT customer_details FROM customers UNION SELECT staff_details FROM staff
insurance_and_eClaims
[ "Who are the customers?", "Which customers have more than 1 policy?", "Who has the most?" ]
[ "SELECT customer_details FROM customers", "SELECT t2.customer_details FROM policies AS T1 JOIN customers as t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details HAVING count(*) > 1", "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1" ]
Find the name of the customer that has been involved in the most policies.
SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1
insurance_and_eClaims
[ "How many total passengers are in any airport with the word London in its name?", "How many International?", "How about Transit?", "How about Domestic?" ]
[ "SELECT sum(Total_Passengers) FROM airport WHERE Airport_Name LIKE \"%London%\"", "SELECT sum(International_Passengers) FROM airport WHERE Airport_Name LIKE \"%London%\"", "SELECT sum(Transit_Passengers) FROM airport WHERE Airport_Name LIKE \"%London%\"", "SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE \"%London%\"" ]
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%"
aircraft
[ "How many transit passengers does each airport have?", "What is the average number?", "How about the maximum?", "Please, show the minimum as well." ]
[ "SELECT Airport_ID, Transit_Passengers FROM airport", "SELECT avg(Transit_Passengers) FROM airport", "SELECT max(Transit_Passengers) FROM airport", "SELECT max(Transit_Passengers), min(Transit_Passengers) FROM airport" ]
What are the maximum and minimum number of transit passengers of all airports.
SELECT max(Transit_Passengers), min(Transit_Passengers) FROM airport
aircraft
[ "Show all the pilot names and ages?", "What are the names that are older younger than 50?", "How about 30 or younger?", "Sort them in reverse alphabetical order?" ]
[ "SELECT Name, Age FROM pilot", "SELECT Name FROM pilot WHERE Age <= 50", "SELECT Name FROM pilot WHERE Age <= 30", "SELECT Name FROM pilot WHERE Age <= 50 ORDER BY Name DESC" ]
List names of all pilot aged 30 or younger in descending alphabetical order.
SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC
aircraft
[ "Is there an airport with the name \"London Gatwick\"?", "How many aircrafts movements happen at this airport?", "Also, how many aircrafts is the airport associated with?", "What is its name?" ]
[ "SELECT * FROM airport WHERE Airport_Name = \"London Gatwick\"", "SELECT aircraft_movements FROM airport WHERE Airport_Name = \"London Gatwick\"", "SELECT count(*) 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\"", "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 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"
aircraft
[ "Show me a list of all the different airports!", "What ones have more than 10000000 total passengers?", "Show all the aircrafts associated with each of these airports.", "Show only the names and descriptions." ]
[ "Select * FROM airport", "Select * FROM airport where Total_Passengers > 10000000", "SELECT * 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", "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" ]
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
aircraft
[ "Tell me more information about the aircraft called \"Robinson R-22\"!", "How many airports use this aircraft?", "What are their names, and total passengers?", "What is the average total number passengers?" ]
[ "SELECT * FROM Aircraft where Aircraft = \"Robinson R-22\"", "SELECT * 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\"", "SELECT T3.Airport_Name, 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\"", "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\"" ]
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"
aircraft
[ "What are the names of all the winning pilots?", "What are the names of the aircrafts that they used?", "What one of the aircrafts won the most?" ]
[ "SELECT T1.Name FROM pilot AS T1 JOIN MATCH AS T2 ON T1.Pilot_ID = T2.Winning_Pilot", "SELECT T1.Name, T3.Aircraft FROM pilot AS T1 JOIN MATCH AS T2 ON T1.Pilot_ID = T2.Winning_Pilot JOIN aircraft as T3 ON T2.Winning_Aircraft = T3.Aircraft_ID", "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 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
aircraft
[ "How many aircrafts are there?", "What are their names?", "Which ones have won?", "How any times have each won?" ]
[ "SELECT count(*) FROM aircraft", "SELECT Aircraft FROM aircraft", "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft", "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 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
aircraft
[ "How many matches have taken place?", "How many of them have been won by the same aircraft?", "Which aircrafts?" ]
[ "SELECT count(*) FROM MATCH", "SELECT count(*) FROM (SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft having COUNT(*) > 1)", "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 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
aircraft
[ "What are all the aircraft names?", "How many matches have each won?", "How about those that have not won any matches?" ]
[ "SELECT Aircraft FROM Aircraft", "SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft", "SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)" ]
List the names of aircrafts and that did not win any match.
SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)
aircraft
[ "What airports have \"London\" in its name?", "What aircraft names are associated with these airports?", "Which ones are associated with an airport with \"London Heathrow\"", "Which of these aircrafts are also associated with an airport named \"London Gatwick\"" ]
[ "SELECT Airport_Name FROM Airport WHERE Airport_Name LIKE \"%London%\"", "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 LIKE \"%London%\"", "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\"", "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 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"
aircraft
[ "What are the number of international passengers per airport?", "What are all the airport details with the minimum?", "With the maximum?" ]
[ "SELECT airport_id, international_passengers FROM airport", "SELECT * FROM airport ORDER BY International_Passengers ASC LIMIT 1", "SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1" ]
Show all information on the airport that has the largest number of international passengers.
SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1
aircraft
[ "How many pilots are under 30?", "What are their names and ages?", "How many times have they each won?", "Show me the name and age of the one that has won the most times." ]
[ "Select count(*) FROM pilot where age < 30", "Select name, age FROM pilot where age < 30", "SELECT t1.name, t1.age, count(*) FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot GROUP BY t2.winning_pilot", "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" ]
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
aircraft
[ "Show all the information for all the pilots!", "Show me only the winning-pilots!", "What is the name and age of the oldest one?", "How about the youngest one?" ]
[ "Select * FROM pilot", "SELECT * FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.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 DESC LIMIT 1", "SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age ASC LIMIT 1" ]
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
aircraft
[ "Show all account information.", "Show the ids for them.", "Also show the account details." ]
[ "SELECT * FROM Accounts", "SELECT account_id FROM Accounts", "SELECT account_id , account_details FROM Accounts" ]
Show all account ids and account details.
SELECT account_id , account_details FROM Accounts
cre_Docs_and_Epenses
[ "Show the info for all statements.", "How many are there?" ]
[ "SELECT * FROM Statements", "SELECT count(*) FROM Statements" ]
How many statements do we have?
SELECT count(*) FROM Statements
cre_Docs_and_Epenses
[ "Show info for all statements.", "Show their ids and statement details." ]
[ "SELECT * FROM Statements", "SELECT STATEMENT_ID , statement_details FROM Statements" ]
List all statement ids and statement details.
SELECT STATEMENT_ID , statement_details FROM Statements
cre_Docs_and_Epenses
[ "Show the details of each account.", "Also show the statement ids and statement details for them." ]
[ "SELECT account_details from 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 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
cre_Docs_and_Epenses
[ "Show the statement ids from all accounts.", "For each of them, also show the number of accounts." ]
[ "SELECT STATEMENT_ID FROM Accounts", "SELECT STATEMENT_ID , count(*) FROM Accounts GROUP BY STATEMENT_ID" ]
Show all statement id and the number of accounts for each statement.
SELECT STATEMENT_ID , count(*) FROM Accounts GROUP BY STATEMENT_ID
cre_Docs_and_Epenses
[ "Show the ids and details for statments.", "For each of them, also show the number of accounts.", "Sort the results in the descending order of the number of accounts.", "Show the id and details for the statment with the most accounts." ]
[ "SELECT statement_id , statement_details FROM Statements", "SELECT T1.statement_id , T2.statement_details, count(*) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id", "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", "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 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
cre_Docs_and_Epenses
[ "Show information for all documents.", "How many are there?" ]
[ "SELECT * FROM Documents", "SELECT count(*) FROM Documents" ]
Show the number of documents.
SELECT count(*) FROM Documents
cre_Docs_and_Epenses
[ "List the type codes, names, and descriptions for all documents.", "How about for the document named 'Noel CV'.", "Also include results for the document named 'King Book'." ]
[ "SELECT document_type_code , document_name , document_description FROM Documents", "SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'Noel CV'", "SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'" ]
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'
cre_Docs_and_Epenses
[ "Show all information for documents.", "Show just the ids.", "Also show their names." ]
[ "SELECT * FROM Documents", "SELECT document_id FROM Documents", "SELECT document_id , document_name FROM Documents" ]
Show the ids and names of all documents.
SELECT document_id , document_name FROM Documents
cre_Docs_and_Epenses
[ "Show all document names.", "What are the names for the documents with type code BK?", "Also find their ids." ]
[ "SELECT document_name FROM Documents", "SELECT document_name FROM Documents WHERE document_type_code = \"BK\"", "SELECT document_name , document_id FROM Documents WHERE document_type_code = \"BK\"" ]
Find names and ids of all documents with document type code BK.
SELECT document_name , document_id FROM Documents WHERE document_type_code = "BK"
cre_Docs_and_Epenses
[ "Show the project id for documents.", "Show the ids only for the documents with type code BK.", "For each project id, show the number of such documents." ]
[ "SELECT project_id FROM Documents", "SELECT project_id FROM Documents WHERE document_type_code = \"BK\"", "SELECT count(*) , project_id FROM Documents WHERE document_type_code = \"BK\" GROUP BY project_id" ]
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
cre_Docs_and_Epenses
[ "Show the name and date for all documents.", "For those documents, also show their project details.", "What are the names and dates for documents with 'Graph Database project' as their details?" ]
[ "SELECT document_name , document_date FROM Documents", "SELECT document_name , document_date, T2.project_details FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id", "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 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'
cre_Docs_and_Epenses
[ "Show the project id for the documents.", "For each of id, count the number of documents." ]
[ "SELECT project_id FROM Documents", "SELECT project_id , count(*) FROM Documents GROUP BY project_id" ]
Show project ids and the number of documents in each project.
SELECT project_id , count(*) FROM Documents GROUP BY project_id
cre_Docs_and_Epenses
[ "Show the project id for all documents.", "For each of them, count the number of documents.", "Sort the ids by these counts.", "Which project id has the fewest?" ]
[ "SELECT project_id FROM Documents", "SELECT project_id, count(*) FROM Documents GROUP BY project_id", "SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*)", "SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1" ]
What is the id of the project with least number of documents?
SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1
cre_Docs_and_Epenses
[ "Show the project ids for documents.", "For each of them, also show the number of documents.", "Which of them have at least 2 documents?" ]
[ "SELECT project_id FROM Documents", "SELECT project_id, count(*) FROM Documents GROUP BY project_id", "SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2" ]
Show the ids for projects with at least 2 documents.
SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2
cre_Docs_and_Epenses
[ "Show the type code for all documents.", "For each of these codes, also show the number of documents." ]
[ "SELECT document_type_code FROM Documents", "SELECT document_type_code , count(*) FROM Documents GROUP BY document_type_code" ]
List document type codes and the number of documents in each code.
SELECT document_type_code , count(*) FROM Documents GROUP BY document_type_code
cre_Docs_and_Epenses
[ "Show the type codes for all documents.", "For each of the codes, count the number of documents.", "Which code has the most documents?" ]
[ "SELECT document_type_code FROM Documents", "SELECT document_type_code, count(*) FROM Documents GROUP BY document_type_code", "SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1" ]
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
cre_Docs_and_Epenses
[ "Show the type code for all documents.", "For each of the codes, also count the number of documents.", "Which codes have fewer than 3 documents?" ]
[ "SELECT document_type_code FROM Documents", "SELECT document_type_code, count(*) FROM Documents GROUP BY document_type_code", "SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*) < 3" ]
Show the document type code with fewer than 3 documents.
SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*) < 3
cre_Docs_and_Epenses
[ "Show the details for all statements.", "Also show their corresponding document names.", "Only show the results for the statement with detail 'Private Project'." ]
[ "SELECT statement_details from Statements", "SELECT T1.statement_details , T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id", "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 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'
cre_Docs_and_Epenses
[ "Show the type codes for all documents.", "Also show the document type names and descriptions." ]
[ "SELECT document_type_code FROM Ref_document_types", "SELECT document_type_code , document_type_name , document_type_description FROM Ref_document_types" ]
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
cre_Docs_and_Epenses
[ "Show the descriptions for all document types.", "Only show the result for the document type \"Film\"." ]
[ "SELECT document_type_description FROM Ref_document_types", "SELECT document_type_description FROM Ref_document_types WHERE document_type_name = \"Film\"" ]
What is the document type description for document type named Film?
SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film"
cre_Docs_and_Epenses
[ "What are the creation dates for all documents?", "Also show their document type names and descriptions." ]
[ "SELECT Document_date FROM 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" ]
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
cre_Docs_and_Epenses
[ "Show the information for all projects.", "How many are there?" ]
[ "SELECT * FROM Projects", "SELECT count(*) FROM Projects" ]
Show the number of projects.
SELECT count(*) FROM Projects
cre_Docs_and_Epenses
[ "Show the id for all projects.", "Also show their details." ]
[ "SELECT project_id FROM Projects", "SELECT project_id , project_details FROM Projects" ]
List ids and details for all projects.
SELECT project_id , project_details FROM Projects
cre_Docs_and_Epenses
[ "Show the ids and details for all projects.", "For each of them, also show the number of documents.", "Which of them have at least two documents?" ]
[ "SELECT project_id , project_details FROM Projects", "SELECT T1.project_id , T1.project_details, count(*) FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id", "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 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
cre_Docs_and_Epenses
[ "What are all the details from projects?", "Also show the document names corresponding to the projects.", "Show those details only for projects with a document named \"King Book\"." ]
[ "SELECT project_details FROM Projects", "SELECT T1.project_details, T2.document_name FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id", "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\"" ]
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"
cre_Docs_and_Epenses
[ "Show the information for budget codes.", "How many of them do we have?" ]
[ "SELECT * FROM Ref_budget_codes", "SELECT count(*) FROM Ref_budget_codes" ]
How many budget types do we have?
SELECT count(*) FROM Ref_budget_codes
cre_Docs_and_Epenses
[ "List all budget type codes.", "Add their descriptions." ]
[ "SELECT budget_type_code FROM Ref_budget_codes", "SELECT budget_type_code , budget_type_description FROM Ref_budget_codes" ]
List all budget type codes and descriptions.
SELECT budget_type_code , budget_type_description FROM Ref_budget_codes
cre_Docs_and_Epenses
[ "What are the descriptions for the budget codes?", "How about the description for the budget with code ORG?" ]
[ "SELECT budget_type_description FROM Ref_budget_codes", "SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = \"ORG\"" ]
What is the description for the budget type with code ORG?
SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG"
cre_Docs_and_Epenses
[ "Show information for all documents with expenses.", "How many are there?" ]
[ "SELECT * FROM Documents_with_expenses", "SELECT count(*) FROM Documents_with_expenses" ]
How many documents have expenses?
SELECT count(*) FROM Documents_with_expenses
cre_Docs_and_Epenses
[ "Show the ids for documents with expenses.", "Also show their budget type code.", "What is the id for the documents with the budget type code 'SF'?" ]
[ "SELECT document_id FROM Documents_with_expenses", "SELECT document_id, budget_type_code FROM Documents_with_expenses", "SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'" ]
What are the document ids for the budget type code 'SF'?
SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'
cre_Docs_and_Epenses
[ "Show the budget type code and description for all budget types.", "Also show the corresponding document ids for them." ]
[ "SELECT budget_type_code , budget_type_description from Ref_budget_codes", "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 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
cre_Docs_and_Epenses
[ "Show ids for all documents.", "Also show their budget type descriptions.", "Show ids for those documents with budget types described as 'Government'." ]
[ "SELECT document_id FROM Documents_with_expenses", "SELECT T1.document_id , T2.budget_type_Description FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code", "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 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"
cre_Docs_and_Epenses
[ "Show all the budget type codes for documents with expenses.", "For each code, show the number of corresponding documents." ]
[ "SELECT budget_type_code from Documents_with_expenses", "SELECT budget_type_code , count(*) FROM Documents_with_expenses GROUP BY budget_type_code" ]
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
cre_Docs_and_Epenses
[ "Show all the budget type codes for documents with expenses.", "For each code, show the number of documents.", "Sort the codes in descending order of the count.", "Which has the most?" ]
[ "SELECT budget_type_code from Documents_with_expenses", "SELECT budget_type_code , count(*) FROM Documents_with_expenses GROUP BY budget_type_code", "SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC", "SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1" ]
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
cre_Docs_and_Epenses
[ "Show document ids with an expense budget.", "Show all document ids.", "Among them, which documents don't have expense budgets?" ]
[ "SELECT document_id FROM Documents_with_expenses", "SELECT document_id FROM Documents", "SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses" ]
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
cre_Docs_and_Epenses
[ "Show all document ids with an expense budget.", "Show ids for all documents in type CV.", "Which of them don't have expense budgets?" ]
[ "SELECT document_id FROM Documents_with_expenses", "SELECT document_id FROM Documents WHERE document_type_code = \"CV\"", "SELECT document_id FROM Documents WHERE document_type_code = \"CV\" EXCEPT SELECT document_id FROM Documents_with_expenses" ]
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
cre_Docs_and_Epenses
[ "Show ids for all documents.", "How about those with the letter 's' in the name?", "Which of them have any expense budgets." ]
[ "SELECT document_id FROM Documents", "SELECT document_id FROM Documents WHERE document_name LIKE '%s%'", "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%'" ]
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%'
cre_Docs_and_Epenses
[ "Show the ids of documents with expenses.", "Show ids for those which don't.", "How many of such documents are there?" ]
[ "SELECT document_id FROM Documents_with_expenses", "SELECT document_id FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )", "SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )" ]
How many documents do not have any expense?
SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )
cre_Docs_and_Epenses
[ "What are the dates of all documents?", "What about those with 'GV' type expenses?", "What about those with 'SF' type expenses?", "Show the dates for the documents with both types." ]
[ "SELECT document_date FROM Documents", "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'", "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'", "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 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'
cre_Docs_and_Epenses
[ "show the name and revenue of all companies.", "what is their average revenue?", "please return maximum and total revenues too." ]
[ "SELECT name, revenue FROM manufacturers", "SELECT avg(revenue) FROM manufacturers", "SELECT avg(revenue) , max(revenue) , sum(revenue) FROM manufacturers" ]
What are the average, maximum and total revenues of all companies?
SELECT avg(revenue) , max(revenue) , sum(revenue) FROM manufacturers
manufactory_1
[ "find the names of manufactures that are based in Tokyo.", "how about in Beijing?", "what is the total number of companies based in these two places?" ]
[ "SELECT name FROM manufacturers WHERE headquarter = 'Tokyo'", "SELECT name FROM manufacturers WHERE headquarter = 'Beijing'", "SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'" ]
Find the number of manufactures that are based in Tokyo or Beijing.
SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'
manufactory_1
[ "list the names of all manufacturers.", "show the names of manufacturers that begin with the letter 'S'.", "who are their founders?" ]
[ "SELECT name FROM manufacturers", "SELECT name FROM manufacturers WHERE name LIKE 'S%'", "SELECT founder FROM manufacturers WHERE name LIKE 'S%'" ]
Find the founder of the company whose name begins with the letter 'S'.
SELECT founder FROM manufacturers WHERE name LIKE 'S%'
manufactory_1
[ "find the names of companies whose main office is in Tokyo.", "What is the total revenue of these companies?", "add the revenue of Taiwan companies too." ]
[ "SELECT name FROM manufacturers WHERE Headquarter = 'Tokyo'", "SELECT sum(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo'", "SELECT sum(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'" ]
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'
manufactory_1
[ "list the names of all of the products.", "which products are produced by the company Creative Labs?", "among them, find the products that Sony also produces." ]
[ "SELECT name FROM products", "SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs'", "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 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'
manufactory_1
[ "find the name of the company that earned the least revenue.", "show its headquarter location and founder too.", "what is the info for the company with the highest revenue?" ]
[ "SELECT name FROM manufacturers ORDER BY revenue LIMIT 1", "SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue LIMIT 1", "SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1" ]
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
manufactory_1
[ "how many companies are there?", "What is their average revenue?", "Find the names of companies whose revenue is greater than the average." ]
[ "SELECT count(*) FROM manufacturers", "SELECT avg(revenue) FROM manufacturers", "SELECT name FROM manufacturers WHERE revenue > (SELECT avg(revenue) FROM manufacturers)" ]
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)
manufactory_1
[ "how many companies are based in Austin?", "show their revenues", "Find the names of companies whose revenue is smaller than all of those revenues." ]
[ "SELECT count(*) FROM manufacturers WHERE headquarter = 'Austin'", "SELECT revenue FROM manufacturers WHERE headquarter = 'Austin'", "SELECT name FROM manufacturers WHERE revenue < (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin')" ]
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')
manufactory_1
[ "what are the names of the companies based in Austin?", "find the names of companies whose revenue is larger than the largest revenue of those companies.", "return the total revenue of the resulting companies." ]
[ "SELECT name FROM manufacturers WHERE headquarter = 'Austin'", "SELECT name FROM manufacturers WHERE revenue > (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin')", "SELECT sum(revenue) 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.
SELECT sum(revenue) FROM manufacturers WHERE revenue > (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin')
manufactory_1
[ "find the number of all products from each manufacture. list each company's name.", "show the average price of each company’s products." ]
[ "SELECT count(*), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.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 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
manufactory_1
[ "how many different headquarter cities are there?", "Find the number of different products that are from companies at each headquarter." ]
[ "SELECT count(distinct headquarter) FROM manufacturers", "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 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
manufactory_1
[ "find the name of all products.", "which of them does Sony make.", "Find the number of products that Sony does not make." ]
[ "SELECT name FROM products", "SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'", "SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony')" ]
Find number of products which Sony does not make.
SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony')
manufactory_1
[ "Find the names of companies that produce DVD drives.", "how about the companies that do not make them?" ]
[ "SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = '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 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'
manufactory_1
[ "how many products are in the record?", "find the number for each manufacturer, showing the name of each company." ]
[ "SELECT count(*) FROM products", "SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name" ]
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
manufactory_1
[ "Select the name of all products.", "which one is the most expensive?", "also show its price.", "how about the products with a price larger than or equal to 180?", "sort the result by price (in descending order).", "then order by name (in ascending order)." ]
[ "SELECT name FROM products", "SELECT name FROM products ORDER BY price DESC limit 1", "SELECT name, price FROM products ORDER BY price DESC limit 1", "SELECT name, price FROM products WHERE price >= 180", "SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC", "SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC , name ASC" ]
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 ASC
manufactory_1
[ "Show the names of all manufacturers.", "how many products do each of them produce?", "what are their average prices?" ]
[ "SELECT name FROM Manufacturers", "SELECT count(*), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.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 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
manufactory_1
[ "find the name of products with a price higher than or equal to $150.", "what are the names of manufacturers that produce these products?", "Select the names of manufacturer whose products have an average price higher than or equal to $150." ]
[ "SELECT name FROM products WHERE price >= 150", "SELECT DISTINCT T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T1.price >= 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 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
manufactory_1
[ "what is the name of the most expensive product?", "how about the cheapest product?", "show its price as well." ]
[ "SELECT name FROM Products ORDER BY price DESC LIMIT 1", "SELECT name FROM Products ORDER BY price ASC LIMIT 1", "SELECT name , price FROM Products ORDER BY price ASC LIMIT 1" ]
Select the name and price of the cheapest product.
SELECT name , price FROM Products ORDER BY price ASC LIMIT 1
manufactory_1
[ "show all different countries that have airports in the record.", "could you please list the names of airports in Cuba?", "also list Argentina's airports." ]
[ "SELECT distinct country FROM airports", "SELECT name FROM airports WHERE country = 'Cuba'", "SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'" ]
Find the name of the airports located in Cuba or Argentina.
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
flight_4
[ "what are all of the airline names?", "which of them start with 'Orbit'?", "how many are there?", "Find the country of these airlines." ]
[ "SELECT distinct name FROM airlines", "SELECT distinct name FROM airlines WHERE name LIKE 'Orbit%'", "SELECT count(*) FROM airlines WHERE name LIKE 'Orbit%'", "SELECT DISTINCT country FROM airlines WHERE name LIKE 'Orbit%'" ]
Find the country of the airlines whose name starts with 'Orbit'.
SELECT country FROM airlines WHERE name LIKE 'Orbit%'
flight_4
[ "how many airports are there?", "which airport has the lowest elevation?", "how about the one with the highest elevation?", "which country is it located in?" ]
[ "SELECT count(*) FROM airports", "SELECT * FROM airports ORDER BY elevation LIMIT 1", "SELECT * FROM airports ORDER BY elevation DESC LIMIT 1", "SELECT country FROM airports ORDER BY elevation DESC LIMIT 1" ]
Which country is the airport that has the highest altitude located in?
SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
flight_4
[ "please show all airport names.", "what is the total number of airports?", "among them, how many contain the word 'International' in their name?" ]
[ "SELECT name FROM airports", "SELECT count(*) FROM airports", "SELECT count(*) FROM airports WHERE name LIKE '%International%'" ]
Find the number of airports whose name contain the word 'International'.
SELECT count(*) FROM airports WHERE name LIKE '%International%'
flight_4
[ "what is the icao code for American Airlines?", "which routes are operated by American Airlines?", "please count the number of routes." ]
[ "SELECT icao FROM airlines WHERE name = 'American Airlines'", "SELECT * FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = '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 operated by American Airlines.
SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
flight_4
[ "how many airports does each country have?", "how many does Canada have?", "what is the total number of routes that end there?" ]
[ "SELECT count(*), country FROM airports GROUP BY country", "SELECT count(*) FROM airports WHERE country = 'Canada'", "SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'" ]
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'
flight_4
[ "what is the lowest elevation of all airports?", "what is the name of that airport?", "also show the city and country where it is located." ]
[ "SELECT min(elevation) FROM airports", "SELECT name FROM airports ORDER BY elevation LIMIT 1", "SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1" ]
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
flight_4
[ "what is the average elevation of all airports?", "order the airport info by latitude from highest to lowest.", "just show name, city, and country of the highest one." ]
[ "SELECT avg(elevation) FROM airports", "SELECT * FROM airports ORDER BY elevation DESC", "SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1" ]
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
flight_4
[ "how many routes are there?", "find the number of routes for each destination.", "what is the name and city of the destination airport that has the most routes ending there?" ]
[ "SELECT count(*) FROM routes", "SELECT count(*), dst_apid FROM routes GROUP BY dst_apid", "SELECT T1.name, T1.city 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 name and city of the airport which is the destination of the most number of routes.
SELECT T1.name, T1.city 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
flight_4
[ "Provide the names of all airlines.", "Find the number of routes provided by each airline. Show airline name.", "which airline operates the most routes?", "what are the top 10 airlines?" ]
[ "SELECT name FROM airlines", "SELECT count(*), T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name", "SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 1", "SELECT T1.name 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 names of the top 10 airlines that operate the most number of routes.
SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10
flight_4
[ "Show the name and city of all airports.", "Show the number of flight routes for each of them as a source airport.", "which of them has the most routes?" ]
[ "SELECT name, city FROM airports", "SELECT T1.name, T1.city, count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid", "SELECT T1.name, T1.city 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 name and city of the airport which is the source for the most number of flight routes.
SELECT T1.name, T1.city 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
flight_4
[ "how many routes does American Airlines have?", "How many destinations do these routes go to?" ]
[ "SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = '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'" ]
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'
flight_4
[ "how many countries have airlines?", "how many airlines does each country have?", "show the one that has the most." ]
[ "SELECT count(distinct country) FROM airlines", "SELECT count(*), country FROM airlines GROUP BY country", "SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1" ]
Which countries has the most number of airlines?
SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1
flight_4
[ "what are the different active codes?", "show the name of airlines whose active status is 'Y'.", "Which country has the largest number of these airlines?" ]
[ "SELECT distinct active FROM airlines", "SELECT name FROM airlines WHERE active = 'Y'", "SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1" ]
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
flight_4
[ "List all countries and the number of airlines for each one.", "list them in ascending order of number of airlines.", "list in descending order." ]
[ "SELECT country , count(*) FROM airlines GROUP BY country", "SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*)", "SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC" ]
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
flight_4
[ "how many airports are in the record?", "how many airports are in each country?", "order them by number of airports in decreasing order." ]
[ "SELECT count(*) FROM airports", "SELECT count(*), country FROM airports GROUP BY country", "SELECT count(*), country FROM airports GROUP BY country ORDER BY count(*) DESC" ]
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
flight_4
[ "how many airports does the US has?", "what is the number of airports in each city in the US?", "Order the cities by decreasing number of airports." ]
[ "SELECT count(*) FROM airports WHERE country = 'United States'", "SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city", "SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC" ]
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
flight_4
[ "show all cities that have an airport.", "which of them are in the United States?", "just show cities that have more than 2 airports.", "how about more than 3?" ]
[ "SELECT city FROM airports", "SELECT city FROM airports WHERE country = 'United States'", "SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 2", "SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3" ]
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
flight_4
[ "which cities have more than 3 airports?", "how many are there?" ]
[ "SELECT city FROM airports GROUP BY city HAVING count(*) > 3", "SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3)" ]
How many cities are there that have more than 3 airports?
SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3)
flight_4
[ "list all cities.", "how many airports does each city have?", "just show cities that have more than one airport.", "include the number of airports per city." ]
[ "SELECT city FROM airports", "SELECT city , count(*) FROM airports GROUP BY city", "SELECT city FROM airports GROUP BY city HAVING count(*) > 1", "SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1" ]
List the cities which have more than one airport and number of airports.
SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1
flight_4
[ "how many cities have more than 2 airports?", "what are these cities?", "sort the results by the number of airports." ]
[ "SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 2)", "SELECT city FROM airports GROUP BY city HAVING count(*) > 2", "SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*)" ]
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(*)
flight_4
[ "list the names of all airports.", "also list the number of routes that list them as the source airport." ]
[ "SELECT name FROM airports", "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 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
flight_4
[ "how many routes are there?", "what are their source airports? List airport names.", "For each of those airports, how many routes does it have?", "order the result by decreasing number of routes" ]
[ "SELECT count(*) FROM routes", "SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid", "SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name", "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 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
flight_4
[ "which cities have more than one airport?", "ok, which of them have exactly two?" ]
[ "SELECT city FROM airports GROUP BY city HAVING count(*) > 1", "SELECT city FROM airports GROUP BY city HAVING count(*) = 2" ]
Find the cities which have exactly two airports.
SELECT city FROM airports GROUP BY city HAVING count(*) = 2
flight_4
[ "how many routes are there?", "please list the number of routes for each country and airline." ]
[ "SELECT count(*) FROM routes", "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" ]
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
flight_4