aherntech/sparc huggingface dataset:
Database: architecture
Question sequence:
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?
SQL query sequence:
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
Final question: What is the most common mill type, and how many are there?
Final SQL: SELECT TYPE ,  count(*) FROM mill GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Database: architecture
Question sequence:
Count the total number of architects.
How many have built a mill?
How many did not build a mill before 1850?
SQL query sequence:
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 )
Final question: How many architects haven't built a mill before year 1850?
Final SQL: SELECT count(*) FROM architect WHERE id NOT IN ( SELECT architect_id FROM mill WHERE built_year  <  1850 );
Database: school_player
Question sequence:
What are the locations of each school ordered in the date founded, oldest first?
Actually, order the result in ascending order of enrollment.
SQL query sequence:
SELECT LOCATION FROM school ORDER BY Founded ASC;
SELECT LOCATION FROM school ORDER BY Enrollment ASC;
Final question: List the locations of schools in ascending order of enrollment.
Final SQL: SELECT LOCATION FROM school ORDER BY Enrollment ASC
Database: school_player
Question sequence:
What are the locations of each school?
Order the result in descending order of founded year.
SQL query sequence:
SELECT LOCATION FROM school;
SELECT LOCATION FROM school ORDER BY Founded DESC;
Final question: List the locations of schools in descending order of founded year.
Final SQL: SELECT LOCATION FROM school ORDER BY Founded DESC;
Database: school_player
Question sequence:
What is the denomination of each school?
What are the enrollments of schools whose denomination is "Catholic"?
How about non-Catholic?
SQL query sequence:
SELECT Denomination FROM school;
SELECT Enrollment FROM school WHERE Denomination = "Catholic";
SELECT Enrollment FROM school WHERE Denomination != "Catholic";
Final question: What are the enrollments of schools whose denomination is not "Catholic"?
Final SQL: SELECT Enrollment FROM school WHERE Denomination != "Catholic";
Database: school_player
Question sequence:
What is the combined total enrollment of all schools?
How about the maximum enrollment?
Show me the average enrollment.
SQL query sequence:
SELECT sum(Enrollment) FROM school;
SELECT Enrollment FROM school ORDER BY Enrollment LIMIT 1;
SELECT avg(Enrollment) FROM school;
Final question: What is the average enrollment of schools?
Final SQL: SELECT avg(Enrollment) FROM school;
Database: school_player
Question sequence:
What are the ages of the players?
Show their teams instead.
Sort the result in ascending alphabetical order.
SQL query sequence:
SELECT Age FROM player;
SELECT Team FROM player;
SELECT Team FROM player ORDER BY Team ASC;
Final question: What are the teams of the players, sorted in ascending alphabetical order?
Final SQL: SELECT Team FROM player ORDER BY Team ASC;
Database: school_player
Question sequence:
Show me all about each player.
Who is the oldest among them?
What's his team?
SQL query sequence:
SELECT * FROM player;
SELECT Player FROM player ORDER BY Age DESC LIMIT 1;
SELECT Team FROM player ORDER BY Age DESC LIMIT 1;
Final question: Find the team of the player of the highest age.
Final SQL: SELECT Team FROM player ORDER BY Age DESC LIMIT 1;
Database: school_player
Question sequence:
How many players are there?
What's their average age?
List the teams of the players with the top 5 largest ages.
SQL query sequence:
SELECT count(*) FROM player;
SELECT avg(Age) FROM player;
SELECT Team FROM player ORDER BY Age DESC LIMIT 5;
Final question: List the teams of the players with the top 5 largest ages.
Final SQL: SELECT Team FROM player ORDER BY Age DESC LIMIT 5;
Database: school_player
Question sequence:
Show me the location of each school.
For each player, show the location of the school they belong to.
Also provide, the team name.
SQL query sequence:
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;
Final question: For each player, show the team and the location of school they belong to.
Final SQL: SELECT T1.Team ,  T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID;
Database: school_player
Question sequence:
How many schools are there?
Show me their locations.
Which of them have more than 3 players?
How about more than 1 player?
SQL query sequence:
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;
Final question: Show the locations of schools that have more than 1 player.
Final SQL: 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;
Database: school_player
Question sequence:
Which school has the least number of players?
How about with the most players?
Show me the denomination of this school.
SQL query sequence:
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;
Final question: Show the denomination of the school that has the most players.
Final SQL: 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;
Database: school_player
Question sequence:
Show me the school details.
What's each school's color?
List the location and nickname of each school.
SQL query sequence:
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;
Final question: Show locations and nicknames of schools.
Final SQL: SELECT T1.Location ,  T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID  =  T2.School_ID;
Database: school_player
Question sequence:
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?
SQL query sequence:
SELECT Boys_or_Girls FROM school;
SELECT DISTINCT(Denomination) FROM school;
SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination;
Final question: Please show different denominations and the corresponding number of schools.
Final SQL: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination
Database: school_player
Question sequence:
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!
SQL query sequence:
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;
Final question: Please show different denominations and the corresponding number of schools in descending order.
Final SQL: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
Database: school_player
Question sequence:
What school has the largest enrollment?
What are its school colors?
SQL query sequence:
SELECT * FROM school ORDER BY Enrollment DESC LIMIT 1
SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
Final question: List the school color of the school that has the largest enrollment.
Final SQL: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
Database: school_player
Question sequence:
How many schools are there?
How many don't have any players?
Which ones don't have any players?
Show their locations.
SQL query sequence:
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);
Final question: List the locations of schools that do not have any player.
Final SQL: SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
Database: school_player
Question sequence:
Show the denominations of schools.
Also provide their founding year?
List the denomination shared by schools founded before 1890 and schools founded after 1900.
SQL query sequence:
SELECT Denomination FROM school;
SELECT Denomination, Founded FROM school;
SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900;
Final question: Show the denomination shared by schools founded before 1890 and schools founded after 1900
Final SQL: SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900;
Database: school_player
Question sequence:
Show me the school names in division 1.
How about those not in division 1?
List their nicknames.
SQL query sequence:
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";
Final question: Show the nicknames of schools that are not in division 1.
Final SQL: SELECT Nickname FROM school_details WHERE Division != "Division 1";
Database: store_product
Question sequence:
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?
SQL query sequence:
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
Final question: Find the list of page size which have more than 3 product listed
Final SQL: SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*) > 3
Database: store_product
Question sequence:
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.
SQL query sequence:
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
Final question: Find the name all districts with city area greater than 10 or population larger than 100000
Final SQL: SELECT district_name FROM district WHERE city_area  >  10 OR City_Population  >  100000
Database: store_product
Question sequence:
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?
SQL query sequence:
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
Final question: Which district has the largest population?
Final SQL: SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1
Database: store_product
Question sequence:
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?
SQL query sequence:
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)
Final question: Which district has the least area?
Final SQL: SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1
Database: store_product
Question sequence:
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?
SQL query sequence:
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"
Final question: Find the names of all stores in Khanewal District.
Final SQL: 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"
Database: store_product
Question sequence:
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?
SQL query sequence:
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)
Final question: Find all the stores in the district with the most population.
Final SQL: 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)
Database: store_product
Question sequence:
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?
SQL query sequence:
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"
Final question: Which city is the headquarter of the store named "Blackville" in?
Final SQL: 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"
Database: store_product
Question sequence:
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?
SQL query sequence:
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
Final question: Find the number of stores in each city.
Final SQL: 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
Database: store_product
Question sequence:
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?
SQL query sequence:
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
Final question: Find the city with the most number of stores.
Final SQL: 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
Database: store_product
Question sequence:
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"?
SQL query sequence:
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"
Final question: What products are available at store named "Miramichi"?
Final SQL: 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"
Database: store_product
Question sequence:
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"?
SQL query sequence:
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
Final question: Find products with max page size as "A4" and pages per minute color smaller than 5.
Final SQL: SELECT product FROM product WHERE max_page_size  =  "A4" AND pages_per_minute_color  <  5
Database: store_product
Question sequence:
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.
SQL query sequence:
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
Final question: Find products with max page size as "A4" or pages per minute color smaller than 5.
Final SQL: SELECT product FROM product WHERE max_page_size  =  "A4" OR pages_per_minute_color  <  5
Database: store_product
Question sequence:
List the available products.
Which of these products contains the word word "Canon"?
How about the word "Fujitsu"?
How about the word "Scanner"?
SQL query sequence:
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%"
Final question: Find all the product whose name contains the word "Scanner".
Final SQL: SELECT product FROM product WHERE product LIKE "%Scanner%"
Database: store_product
Question sequence:
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?
SQL query sequence:
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
Final question: Find the most prominent max page size among all the products.
Final SQL: SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1
Database: store_product
Question sequence:
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?
SQL query sequence:
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)
Final question: Find the name of the products that are not using the most frequently-used max page size.
Final SQL: 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)
Database: store_product
Question sequence:
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?
SQL query sequence:
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)
Final question: Find the total population of the districts where the area is bigger than the average city area.
Final SQL: SELECT sum(city_population) FROM district WHERE city_area  >  (SELECT avg(city_area) FROM district)
Database: network_2
Question sequence:
How old is Dan?
What city is she from?
Show all friends of Dan.
How many friends is this?
SQL query sequence:
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'
Final question: How many friends does Dan have?
Final SQL: SELECT count(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T1.name  =  'Dan'