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 |
---|---|---|---|---|
[
"Tell me the delegates of county Howard.",
"How about that of the county Colony?",
"just show me the county which has the most delegates."
] | [
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.County_name = \"Howard\"",
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.County_name = \"Colony\"",
"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 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 | election |
[
"Tell me who is the governor of the liberal party.",
"Okay, tell me how many times he has been governor.",
"Which governor has been governor the most times?"
] | [
"SELECT Governor FROM party WHERE Party = \"Liberal\"",
"SELECT COUNT(*) FROM party WHERE Governor = \"Eliot Spitzer\"",
"SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1"
] | Show the people that have been governor the most times. | SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1 | election |
[
"Tell me the comptrollers of the Independence party.",
"Okay, how about that of the Liberal party?",
"Which ones have been comptroller the most times? Show also the corresponding number of times."
] | [
"SELECT Comptroller FROM party WHERE Party = \"Independence\"",
"SELECT Comptroller FROM party WHERE Party = \"Liberal\"",
"SELECT Comptroller , COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1"
] | 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 | election |
[
"Tell me the information of all the parties.",
"which parties have delegates in the election?",
"Which ones do not?"
] | [
"SELECT * FROM party",
"SELECT Party FROM party WHERE Party_ID IN (SELECT Party FROM election)",
"SELECT Party FROM party WHERE Party_ID NOT IN (SELECT Party FROM election)"
] | What are the names of parties that do not have delegates in election? | SELECT Party FROM party WHERE Party_ID NOT IN (SELECT Party FROM election) | election |
[
"tell me which parties have delegates on the \"Appropriations\" committee?",
"So how about the ones with delegates on the \"Economic Matters\" committee?",
"Okay. I want to know which ones have delegates on both."
] | [
"SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = \"Appropriations\"",
"SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = \"Economic Matters\"",
"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\""
] | What are the names of parties that have both delegates on "Appropriations" committee and "Economic Matters" committee | 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" | election |
[
"List the names of all different customers who have an loan.",
"For each customer, what is their total amount of loans?",
"sort the result by the total amount, and no need to show the total amount."
] | [
"SELECT DISTINCT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id",
"SELECT T1.cust_name, sum(T2.amount) FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name",
"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)"
] | List the name of all different customers who have an 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) | loan_1 |
[
"what are the names of the customers?",
"just show customers who have the letter ‘a’ in their name.",
"list their account balances too."
] | [
"SELECT cust_name FROM customer",
"SELECT cust_name FROM customer WHERE cust_name LIKE '%a%'",
"SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%'"
] | 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%' | loan_1 |
[
"which states are the customers from?",
"find the names of customers from Utah or Texas.",
"what is their total account balance?"
] | [
"SELECT distinct state FROM customer",
"SELECT cust_name FROM customer WHERE state = 'Utah' OR state = 'Texas'",
"SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'"
] | Find the total account balance of each customer from Utah or Texas. | SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' | loan_1 |
[
"find the names of customers who have a saving account.",
"how about those who have a checking account?",
"which of them have both kinds of accounts?"
] | [
"SELECT cust_name FROM customer WHERE acc_type = 'saving'",
"SELECT cust_name FROM customer WHERE acc_type = 'checking'",
"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 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' | loan_1 |
[
"how many customers have a saving account?",
"what are their names?",
"who are those who do not have a savings account?"
] | [
"SELECT count(*) FROM customer WHERE acc_type = 'saving'",
"SELECT cust_name FROM customer WHERE acc_type = 'saving'",
"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 saving account. | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' | loan_1 |
[
"Find the names of customers who have a mortgage loan.",
"who are those who do not have a mortgage?"
] | [
"SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = '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 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' | loan_1 |
[
"find the names of customers who have a loan.",
"which of them have a mortgage loan?",
"among them, who has an Auto loan as well?"
] | [
"SELECT DISTINCT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id",
"SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages'",
"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 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' | loan_1 |
[
"what is the average credit score of all customers?",
"list customers whose credit score is below the average.",
"just list their names."
] | [
"SELECT avg(credit_score) FROM customer",
"SELECT * FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer)",
"SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer)"
] | 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) | loan_1 |
[
"show the name and number of customers for each bank branch.",
"order the result by the number of customers in descending order.",
"Find the branch name of the bank that has the most customers."
] | [
"SELECT bname, no_of_customers FROM bank",
"SELECT bname, no_of_customers FROM bank ORDER BY no_of_customers DESC",
"SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1"
] | 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 | loan_1 |
[
"what are the names of all customers?",
"which one has the lowest credit score?"
] | [
"SELECT cust_name FROM customer",
"SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1"
] | Find the name of customer who has the lowest credit score. | SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 | loan_1 |
[
"what is the name of the customer with the lowest credit score?",
"how about the one who has the highest credit score?",
"show their account types and balances as well."
] | [
"SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1",
"SELECT cust_name FROM customer ORDER BY credit_score DESC LIMIT 1",
"SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1"
] | 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 | loan_1 |
[
"what is the average amount of all loans?",
"how about the total amount?",
"Find the names of customer who have loans.",
"who has the largest amount of loans?"
] | [
"SELECT avg(amount) FROM loan",
"SELECT sum(amount) FROM loan",
"SELECT DISTINCT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id",
"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 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 | loan_1 |
[
"show all different states where banks are located.",
"which state has the most bank customers?"
] | [
"SELECT distinct state FROM bank",
"SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1"
] | 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 | loan_1 |
[
"what are the names of customers with a credit score lower than 50?",
"what is their average account balance?",
"find their average account balance for each different account type."
] | [
"SELECT cust_name FROM customer WHERE credit_score < 50",
"SELECT avg(acc_bal) FROM customer WHERE credit_score < 50",
"SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type"
] | 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 | loan_1 |
[
"what states are the customers from?",
"For each state, how many customers have a credit score above 100?",
"find their total account balances."
] | [
"SELECT distinct state FROM customer",
"SELECT count(*), state FROM customer WHERE credit_score > 100 GROUP BY state",
"SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state"
] | 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 | loan_1 |
[
"how many bank branches are not in the state of New York?",
"what is the total number of bank branches?",
"how many loans are offered by each branch?",
"what is the total amount of loans offered by each of them?"
] | [
"SELECT count(*) FROM bank WHERE state != \"New York\"",
"SELECT count(*) FROM bank",
"SELECT count(*), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname",
"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 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 | loan_1 |
[
"how many loans are there?",
"what is the total amount of loans?",
"Find the names of customers who have at least one loan.",
"which of them have more than one loan?"
] | [
"SELECT count(*) FROM loan",
"SELECT sum(amount) FROM loan",
"SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id",
"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 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 | loan_1 |
[
"Find the names of customers who have at least one loan.",
"which of them have loans with a total amount of more than 5000?",
"also show their account balances."
] | [
"SELECT DISTINCT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id",
"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 sum(T2.amount) > 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 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 | loan_1 |
[
"what is the total amount of all loans?",
"find the names of bank branches that provided these loans.",
"which one offered the greatest total amount of loans?"
] | [
"SELECT sum(amount) FROM loan",
"SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id",
"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. | 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 | loan_1 |
[
"what are the names of customers whose credit score is higher than 200?",
"how about those whose credit score is less than 100?",
"what are the names of bank branches that provided any loans to them?",
"which bank branch gave the greatest total amount of loans to a customer whose credit score is less than 100?"
] | [
"SELECT cust_name FROM customer WHERE credit_score > 200",
"SELECT cust_name FROM customer WHERE credit_score < 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",
"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 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 | loan_1 |
[
"how many loans have an amount greater than 3000?",
"what are their types?",
"Find the names of the customers who own these loans."
] | [
"SELECT count(*) FROM loan WHERE amount > 3000",
"SELECT distinct loan_type FROM loan WHERE amount > 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 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 | loan_1 |
[
"what is the total amount of all business loans?",
"what are the names of bank branches that provide these loans?",
"which cities are these banks located at?"
] | [
"SELECT sum(amount) FROM loan WHERE loan_type = 'Business'",
"SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'",
"SELECT T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'"
] | 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' | loan_1 |
[
"show the name and credit score of all customers.",
"which of them have a credit score below 100?",
"Find the names of bank branches that have provided a loan to them."
] | [
"SELECT cust_name, credit_score FROM customer",
"SELECT cust_name FROM customer WHERE credit_score < 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 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 | loan_1 |
[
"how many bank branches does the state of New York have?",
"what are their names?",
"what is the total amount of loans provided by them?"
] | [
"SELECT count(*) FROM bank WHERE state = 'New York'",
"SELECT bname FROM bank WHERE state = '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 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' | loan_1 |
[
"how many customers have at least one loan?",
"which states are they from?",
"show their credit scores.",
"what is the average?"
] | [
"SELECT count(*) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)",
"SELECT state FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)",
"SELECT credit_score FROM customer WHERE cust_id IN (SELECT cust_id FROM 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 have some loan. | SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) | loan_1 |
[
"Show all the aircraft information.",
"How many are there ?"
] | [
"SELECT * FROM Aircraft",
"SELECT count(*) FROM Aircraft"
] | How many aircrafts do we have? | SELECT count(*) FROM Aircraft | flight_1 |
[
"Show the names of all aircraft.",
"Also show the distances for each of them."
] | [
"SELECT name FROM Aircraft",
"SELECT name , distance FROM Aircraft"
] | Show name and distance for all aircrafts. | SELECT name , distance FROM Aircraft | flight_1 |
[
"Show the id for all aircrafts.",
"Only show the results for those with a distance longer than 1000."
] | [
"SELECT aid FROM Aircraft",
"SELECT aid FROM Aircraft WHERE distance > 1000"
] | Show ids for all aircrafts with more than 1000 distance. | SELECT aid FROM Aircraft WHERE distance > 1000 | flight_1 |
[
"How many aircraft are there?",
"How many of them have a distance between 1000 and 5000?"
] | [
"SELECT count(*) FROM Aircraft",
"SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000"
] | How many aircrafts have distance between 1000 and 5000? | SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000 | flight_1 |
[
"Show the name for all aircraft.",
"What about the one with id 12?",
"Also show its distance."
] | [
"SELECT name FROM Aircraft",
"SELECT name FROM Aircraft WHERE aid = 12",
"SELECT name , distance FROM Aircraft WHERE aid = 12"
] | What is the name and distance for aircraft with id 12? | SELECT name , distance FROM Aircraft WHERE aid = 12 | flight_1 |
[
"Show the distance for all aircrafts.",
"Wnat is the minimum?",
"Also show the average and maximum."
] | [
"select distance FROM Aircraft",
"SELECT min(distance) FROM Aircraft",
"SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft"
] | What is the minimum, average, and maximum distance of all aircrafts. | SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft | flight_1 |
[
"Show the id and name for all aircraft.",
"Order the results in descending order of distance.",
"Which one has the maximum?"
] | [
"SELECT aid , name FROM Aircraft",
"SELECT aid , name FROM Aircraft ORDER BY distance DESC",
"SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1"
] | Show the id and name of the aircraft with the maximum distance. | SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1 | flight_1 |
[
"Show the name for all aircrafts.",
"Order them by the distance.",
"Which three have the lowest?"
] | [
"SELECT name FROM Aircraft",
"SELECT name FROM Aircraft ORDER BY distance",
"SELECT name FROM Aircraft ORDER BY distance LIMIT 3"
] | Show the name of aircrafts with top three lowest distances. | SELECT name FROM Aircraft ORDER BY distance LIMIT 3 | flight_1 |
[
"What is the average distance?",
"Show the name for all aircrafts with a distance above it."
] | [
"SELECT avg(distance) FROM Aircraft",
"SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft)"
] | Show names for all aircrafts with distances more than the average. | SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft) | flight_1 |
[
"Show information for all employees.",
"Show the number of them."
] | [
"SELECT * FROM Employee",
"SELECT count(*) FROM Employee"
] | How many employees do we have? | SELECT count(*) FROM Employee | flight_1 |
[
"Show the name for all employees.",
"Also show their salaries.",
"Order the results by their salary."
] | [
"SELECT name FROM Employee",
"SELECT name , salary FROM Employee",
"SELECT name , salary FROM Employee ORDER BY salary"
] | Show name and salary for all employees sorted by salary. | SELECT name , salary FROM Employee ORDER BY salary | flight_1 |
[
"Show the id for all employees.",
"Which of them have a salary above 100000?"
] | [
"SELECT eid FROM Employee",
"SELECT eid FROM Employee WHERE salary > 100000"
] | Show ids for all employees with at least 100000 salary. | SELECT eid FROM Employee WHERE salary > 100000 | flight_1 |
[
"Show the total number of employees.",
"How many of them have a salary between 100000 and 200000?"
] | [
"SELECT count(*) FROM Employee",
"SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000"
] | How many employees have salary between 100000 and 200000? | SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000 | flight_1 |
[
"Show the information for the employee with id 242518965.",
"What is the name and salary for this employee?"
] | [
"SELECT * FROM Employee WHERE eid = 242518965",
"SELECT name , salary FROM Employee WHERE eid = 242518965"
] | What is the name and salary for employee with id 242518965? | SELECT name , salary FROM Employee WHERE eid = 242518965 | flight_1 |
[
"What is the salary for all employees.",
"What are the average and maximum salaries."
] | [
"select salary FROM Employee",
"SELECT avg(salary) , max(salary) FROM Employee"
] | What is average and maximum salary of all employees. | SELECT avg(salary) , max(salary) FROM Employee | flight_1 |
[
"Show the id and name of the employees.",
"Order them by salary.",
"Who has the maximum salary?"
] | [
"SELECT eid , name FROM Employee",
"SELECT eid , name FROM Employee ORDER BY salary",
"SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1"
] | Show the id and name of the employee with maximum salary. | SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1 | flight_1 |
[
"Show the names of all employees.",
"Order the results by their salaries.",
"Which three have the lowest?"
] | [
"SELECT name FROM Employee",
"SELECT name FROM Employee ORDER BY salary",
"SELECT name FROM Employee ORDER BY salary ASC LIMIT 3"
] | Show the name of employees with three lowest salaries. | SELECT name FROM Employee ORDER BY salary ASC LIMIT 3 | flight_1 |
[
"Show the salaries for all employees.",
"What is the average of them?",
"Show the name for all employees with a salary above that."
] | [
"SELECT salary FROM Employee",
"SELECT avg(salary) FROM Employee",
"SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)"
] | Show names for all employees with salary more than the average. | SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee) | flight_1 |
[
"Show ids for all the employees.",
"Show the id for employee Mark Young.",
"Also show his salary."
] | [
"SELECT eid FROM Employee",
"SELECT eid FROM Employee WHERE name = 'Mark Young'",
"SELECT eid , salary FROM Employee WHERE name = 'Mark Young'"
] | Show the id and salary of Mark Young. | SELECT eid , salary FROM Employee WHERE name = 'Mark Young' | flight_1 |
[
"Show the info for all flights.",
"How many are there?"
] | [
"SELECT * FROM Flight",
"SELECT count(*) FROM Flight"
] | How many flights do we have? | SELECT count(*) FROM Flight | flight_1 |
[
"Show the flight number of all flights.",
"Also show the origin and destination for them.",
"Order them in the alphabetical order of the departure cities."
] | [
"SELECT flno FROM Flight",
"SELECT flno , origin , destination FROM Flight",
"SELECT flno , origin , destination FROM Flight ORDER BY origin"
] | Show flight number, origin, destination of all flights in the alphabetical order of the departure cities. | SELECT flno , origin , destination FROM Flight ORDER BY origin | flight_1 |
[
"Show all flight numbers",
"Filter for only those from Los Angeles?"
] | [
"SELECT flno FROM Flight",
"SELECT flno FROM Flight WHERE origin = \"Los Angeles\""
] | Show all flight number from Los Angeles. | SELECT flno FROM Flight WHERE origin = "Los Angeles" | flight_1 |
[
"Show the origin for all flights.",
"How about the origin for those with destination Honolulu?"
] | [
"SELECT origin FROM Flight",
"SELECT origin FROM Flight WHERE destination = \"Honolulu\""
] | Show origins of all flights with destination Honolulu. | SELECT origin FROM Flight WHERE destination = "Honolulu" | flight_1 |
[
"Show the departure date and arrival date for all flights.",
"How about those from Los Angeles?",
"From these results, only show those flying to Honolulu."
] | [
"SELECT departure_date , arrival_date FROM Flight",
"SELECT departure_date , arrival_date FROM Flight WHERE origin = \"Los Angeles\"",
"SELECT departure_date , arrival_date FROM Flight WHERE origin = \"Los Angeles\" AND destination = \"Honolulu\""
] | Show me the departure date and arrival date for all flights from Los Angeles to Honolulu. | SELECT departure_date , arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu" | flight_1 |
[
"Show the flight numbers for all flights.",
"How about those with distance longer than 2000?"
] | [
"SELECT flno FROM Flight",
"SELECT flno FROM Flight WHERE distance > 2000"
] | Show flight number for all flights with more than 2000 distance. | SELECT flno FROM Flight WHERE distance > 2000 | flight_1 |
[
"Show the price for all flights.",
"How about those from Los Angeles to Honolulu?",
"What is the average of them?"
] | [
"SELECT price FROM Flight",
"SELECT price FROM Flight WHERE origin = \"Los Angeles\" AND destination = \"Honolulu\"",
"SELECT avg(price) FROM Flight WHERE origin = \"Los Angeles\" AND destination = \"Honolulu\""
] | What is the average price for flights from Los Angeles to Honolulu. | SELECT avg(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu" | flight_1 |
[
"Show the origin for all flights.",
"How about those with a price higher than 300?",
"For each of them, also show the destination."
] | [
"SELECT origin FROM Flight",
"SELECT origin FROM Flight WHERE price > 300",
"SELECT origin , destination FROM Flight WHERE price > 300"
] | Show origin and destination for flights with price higher than 300. | SELECT origin , destination FROM Flight WHERE price > 300 | flight_1 |
[
"Show the flight number and distance of all the flights.",
"List them in the descending order of the price.",
"Which has the maximum price?"
] | [
"SELECT flno , distance FROM Flight",
"SELECT flno , distance FROM Flight ORDER BY price DESC",
"SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1"
] | Show the flight number and distance of the flight with maximum price. | SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1 | flight_1 |
[
"Show all flight numbers.",
"Order them by the distance.",
"Show the three shortest."
] | [
"SELECT flno FROM Flight",
"SELECT flno FROM Flight ORDER BY distance",
"SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3"
] | Show the flight number of flights with three lowest distances. | SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3 | flight_1 |
[
"Show the distance and price for all flights.",
"Show the result only for those from Los Angeles.",
"What is the average distance and average price for them?"
] | [
"SELECT distance , price FROM Flight",
"SELECT distance , price FROM Flight WHERE origin = \"Los Angeles\"",
"SELECT avg(distance) , avg(price) FROM Flight WHERE origin = \"Los Angeles\""
] | What is the average distance and average price for flights from Los Angeles. | SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles" | flight_1 |
[
"Show the number of flights in total.",
"Breakdown the count by the origin."
] | [
"SELECT count(*) FROM Flight",
"SELECT origin , count(*) FROM Flight GROUP BY origin"
] | Show all origins and the number of flights from each origin. | SELECT origin , count(*) FROM Flight GROUP BY origin | flight_1 |
[
"Show the destination for all flights.",
"For each of them, what is the number of flights?"
] | [
"SELECT destination FROM Flight",
"SELECT destination , count(*) FROM Flight GROUP BY destination"
] | Show all destinations and the number of flights to each destination. | SELECT destination , count(*) FROM Flight GROUP BY destination | flight_1 |
[
"Show the origin for all flights.",
"For each city, how many flights are departing from there?",
"Order them in descending order of number of departures.",
"Which origin has the most?"
] | [
"SELECT origin FROM Flight",
"SELECT origin, count(*) FROM Flight GROUP BY origin",
"SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC",
"SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1"
] | Which origin has most number of flights? | SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1 | flight_1 |
[
"Show the destination for all flights.",
"For each destination, show the number of flights arriving there.",
"Which destination has the fewest?"
] | [
"SELECT destination FROM Flight",
"SELECT destination, count(*) FROM Flight GROUP BY destination",
"SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1"
] | Which destination has least number of flights? | SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1 | flight_1 |
[
"Show the name for all aircraft.",
"Which one of them is being taken on flight 99?"
] | [
"SELECT name FROM Aircraft",
"SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99"
] | What is the aircraft name for the flight with number 99 | SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99 | flight_1 |
[
"Show all flight numbers.",
"Which of them are on aircraft Airbus A340-300?"
] | [
"SELECT flno FROM Flight",
"SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = \"Airbus A340-300\""
] | Show all flight numbers with aircraft Airbus A340-300. | SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" | flight_1 |
[
"Show the name for all aircraft.",
"For each of them, count the number of flights."
] | [
"Select name from Aircraft",
"SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid"
] | Show aircraft names and number of flights for each aircraft. | SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid | flight_1 |
[
"Show names for all aircraft.",
"For each of them, also show the number of flights.",
"Which two have the fewest?"
] | [
"SELECT name FROM Aircraft",
"SELECT T2.name, count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid",
"SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2"
] | Show names for all aircraft with at least two flights. | SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2 | flight_1 |
[
"Show employee ids for all certificates.",
"What are the distinct ids among them?",
"How many are there?"
] | [
"select eid FROM Certificate",
"SELECT DISTINCT eid FROM Certificate",
"SELECT count(DISTINCT eid) FROM Certificate"
] | How many employees have certificate. | SELECT count(DISTINCT eid) FROM Certificate | flight_1 |
[
"Show the employee ids with a certificate.",
"Show the employee ids without any."
] | [
"SELECT eid FROM Certificate",
"SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate"
] | Show ids for all employees who do not have a certificate. | SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate | flight_1 |
[
"Show the name for all aircraft.",
"For each, also show the names of employees with a certificate on it.",
"What are the names of aircraft of which John Williams has certificates?"
] | [
"SELECT name FROM Aircraft",
"SELECT T3.name, T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid",
"SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = \"John Williams\""
] | Show names for all aircrafts of which John Williams has certificates. | SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams" | flight_1 |
[
"Show names for all employees.",
"Also show the name of aircraft on which they have a certificate.",
"Which of those employees have certificate of Boeing 737-800?"
] | [
"SELECT name FROM Employee",
"SELECT T1.name, T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid",
"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\""
] | Show names for all employees who have certificate of Boeing 737-800. | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | flight_1 |
[
"Show names for all employees.",
"Which of those have certificates on Boeing 737-800?",
"How about those with certificates on Airbus A340-300?",
"Who have both?"
] | [
"SELECT name FROM Employee",
"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\"",
"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Airbus A340-300\"",
"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Airbus A340-300\""
] | Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300. | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300" | flight_1 |
[
"Show the names of employees with a certificate.",
"Which of them have a certificate on Boeing 737-800?",
"Show the names for all employees without this particular certificate."
] | [
"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid",
"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\"",
"SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\""
] | Show names for all employees who do not have certificate of Boeing 737-800. | SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | flight_1 |
[
"Show the name of all aircrafts.",
"Also show the number of people with a certificate on each one.",
"Order the aircraft by these counts.",
"Which of them has the fewest?"
] | [
"select name from Aircraft",
"SELECT T2.name, count(*) FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid",
"SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*)",
"SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) LIMIT 1"
] | Show the name of aircraft which fewest people have its certificate. | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) LIMIT 1 | flight_1 |
[
"Show the name and distance of the aircrafts.",
"How about those with a distance longer than 5000?",
"Which also have at least 5 people with the certificate?"
] | [
"SELECT name, distance FROM Aircraft",
"SELECT name, distance FROM Aircraft WHERE distance > 5000",
"SELECT T2.name, T2.distance FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5"
] | Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate. | SELECT T2.name, T2.distance FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5 | flight_1 |
[
"Show the employee names with their corresponding counts of aircraft certificates.",
"Order the employees by these counts.",
"Who has the most certificates?",
"what is the name and salary of this employee?"
] | [
"select T1.name, count(*) FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid",
"select T1.name, count(*) FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*)",
"select T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1",
"SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1"
] | what is the salary and name of the employee who has the most number of aircraft certificates? | SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1 | flight_1 |
[
"Show me a list of party ministers.",
"Which ones took office between 1959 and 1961?",
"How about the others except those?"
] | [
"SELECT minister FROM party",
"SELECT minister FROM party WHERE took_office >= 1959 AND took_office <= 1961",
"SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959"
] | Show the minister who took office after 1961 or before 1959. | SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959 | party_people |
[
"Who are all the ministers?",
"When did they each start?",
"When did they each leave?",
"Who left most recently?"
] | [
"SELECT minister FROM party",
"SELECT minister, took_office FROM party",
"SELECT minister, left_office FROM party",
"SELECT minister FROM party ORDER BY left_office DESC LIMIT 1"
] | Return the minister who left office at the latest time. | SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 | party_people |
[
"What are all the party names?",
"Show me all the members each have.",
"How many does each party have?"
] | [
"SELECT party_name FROM party",
"SELECT * FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id",
"SELECT T2.party_name, count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id group by party_name"
] | 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 | party_people |
[
"What about the least number?",
"How about the max?",
"What is the name of the party that has this number per party?"
] | [
"SELECT count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY count(*) ASC LIMIT 1",
"SELECT count(*) 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",
"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"
] | 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 | party_people |
[
"What are the names of all parties?",
"How many have no members?",
"Which ones?"
] | [
"SELECT party_name FROM party",
"SELECT count(*) FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)",
"SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)"
] | Show names of parties that does not have any members. | SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member) | party_people |
[
"What are all the member names?",
"Which ones are in party with id 1?",
"How about in party with id 3?",
"Can you show me those in both?"
] | [
"SELECT member_name FROM member",
"SELECT member_name FROM member WHERE party_id = 1",
"SELECT member_name FROM member WHERE party_id = 3",
"SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1"
] | 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 | party_people |
[
"How many members are there?",
"How many are in the Progressive party?",
"How many are not?",
"What are their names?"
] | [
"SELECT count(*) FROM member",
"SELECT count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name = \"Progress Party\"",
"SELECT count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name != \"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\""
] | 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" | party_people |
[
"What are the names and ids of all the party events?",
"What parties are each event affiliated with?",
"Just show me a distinct list of the names these parties.",
"Also show how many events each of them!"
] | [
"SELECT event_id, event_name FROM party_events",
"SELECT event_id, event_name, party_id FROM party_events",
"SELECT distinct T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id",
"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 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 | party_people |
[
"Show me all the information for all the party events?",
"Also show all the distinct member information of those in charge of them?",
"Now just show me the distinct members information for all the members other than those?",
"Just show me their names!"
] | [
"SELECT * FROM party_events",
"SELECT * FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id",
"SELECT * FROM member EXCEPT SELECT * FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id",
"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"
] | 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 | party_people |
[
"What parties do not host any events?",
"Which ones host at least one event?",
"How about 2?",
"Show just the names of these!"
] | [
"SELECT * FROM party except SELECT * FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id",
"SELECT distinct * FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id",
"SELECT * FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING count(*) >= 2",
"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 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 | party_people |
[
"How many different member in charges are there for all party_events?",
"What are their names?",
"How many events are they each in charge of?",
"Who has the greatest number?"
] | [
"SELECT count(distinct member_in_charge_id) FROM party_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",
"SELECT T1.member_name, count(*) 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",
"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"
] | 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 | party_people |
[
"Show me all the event ids, event names and party id for each party_event.",
"How events are there for every party?",
"How about for every event name?",
"Which event names have at least 2?"
] | [
"SELECT event_id, event_name, party_id FROM party_events",
"SELECT party_id, count(*) FROM party_events GROUP BY party_id",
"SELECT event_name, count(*) FROM party_events GROUP BY event_name",
"SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2"
] | find the event names that have more than 2 records. | SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2 | party_people |
[
"List the names and nationalities of all architects.",
"Include their ids as well.",
"Only include architects who are male.",
"List the names alphabetically."
] | [
"SELECT name, nationality FROM architect",
"SELECT name, nationality, id FROM architect",
"SELECT name, nationality, id FROM architect WHERE gender = \"male\"",
"SELECT name, nationality, id FROM architect WHERE gender = \"male\" ORDER BY name"
] | 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 | architecture |
[
"What are the different types of mills?",
"Which ones were built by American architects?",
"Include those built by Canadian architects as well."
] | [
"SELECT DISTINCT type FROM mill",
"SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American'",
"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 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' | architecture |
[
"What are the ids and names of all architects?",
"How many of those architects built less than 3 bridges?",
"How many built 3 or more bridges?",
"Please list their ids and names."
] | [
"SELECT id, name FROM architect",
"SELECT count(*) FROM (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)",
"SELECT count(*) FROM (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)",
"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 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 | architecture |
[
"How many mills did each architect build?",
"Order by decreasing number of mills built.",
"Which architect built the most mills?",
"Please list his id and nationality as well."
] | [
"SELECT T1.name , count(*) FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY count(*)",
"SELECT T1.name , count(*) FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC",
"SELECT T1.name FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1",
"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 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 | architecture |
[
"List the names of architects who built 2 bridges.",
"Include architects who built 1 mill.",
"Include their ids and genders as well."
] | [
"SELECT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 2",
"SELECT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 2 UNION SELECT T1.name FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 1",
"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 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 | architecture |
[
"List the locations of all bridges.",
"Where is the bridge named ‘Kolob Arch’ located?",
"Include the location of the bridge named ‘Rainbow Bridge’."
] | [
"SELECT DISTINCT LOCATION FROM bridge",
"SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch'",
"SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch' OR name = 'Rainbow Bridge'"
] | 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' | architecture |
[
"List all of the mill names.",
"Just show mill names that contain the word ‘Moulin’."
] | [
"SELECT name FROM mill",
"SELECT name FROM mill WHERE name LIKE '%Moulin%'"
] | Which of the mill names contains the french word 'Moulin'? | SELECT name FROM mill WHERE name LIKE '%Moulin%' | architecture |
[
"Which architects have built bridges?",
"Which of them have built bridges longer than 80 meters?",
"How many of those architects have also built mills?",
"Please list the names of those mills."
] | [
"SELECT DISTINCT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id",
"SELECT DISTINCT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id WHERE T2.length_meters > 80",
"SELECT count(DISTINCT T2.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",
"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 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 | architecture |
[
"What are the different mill types?",
"Order by the number of mills of each type in decreasing order.",
"What is the most common mill type?",
"How many mills of that type are there?"
] | [
"SELECT DISTINCT TYPE FROM mill",
"SELECT TYPE FROM mill GROUP BY TYPE ORDER BY count(*) DESC",
"SELECT TYPE FROM mill GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1",
"SELECT TYPE , count(*) FROM mill GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1"
] | 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 | architecture |
[
"Count the total number of architects.",
"How many have built a mill?",
"How many did not build a mill before 1850?"
] | [
"SELECT count(*) FROM architect",
"SELECT count(*) FROM architect WHERE id IN ( SELECT architect_id FROM mill )",
"SELECT count(*) FROM architect WHERE id NOT IN ( SELECT architect_id FROM mill WHERE built_year < 1850 )"
] | How many architects haven't built a mill before year 1850? | SELECT count(*) FROM architect WHERE id NOT IN ( SELECT architect_id FROM mill WHERE built_year < 1850 ); | architecture |
[
"What are the locations of each school ordered in the date founded, oldest first?",
"Actually, order the result in ascending order of enrollment."
] | [
"SELECT LOCATION FROM school ORDER BY Founded ASC;",
"SELECT LOCATION FROM school ORDER BY Enrollment ASC;"
] | List the locations of schools in ascending order of enrollment. | SELECT LOCATION FROM school ORDER BY Enrollment ASC | school_player |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.