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 locations of each school?", "Order the result in descending order of founded year." ]
[ "SELECT LOCATION FROM school;", "SELECT LOCATION FROM school ORDER BY Founded DESC;" ]
List the locations of schools in descending order of founded year.
SELECT LOCATION FROM school ORDER BY Founded DESC;
school_player
[ "What is the denomination of each school?", "What are the enrollments of schools whose denomination is \"Catholic\"?", "How about non-Catholic?" ]
[ "SELECT Denomination FROM school;", "SELECT Enrollment FROM school WHERE Denomination = \"Catholic\";", "SELECT Enrollment FROM school WHERE Denomination != \"Catholic\";" ]
What are the enrollments of schools whose denomination is not "Catholic"?
SELECT Enrollment FROM school WHERE Denomination != "Catholic";
school_player
[ "What is the combined total enrollment of all schools?", "How about the maximum enrollment?", "Show me the average enrollment." ]
[ "SELECT sum(Enrollment) FROM school;", "SELECT Enrollment FROM school ORDER BY Enrollment LIMIT 1;", "SELECT avg(Enrollment) FROM school;" ]
What is the average enrollment of schools?
SELECT avg(Enrollment) FROM school;
school_player
[ "What are the ages of the players?", "Show their teams instead.", "Sort the result in ascending alphabetical order." ]
[ "SELECT Age FROM player;", "SELECT Team FROM player;", "SELECT Team FROM player ORDER BY Team ASC;" ]
What are the teams of the players, sorted in ascending alphabetical order?
SELECT Team FROM player ORDER BY Team ASC;
school_player
[ "Show me all about each player.", "Who is the oldest among them?", "What's his team?" ]
[ "SELECT * FROM player;", "SELECT Player FROM player ORDER BY Age DESC LIMIT 1;", "SELECT Team FROM player ORDER BY Age DESC LIMIT 1;" ]
Find the team of the player of the highest age.
SELECT Team FROM player ORDER BY Age DESC LIMIT 1;
school_player
[ "How many players are there?", "What's their average age?", "List the teams of the players with the top 5 largest ages." ]
[ "SELECT count(*) FROM player;", "SELECT avg(Age) FROM player;", "SELECT Team FROM player ORDER BY Age DESC LIMIT 5;" ]
List the teams of the players with the top 5 largest ages.
SELECT Team FROM player ORDER BY Age DESC LIMIT 5;
school_player
[ "Show me the location of each school.", "For each player, show the location of the school they belong to.", "Also provide, the team name." ]
[ "SELECT Location FROM school;", "SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID;", "SELECT T1.Team , T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID;" ]
For each player, show the team and the location of school they belong to.
SELECT T1.Team , T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID;
school_player
[ "How many schools are there?", "Show me their locations.", "Which of them have more than 3 players?", "How about more than 1 player?" ]
[ "SELECT count(*) FROM school;", "SELECT Location FROM school;", "SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 3;", "SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1;" ]
Show the locations of schools that have more than 1 player.
SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1;
school_player
[ "Which school has the least number of players?", "How about with the most players?", "Show me the denomination of this school." ]
[ "SELECT T2.School FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) ASC LIMIT 1;", "SELECT T2.School FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1;", "SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1;" ]
Show the denomination of the school that has the most players.
SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1;
school_player
[ "Show me the school details.", "What's each school's color?", "List the location and nickname of each school." ]
[ "SELECT * FROM school_details;", "SELECT Colors FROM school_details;", "SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID;" ]
Show locations and nicknames of schools.
SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID;
school_player
[ "Show me whether each school is a boys' or girls' school.", "What are the distinct school denominations?", "For each denomination, how many schools are there?" ]
[ "SELECT Boys_or_Girls FROM school;", "SELECT DISTINCT(Denomination) FROM school;", "SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination;" ]
Please show different denominations and the corresponding number of schools.
SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination
school_player
[ "How many different denominations does each school have?", "What are they?", "How many schools are there for every denomination. Show Denomination and number of schools.", "Show the results in descending order!" ]
[ "SELECT COUNT(distinct Denomination) FROM school;", "SELECT distinct Denomination FROM school;", "SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination", "SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC;" ]
Please show different denominations and the corresponding number of schools in descending order.
SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
school_player
[ "What school has the largest enrollment?", "What are its school colors?" ]
[ "SELECT * FROM school ORDER BY Enrollment DESC LIMIT 1", "SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1" ]
List the school color of the school that has the largest enrollment.
SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
school_player
[ "How many schools are there?", "How many don't have any players?", "Which ones don't have any players?", "Show their locations." ]
[ "SELECT count(*) FROM school;", "SELECT count(*) FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player);", "SELECT * FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player);", "SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player);" ]
List the locations of schools that do not have any player.
SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
school_player
[ "Show the denominations of schools.", "Also provide their founding year?", "List the denomination shared by schools founded before 1890 and schools founded after 1900." ]
[ "SELECT Denomination FROM school;", "SELECT Denomination, Founded FROM school;", "SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900;" ]
Show the denomination shared by schools founded before 1890 and schools founded after 1900
SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900;
school_player
[ "Show me the school names in division 1.", "How about those not in division 1?", "List their nicknames." ]
[ "SELECT School FROM school_details AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.Division = \"Division 1\";", "SELECT School FROM school_details AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.Division != \"Division 1\";", "SELECT Nickname FROM school_details WHERE Division != \"Division 1\";" ]
Show the nicknames of schools that are not in division 1.
SELECT Nickname FROM school_details WHERE Division != "Division 1";
school_player
[ "What are the products available in the stores?", "What about the maximum page sizes supported by these products?", "Which products have a maximum page size A4?", "Which maximum page sizes are the maximum page size for more than 3 products?" ]
[ "SELECT product FROM product", "SELECT product, max_page_size FROM product", "SELECT product FROM product WHERE max_page_size = 'A4'", "SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*) > 3" ]
Find the list of page size which have more than 3 product listed
SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*) > 3
store_product
[ "What are the districts out there?", "What is the name of the headquartered city of each district?", "Which of these given districts have a city population larger than 100000?", "Also show the districts that have a city area greater than 10." ]
[ "SELECT district_name FROM district", "SELECT district_name, Headquartered_City FROM district", "SELECT district_name FROM district WHERE City_Population > 100000", "SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000" ]
Find the name all districts with city area greater than 10 or population larger than 100000
SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000
store_product
[ "Can you give me the names of the districts.", "Tell me the city population of these districts.", "Which of these cities have an above average population?", "Which district has the largest city population?" ]
[ "SELECT district_name FROM district", "SELECT district_name, City_Population FROM district", "SELECT district_name FROM district WHERE City_Population > (SELECT AVG(City_Population) FROM district)", "SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1" ]
Which district has the largest population?
SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1
store_product
[ "What are the districts out there?", "Tell me the city area of these districts.", "Of all these districts, which ones have a below average city area?", "Which of these districts has the least city area?" ]
[ "SELECT District_name FROM district", "SELECT District_name, City_Area FROM district", "SELECT District_name FROM district WHERE City_Area < (SELECT AVG(City_Area) FROM district)", "SELECT District_name FROM district WHERE City_Area = (SELECT MIN(City_Area) FROM district)" ]
Which district has the least area?
SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1
store_product
[ "What are the names of the districts?", "Tell me which of these districts have stores.", "What are the store names of the Hafizabad District?", "What about the store names of the Khanewal District?" ]
[ "SELECT District_name FROM district", "SELECT DISTINCT t1.District_name FROM district as t1 JOIN store_district AS t2 ON t1.District_ID = t2.District_ID JOIN store AS t3 ON t3.Store_ID = t2.Store_ID", "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = \"Hafizabad District\"", "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = \"Khanewal District\"" ]
Find the names of all stores in Khanewal District.
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = "Khanewal District"
store_product
[ "What are the populations of the districts?", "Can you also tell me the stores in each district along with the population?", "Which of these stores are from the districts with above average population?", "What about the stores from the district with the most population?" ]
[ "SELECT City_Population FROM district", "SELECT t3.Store_name, t1.City_Population FROM district as t1 JOIN store_district AS t2 ON t1.District_ID = t2.District_ID JOIN store AS t3 ON t3.Store_ID = t2.Store_ID", "SELECT t3.Store_name FROM district as t1 JOIN store_district AS t2 ON t1.District_ID = t2.District_ID JOIN store AS t3 ON t3.Store_ID = t2.Store_ID WHERE t1.City_Population > (SELECT AVG(City_Population) FROM district)", "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)" ]
Find all the stores in the district with the most population.
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)
store_product
[ "Can you tell me about the names of all the stores?", "What is the type of the store \"Blackville\"?", "In which district is \"Blackville\" located?", "Which city is \"Blackville\" headquartered in?" ]
[ "SELECT Store_Name FROM store", "SELECT Type FROM store WHERE Store_name = \"Blackville\"", "SELECT t1.district_name FROM district as t1 JOIN store_district AS t2 ON t1.District_ID = t2.District_ID JOIN store AS t3 ON t3.Store_ID = t2.Store_ID WHERE t3.Store_name = \"Blackville\"", "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = \"Blackville\"" ]
Which city is the headquarter of the store named "Blackville" in?
SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = "Blackville"
store_product
[ "Show me the names of all the cities.", "How about the names of all the stores?", "Which cities have these stores?", "What is the number of stores for each of these cities?" ]
[ "SELECT headquartered_city FROM district", "SELECT Store_Name FROM store", "SELECT DISTINCT t1.headquartered_city FROM district as t1 JOIN store_district AS t2 ON t1.District_ID = t2.District_ID JOIN store AS t3 ON t3.Store_ID = t2.Store_ID", "SELECT t3.headquartered_city , count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city" ]
Find the number of stores in each city.
SELECT t3.headquartered_city , count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city
store_product
[ "Tell me all the cities and their respective stores.", "How many stores are there for each city?", "Which city has the least number of stores?", "What about the one with the most?" ]
[ "SELECT t1.headquartered_city, t3.store_name FROM district as t1 JOIN store_district AS t2 ON t1.District_ID = t2.District_ID JOIN store AS t3 ON t3.Store_ID = t2.Store_ID", "SELECT t1.headquartered_city, count(*) FROM district as t1 JOIN store_district AS t2 ON t1.District_ID = t2.District_ID JOIN store AS t3 ON t3.Store_ID = t2.Store_ID GROUP BY t1.headquartered_city", "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) ASC LIMIT 1", "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1" ]
Find the city with the most number of stores.
SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1
store_product
[ "Can you list all the stores?", "Which ones have products?", "What products do they sell?", "Out of those products, which ones are available at \"Miramichi\"?" ]
[ "SELECT store_name FROM store", "SELECT DISTINCT t1.store_name FROM store AS t1 JOIN store_product AS t2 ON t1.Store_ID = t2.Store_ID JOIN product AS t3 ON t2.Product_ID = t3.Product_ID", "SELECT t3.product FROM store AS t1 JOIN store_product AS t2 ON t1.Store_ID = t2.Store_ID JOIN product AS t3 ON t2.Product_ID = t3.Product_ID", "SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = \"Miramichi\"" ]
What products are available at store named "Miramichi"?
SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = "Miramichi"
store_product
[ "What are the products out there?", "Tell me the page per minute color of these products.", "Which of these have a pages per minute color smaller than 5?", "Which of these listed products also have a max page size \"A4\"?" ]
[ "SELECT product FROM product", "SELECT product, pages_per_minute_color FROM product", "SELECT product FROM product WHERE pages_per_minute_color < 5", "SELECT product FROM product WHERE max_page_size = \"A4\" AND pages_per_minute_color < 5" ]
Find products with max page size as "A4" and pages per minute color smaller than 5.
SELECT product FROM product WHERE max_page_size = "A4" AND pages_per_minute_color < 5
store_product
[ "Give me the list of the products.", "Tell me the max page size of these products.", "Which of these have a max page size of \"A4\"?", "Also include those that have a pages per minute color smaller than 5." ]
[ "SELECT product FROM product", "SELECT product, max_page_size FROM product", "SELECT product FROM product WHERE max_page_size = \"A4\"", "SELECT product FROM product WHERE max_page_size = \"A4\" OR pages_per_minute_color < 5" ]
Find products with max page size as "A4" or pages per minute color smaller than 5.
SELECT product FROM product WHERE max_page_size = "A4" OR pages_per_minute_color < 5
store_product
[ "List the available products.", "Which of these products contains the word word \"Canon\"?", "How about the word \"Fujitsu\"?", "How about the word \"Scanner\"?" ]
[ "SELECT product FROM product", "SELECT product FROM product WHERE product LIKE \"%Canon%\"", "SELECT product FROM product WHERE product LIKE \"%Fujitsu%\"", "SELECT product FROM product WHERE product LIKE \"%Scanner%\"" ]
Find all the product whose name contains the word "Scanner".
SELECT product FROM product WHERE product LIKE "%Scanner%"
store_product
[ "Tell me all the max page sizes available.", "Give me the names of all products.", "What are the corresponding max page sizes of these products?", "Which max page sizes are the most prominent?" ]
[ "SELECT DISTINCT max_page_size FROM product", "SELECT product FROM product", "SELECT product, max_page_size FROM product", "SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1" ]
Find the most prominent max page size among all the products.
SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1
store_product
[ "Can you show me all the products?", "Give me the max page sizes for each of these products.", "Which of these max page sizes is most frequently used?", "Which products do not use this max page size?" ]
[ "SELECT product FROM product", "SELECT product, max_page_size FROM product", "SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1", "SELECT product FROM product WHERE max_page_size != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1)" ]
Find the name of the products that are not using the most frequently-used max page size.
SELECT product FROM product WHERE max_page_size != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1)
store_product
[ "Show me all the districts.", "What is the average city area of these districts?", "Which districts have a higher than average city area?", "What is the total population of these districts?" ]
[ "SELECT district_name FROM district", "SELECT avg(city_area) FROM district", "SELECT district_name FROM district WHERE city_area > (SELECT avg(city_area) FROM district)", "SELECT sum(city_population) FROM district WHERE city_area > (SELECT avg(city_area) FROM district)" ]
Find the total population of the districts where the area is bigger than the average city area.
SELECT sum(city_population) FROM district WHERE city_area > (SELECT avg(city_area) FROM district)
store_product
[ "How old is Dan?", "What city is she from?", "Show all friends of Dan.", "How many friends is this?" ]
[ "SELECT age FROM person WHERE name = 'Dan'", "SELECT city FROM person WHERE name = 'Dan'", "SELECT * FROM personfriend WHERE name = 'Dan'", "SELECT count(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'" ]
How many friends does Dan have?
SELECT count(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'
network_2
[ "Show all ages of people.", "What is the average?", "What is the maximum?", "What is the name of the person with this age?" ]
[ "SELECT age FROM person", "SELECT avg(age) FROM person", "SELECT max(age) FROM person", "SELECT name FROM person WHERE age = (SELECT max(age) FROM person)" ]
Who is the oldest person?
SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)
network_2
[ "How many distinct jobs do the people have?", "What are these jobs?", "List the names of all students.", "What is the maximum age of students?", "Print the name of the student with this age." ]
[ "SELECT count(DISTINCT job) FROM person", "SELECT DISTINCT job FROM person", "SELECT name FROM person WHERE job = 'student'", "SELECT max(age) FROM person WHERE job = 'student'", "SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )" ]
Who is the oldest person whose job is student?
SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )
network_2
[ "List all female names.", "How about males?", "What are the maximum ages for each gender?", "Who is the youngest male?" ]
[ "SELECT name FROM person WHERE gender = 'female'", "SELECT name FROM person WHERE gender = 'male'", "SELECT gender, max(age) FROM person GROUP BY gender", "SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )" ]
Who is the youngest male?
SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )
network_2
[ "What is the last name alphabetically?", "What is the occupation for Zach?", "How old is the doctor named Zach?" ]
[ "SELECT name FROM person ORDER BY name DESC LIMIT 1", "SELECT job FROM person WHERE name = 'Zach'", "SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'" ]
How old is the doctor named Zach?
SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'
network_2
[ "How many people are older than 20?", "How about 30?", "How many engineers are there?", "How many people are both engineers and are over 30 years old?" ]
[ "SELECT count(*) FROM person WHERE age > 20", "SELECT count(*) FROM person WHERE age > 30", "SELECT count(*) FROM person WHERE job = 'engineer'", "SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'" ]
How many people whose age is greater 30 and job is engineer?
SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'
network_2
[ "What is the sum of ages for men?", "What about the average?", "What is the average for each job?" ]
[ "SELECT sum(age) FROM person WHERE gender = 'male'", "SELECT avg(age) FROM person WHERE gender = 'male'", "SELECT avg(age) FROM person WHERE gender = 'male' GROUP BY job" ]
What is average age of male for different job title?
SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job
network_2
[ "How many different people are over 40?", "How about under?", "How many are male?", "What is the count under 40 for each gender?" ]
[ "SELECT count(DISTINCT name) FROM person WHERE age > 40", "SELECT count(DISTINCT name) FROM person WHERE age < 40", "SELECT count(DISTINCT name) FROM person WHERE age < 40 AND gender = 'male'", "SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender" ]
Find the number of people who is under 40 for each gender.
SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender
network_2
[ "What is the minimum age of engineers?", "List all information for people older than this.", "Just show their name.", "Sort this group in order of ascending age." ]
[ "SELECT min(age) FROM person WHERE job = 'engineer'", "SELECT * FROM person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer')", "SELECT name FROM person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer')", "SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age" ]
Find the name of people whose age is greater than any engineer sorted by their age.
SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age
network_2
[ "What is the maximum age of engineers?", "List all information for people older than this.", "Where are they all from?", "How many are there in total?" ]
[ "SELECT max(age) FROM person WHERE job = 'engineer'", "SELECT * FROM person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer')", "SELECT city FROM person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer')", "SELECT count(*) FROM person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')" ]
Find the number of people whose age is greater than all engineers.
SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')
network_2
[ "Show all names of the men.", "Order them by descending age.", "Reverse the oder.", "Also show the ages." ]
[ "SELECT name FROM person WHERE gender = 'male'", "SELECT name FROM person WHERE gender = 'male' ORDER BY age DESC", "SELECT name FROM person WHERE gender = 'male' ORDER BY age", "SELECT name, age FROM person WHERE gender = 'male' ORDER BY age" ]
Find the name and age of all males in order of their age.
SELECT name, age FROM Person WHERE gender = 'male' ORDER BY age
network_2
[ "Show name and age of the people who are friends with Dan.", "How about the friends of Alice?", "Show the union of the sets.", "How about the intersections?" ]
[ "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan'", "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'", "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' UNION SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'", "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'" ]
Find the name and age of the person who is a friend of both Dan and Alice.
SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'
network_2
[ "How many people are friends with Dan?", "How about for Alice?", "Show the name and age of poeple who are friends with either." ]
[ "SELECT count(*) FROM personfriend WHERE friend = 'Dan'", "SELECT count(*) FROM personfriend WHERE friend = 'Alice'", "SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'" ]
Find the name and age of the person who is a friend of Dan or Alice.
SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'
network_2
[ "Show how many friends each person in the set has.", "Who has the most friends?", "Who is friends with someone who is above 40?", "Who among them is also friends with someone who is under 30?" ]
[ "SELECT name, count(*) FROM personfriend GROUP BY name", "SELECT name FROM personfriend GROUP BY name ORDER BY count(*) DESC LIMIT 1", "SELECT t1.name FROM person AS t1 JOIN personfriend as t2 ON t1.name = t2.name WHERE t2.friend in (SELECT name FROM person WHERE age > 40)", "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)" ]
Find the name of the person who has friends with age above 40 and under age 30?
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)
network_2
[ "Who has exactly 1 friend?", "What about more than 1?", "Who has a friend who is at least 40 years old?", "Who among them do not also have a friend under 30?" ]
[ "SELECT name FROM personfriend GROUP BY name HAVING count(*) = 1", "SELECT name FROM personfriend GROUP BY name HAVING count(*) > 1", "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40)", "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)" ]
Find the name of the person who has friends with age above 40 but not under age 30?
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)
network_2
[ "Show all student names.", "How many are there?", "Show all people friends with students.", "Show all people except these." ]
[ "SELECT name FROM person WHERE job = 'student'", "SELECT count(*) FROM person WHERE job = 'student'", "SELECT t2.name FROM person AS t1 JOIN personfriend AS t2 ON t1.name = t2.friend WHERE t1.name = 'student'", "SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'" ]
Find the name of the person who has no student friends.
SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'
network_2
[ "Who has the longest-running friend?", "Who has more than 1 friend?", "Who has no friends?", "Who has exactly 1?" ]
[ "SELECT name FROM personfriend ORDER BY year DESC LIMIT 1", "SELECT name FROM personfriend GROUP BY name HAVING count(*) > 1", "SELECT name FROM person WHERE name NOT IN (SELECT name from personfriend)", "SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1" ]
Find the person who has exactly one friend.
SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1
network_2
[ "How many people does Bob consider a friend?", "How long have they been friends?", "Only show the name." ]
[ "SELECT count(*) FROM personfriend WHERE name = 'Bob'", "SELECT friend, year FROM personfriend WHERE name = 'Bob'", "SELECT friend FROM PersonFriend WHERE name = 'Bob'" ]
Who are the friends of Bob?
SELECT friend FROM PersonFriend WHERE name = 'Bob'
network_2
[ "How many friendships are there?", "How many distinct people consider Bob to be their friend?", "Who has considered him a friend for the shortest amount of time?", "Show the names of everyone who thinks he is their friend." ]
[ "SELECT count(*) FROM personfriend", "SELECT count(DISTINCT name) FROM personfriend WHERE friend = 'Bob'", "SELECT name FROM personfriend WHERE friend = 'Bob' ORDER BY year", "SELECT name FROM PersonFriend WHERE friend = 'Bob'" ]
Find the name of persons who are friends with Bob.
SELECT name FROM PersonFriend WHERE friend = 'Bob'
network_2
[ "Who does Zach consider to be his friend?", "How about the other way around?", "Find the names of those among them who are male.", "And female?" ]
[ "SELECT friend FROM personfriend WHERE name = 'Zach'", "SELECT name FROM personfriend WHERE friend = 'Zach'", "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'male'", "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'" ]
Find the names of females who are friends with Zach
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'
network_2
[ "Who considers Alice to be their friend?", "How about the other way around?", "Find the names of those among them who are male.", "And female?" ]
[ "SELECT name FROM personfriend WHERE friend = 'Alice'", "SELECT friend FROM personfriend WHERE name = 'Alice'", "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male'", "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'" ]
Find the female friends of Alice.
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'
network_2
[ "How many people are a friend of Alice?", "How many people are not a friend of Alice?", "Who among the friends of Alice is male?", "Only show those who are also a doctor?" ]
[ "SELECT count(*) FROM personfriend WHERE name = 'Alice'", "SELECT count(*) FROM person WHERE name NOT IN (SELECT friend FROM personfriend WHERE name = 'Alice')", "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male'", "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'" ]
Find the male friend of Alice whose job is a doctor?
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'
network_2
[ "Who is from Chicago?", "How about New York City?", "How many are there?", "Who is friends with these people?" ]
[ "SELECT name FROM person WHERE city = 'chicago'", "SELECT name FROM person WHERE city = 'new york city'", "SELECT count(*) FROM person WHERE city = 'new york city'", "SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'" ]
Who has a friend that is from new york city?
SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'
network_2
[ "What is the minimum age?", "Who has it?", "What is the average age?", "Who is younger than this?", "Who calls these people friends?" ]
[ "SELECT min(age) FROM person", "SELECT name FROM person WHERE age = (SELECT min(age) FROM person)", "SELECT avg(age) FROM person", "SELECT name FROM person WHERE age < (SELECT avg(age) FROM person)", "SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person)" ]
Who has friends that are younger than the average age?
SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person)
network_2
[ "How many people are there?", "How many are younger than the average age?", "What about older?", "Who is friends with these people? Show their names and ages." ]
[ "SELECT count(*) FROM person", "SELECT count(*) FROM person WHERE age < (SELECT avg(age) FROM person)", "SELECT count(*) FROM person WHERE age > (SELECT avg(age) FROM person)", "SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person)" ]
Who has friends that are older than the average age? Print their friends and their ages as well
SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person)
network_2
[ "How many people is Zach friends with?", "Who are they?", "Also show how long they have been freinds.", "Show the name of the person who has been freinds with him the longest." ]
[ "SELECT count(*) FROM personfriend WHERE name = 'Zach'", "SELECT name FROM personfriend WHERE name = 'Zach'", "SELECT name, year FROM personfriend WHERE name = 'Zach'", "SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')" ]
Who is the friend of Zach with longest year relationship?
SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')
network_2
[ "Who has the shortest relationship among the people Zach is friends with?", "How about the longest?", "Also show how long have they been freinds.", "How old are they?" ]
[ "SELECT name FROM personfriend WHERE name = 'Zach' ORDER BY year LIMIT 1", "SELECT name FROM personfriend WHERE name = 'Zach' ORDER BY year DESC LIMIT 1", "SELECT name, year FROM personfriend WHERE name = 'Zach' ORDER BY year DESC LIMIT 1", "SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')" ]
What is the age of the friend of Zach with longest year relationship?
SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')
network_2
[ "What is the length of the shortest friendship?", "WHat is the minimum among friendships with Alice?", "What is the name of the person who has held this friendship?" ]
[ "SELECT min(year) FROM personfriend", "SELECT min(year) FROM personfriend WHERE friend = 'Alice'", "SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')" ]
Find the name of persons who are friends with Alice for the shortest years.
SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')
network_2
[ "What is the maximum length of friendships with Alice?", "Who holds a relationship of that length?", "Also show age and job title." ]
[ "SELECT max(year) FROM personfriend WHERE friend = 'Alice'", "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')", "SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')" ]
Find the name, age, and job title of persons who are friends with Alice for the longest years.
SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')
network_2
[ "How many people are there in total?", "How many people are in the friendship database?", "Who is not in it?" ]
[ "SELECT count(*) FROM person", "SELECT count(DISTINCT name) FROM personfriend", "SELECT name FROM person EXCEPT SELECT name FROM personfriend" ]
Who is the person that has no friend?
SELECT name FROM person EXCEPT SELECT name FROM PersonFriend
network_2
[ "What is the average age of all people?", "What is the average age of the friends?", "Show the average friend age for each person.", "Who has the highest?" ]
[ "SELECT avg(age) FROM person", "SELECT avg(t1.age) FROM person AS t1 JOIN personfriend AS t2 ON t1.name = t2.friend", "SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name", "SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1" ]
Which person whose friends have the oldest average age?
SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1
network_2
[ "Show all cities alphabetically.", "How many people live in Austin?", "Who is friends with them?", "How many people are not friends with them?" ]
[ "SELECT city FROM person ORDER BY city", "SELECT count(*) FROM person WHERE city = 'austin'", "SELECT name FROM personfriend WHERE friend IN (SELECT name FROM person WHERE city = 'austin')", "SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')" ]
What is the total number of people who has no friend living in the city of Austin.
SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')
network_2
[ "What are the names and market shares of browsers?", "What is the name of the browser with the maximum market share?", "What is the maximum, minimum and average market share of the listed browsers?" ]
[ "SELECT name, market_share from browser", "SELECT name from browser ORDER by market_share DESC LIMIT 1", "SELECT max(market_share) , min(market_share) , avg(market_share) FROM browser" ]
What is the maximum, minimum and average market share of the listed browsers?
SELECT max(market_share) , min(market_share) , avg(market_share) FROM browser
browser_web
[ "Which browsers are compatible with CProxy?", "Which of those became compatible after year 1998?" ]
[ "SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy'", "SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998" ]
What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?
SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998
browser_web
[ "Which accelerators are compatible with at least one browser?", "Which are compatible with none?", "What are the ids and names of the web accelerators that are compatible with two or more browsers?" ]
[ "SELECT name from web_client_accelerator where id in (SELECT accelerator_id from accelerator_compatible_browser)", "SELECT name from web_client_accelerator where id not in (SELECT accelerator_id from accelerator_compatible_browser)", "SELECT T1.id , T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING count(*) >= 2" ]
What are the ids and names of the web accelerators that are compatible with two or more browsers?
SELECT T1.id , T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING count(*) >= 2
browser_web
[ "Which browsers are compatible with some accelerator(s)?", "Which is compatible with the most?" ]
[ "SELECT name from browser where id in (SELECT browser_id from accelerator_compatible_browser)", "SELECT T1.id , T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1" ]
What is the id and name of the browser that is compatible with the most web accelerators?
SELECT T1.id , T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
browser_web
[ "How many times did CACHEbox and Internet Explorer become compatible?", "What year did they become compatible?" ]
[ "SELECT count(*) FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'", "SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'" ]
When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?
SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'
browser_web
[ "Which accelerator ids are not compatible with any browsers?", "Count those." ]
[ "SELECT id FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );", "SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );" ]
How many accelerators are not compatible with the browsers listed ?
SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );
browser_web
[ "Which browsers have market share greater than 15?", "Which of those are compatible with some accelerator?", "What distinct accelerator names are compatible with the browswers that have market share higher than 15?" ]
[ "SELECT name from browser where market_share > 15", "SELECT name from browser where market_share > 15 AND id in (SELECT browser_id from accelerator_compatible_browser)", "SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15;" ]
What distinct accelerator names are compatible with the browswers that have market share higher than 15?
SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15;
browser_web
[ "Which browser ids are compatible with CACHEbox?", "Name those browsers.", "Intersect that with those compatible with Fasterfox." ]
[ "SELECT T1.id FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id WHERE T1.name = 'CACHEbox'", "SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox'", "SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox'" ]
List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.
SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox'
browser_web
[ "Which accelerator ids are not compatible with Opera?", "For these, show the names and supporting operating systems." ]
[ "SELECT id from web_client_accelerator where id not in (SELECT t1.accelerator_id from accelerator_compatible_browser as t1 join browser as t2 on t1.browser_id = t2.id where t2.name = 'Opera')", "SELECT name , operating_system FROM web_client_accelerator EXCEPT SELECT T1.name , T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'" ]
Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.
SELECT name , operating_system FROM web_client_accelerator EXCEPT SELECT T1.name , T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'
browser_web
[ "Which accelerator name contains substring \"Free\"?", "How about \"Opera\"" ]
[ "SELECT name FROM web_client_accelerator WHERE name LIKE \"%Free%\"", "SELECT name FROM web_client_accelerator WHERE name LIKE \"%Opera%\"" ]
Which accelerator name contains substring "Opera"?
SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%"
browser_web
[ "What are the status of all the roller coasters?", "Give me the status of those longer than 3300.", "Also show those higher than 100." ]
[ "SELECT Status FROM roller_coaster", "SELECT Status FROM roller_coaster WHERE LENGTH > 3300", "SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100" ]
Show the statuses of roller coasters longer than 3300 or higher than 100.
SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100
roller_coaster
[ "What are name of all the roller coasters?", "Which of them is the longest?", "Give me its speed." ]
[ "SELECT name FROM Roller_coaster", "SELECT name FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1", "SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1" ]
What is the speed of the longest roller coaster?
SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
roller_coaster
[ "What are name of all the roller coasters?", "Give me their status.", "What is the most common status?" ]
[ "SELECT name FROM Roller_coaster", "SELECT name,status FROM Roller_coaster", "SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1" ]
Please show the most common status of roller coasters.
SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
roller_coaster
[ "What are name of all the roller coasters?", "Give me their status.", "Show me the those that are shared by more than two roller coasters." ]
[ "SELECT name FROM Roller_coaster", "SELECT name,status FROM Roller_coaster", "SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2" ]
List the status shared by more than two roller coasters.
SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2
roller_coaster
[ "What are name of all the roller coasters?", "Give me their speed.", "Which one is the highest?", "Show me its park." ]
[ "SELECT name FROM Roller_coaster", "SELECT name,speed FROM Roller_coaster", "SELECT name,speed FROM Roller_coaster ORDER BY Speed DESC LIMIT 1", "SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1" ]
Show the park of the roller coaster with the highest speed.
SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
roller_coaster
[ "What countries are there that have roller coasters?", "Give me those that have more than one roller coaster." ]
[ "SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID", "SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1" ]
Show the names of countries that have more than one roller coaster.
SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1
roller_coaster
[ "What are name of all the roller coasters?", "Give me their height.", "Which one is the highest?", "Show me the name and population of the country that has it." ]
[ "SELECT name FROM Roller_coaster", "SELECT name,height FROM Roller_coaster", "SELECT name,height FROM Roller_coaster ORDER BY height DESC LIMIT 1", "SELECT T1.Name , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1" ]
Show the name and population of the country that has the highest roller coaster.
SELECT T1.Name , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1
roller_coaster
[ "Show the names of countries that have more than one roller coaster.", "What are the speed of all roller coasters?", "Give me a average of them in term of different countries." ]
[ "SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID", "SELECT name, speed FROM roller_coaster", "SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID" ]
Show the names of countries and the average speed of roller coasters from each country.
SELECT T1.Name , avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name
roller_coaster
[ "What are name of all the roller coasters?", "Give me their length.", "Show me the roller coasters that are longer than 3000.", "How many countries do not have any of them?" ]
[ "SELECT name FROM Roller_coaster", "SELECT name,length FROM Roller_coaster", "SELECT name,length FROM Roller_coaster where length > 3000", "SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000 )" ]
How many countries do not have an roller coaster longer than 3000?
SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000 )
roller_coaster
[ "how many students are below age 25?", "how many of them are female (sex is F)?" ]
[ "SELECT count(*) FROM student WHERE age < 25", "SELECT count(*) FROM student WHERE sex = 'F' AND age < 25" ]
How many female students (sex is F) whose age is below 25?
SELECT count(*) FROM student WHERE sex = 'F' AND age < 25
dorm_1
[ "what are the codes of all different cities where students are from?", "how many students are living in city PHL?", "among them, how many are between ages 20 and 25?", "show their first names." ]
[ "SELECT distinct city_code FROM student", "SELECT count(*) FROM student WHERE city_code = 'PHL'", "SELECT count(*) FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25", "SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25" ]
Find the first name of students living in city PHL whose age is between 20 and 25.
SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25
dorm_1
[ "what are the different gender types of all dorms?", "show student capacity of the dorms with gender X.", "what is their average capacity?", "how about the total as well?" ]
[ "SELECT distinct gender FROM dorm", "SELECT student_capacity FROM dorm WHERE gender = 'X'", "SELECT avg(student_capacity) FROM dorm WHERE gender = 'X'", "SELECT avg(student_capacity) , sum(student_capacity) FROM dorm WHERE gender = 'X'" ]
Find the average and total capacity of dorms for the students with gender X.
SELECT avg(student_capacity) , sum(student_capacity) FROM dorm WHERE gender = 'X'
dorm_1
[ "list all dorm amenities.", "Find the names of dorms that have some of these amenities.", "Find the names of dorms that do not have any amenities." ]
[ "SELECT amenity_name FROM Dorm_amenity", "SELECT dorm_name FROM dorm WHERE dormid IN (SELECT dormid FROM has_amenity)", "SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)" ]
Find the name of dorms that do not have any amenity.
SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)
dorm_1
[ "show the names of all dorms.", "just list the dorm whose name has substring ‘Donor’.", "what is its capacity and gender type?" ]
[ "SELECT dorm_name FROM dorm", "SELECT dorm_name FROM dorm WHERE dorm_name LIKE '%Donor%'", "SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'" ]
Find the capacity and gender type of the dorm whose name has substring ‘Donor’.
SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'
dorm_1
[ "Find the name and gender type of all dorms.", "which of them have a capacity greater than 300?", "also show the dorms with a capacity less than 100." ]
[ "SELECT dorm_name, gender FROM dorm", "SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300", "SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100" ]
Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.
SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100
dorm_1
[ "show the info of all students.", "how many distinct majors are there?", "also count the number of different cities." ]
[ "SELECT * FROM student", "SELECT count(DISTINCT major) FROM student", "SELECT count(DISTINCT major), count(DISTINCT city_code) FROM student" ]
Find the numbers of different majors and cities.
SELECT count(DISTINCT major), count(DISTINCT city_code) FROM student
dorm_1
[ "what are the names of all dorms?", "what are all of the different amenities?", "Find the names of dorms that have a TV Lounge.", "how about those that also have a Study Room?" ]
[ "SELECT dorm_name FROM dorm", "SELECT \tamenity_name FROM dorm_amenity", "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'", "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'" ]
Find the name of dorms which have both TV Lounge and Study Room as amenities.
SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'
dorm_1
[ "find the names of dorms that do not have a Study Room.", "among them, which ones have a TV Lounge?" ]
[ "SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'", "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'" ]
Find the name of dorms which have TV Lounge but no Study Room as amenity.
SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'
dorm_1
[ "how many female students are living in the city of code BAL?", "how many male students are less than 20 years old?", "what is the total number of students in these two groups?", "what are their last names?" ]
[ "SELECT count(*) FROM student WHERE sex = 'F' AND city_code = 'BAL'", "SELECT count(*) FROM student WHERE sex = 'M' AND age < 20", "SELECT count(*) FROM (SELECT * FROM student WHERE sex = 'M' AND age < 20 UNION SELECT * FROM student WHERE sex = 'F' AND city_code = 'BAL')", "SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20" ]
Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.
SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20
dorm_1
[ "find the total student capacity of all dorms.", "which dorm has the largest capacity?", "just list its name." ]
[ "SELECT sum(student_capacity) FROM dorm", "SELECT * FROM dorm ORDER BY student_capacity", "SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1" ]
Find the name of the dorm with the largest capacity.
SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
dorm_1
[ "how many students are there?", "which cities are they living in?", "Find the code of the city where most of them are living." ]
[ "SELECT count(*) FROM student", "SELECT DISTINCT city_code FROM student", "SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1" ]
Find the code of city where most of students are living in.
SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1
dorm_1
[ "show the first and last name of all students.", "what are their ages?", "what is the average age?", "list the students whose age is younger than that. List their first and last names." ]
[ "SELECT fname , lname FROM student", "SELECT fname , lname, age FROM student", "SELECT avg(age) FROM student", "SELECT fname , lname FROM student WHERE age < (SELECT avg(age) FROM student)" ]
Find the first and last name of students whose age is younger than the average age.
SELECT fname , lname FROM student WHERE age < (SELECT avg(age) FROM student)
dorm_1
[ "show the codes of all different cities where students are living.", "find the number of students who are not living in the city with code HKG.", "what are their first and last names?", "sort the result by their ages." ]
[ "SELECT distinct city_code FROM student", "SELECT count(*) FROM student WHERE city_code != 'HKG'", "SELECT fname, lname FROM student WHERE city_code != 'HKG'", "SELECT fname, lname FROM student WHERE city_code != 'HKG' ORDER BY age" ]
List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.
SELECT fname, lname FROM student WHERE city_code != 'HKG' ORDER BY age
dorm_1
[ "list the info of all dorms.", "what is the capacity of Anonymous Donor Hall?", "List all of the amenities that it has.", "sort the results in alphabetic order." ]
[ "SELECT * FROM dorm", "SELECT student_capacity FROM dorm WHERE dorm_name = 'Anonymous Donor Hall'", "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall'", "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name" ]
List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name
dorm_1
[ "find the total number of dorms.", "what is the total student capacity of all dorms?", "how about for each gender?", "also show the number of dorms for each gender." ]
[ "SELECT count(*) FROM dorm", "SELECT sum(student_capacity) FROM dorm", "SELECT sum(student_capacity) , gender FROM dorm GROUP BY gender", "SELECT count(*) , sum(student_capacity) , gender FROM dorm GROUP BY gender" ]
Find the number of dorms and total capacity for each gender.
SELECT count(*) , sum(student_capacity) , gender FROM dorm GROUP BY gender
dorm_1
[ "how many students of each gender are there?", "Find the average and oldest age for each gender." ]
[ "SELECT count(*), sex FROM student GROUP BY sex", "SELECT avg(age) , max(age) , sex FROM student GROUP BY sex" ]
Find the average and oldest age for students with different sex.
SELECT avg(age) , max(age) , sex FROM student GROUP BY sex
dorm_1