aherntech/sparc huggingface dataset:
Database: browser_web
Question sequence:
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?
SQL query sequence:
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
Final question: What are the ids and names of the web accelerators that are compatible with two or more browsers?
Final SQL: 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
Database: browser_web
Question sequence:
Which browsers are compatible with some accelerator(s)?
Which is compatible with the most?
SQL query sequence:
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
Final question: What is the id and name of the browser that is compatible with the most web accelerators?
Final SQL: 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
Database: browser_web
Question sequence:
How many times did CACHEbox and Internet Explorer become compatible?
What year did they become compatible?
SQL query sequence:
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'
Final question: When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?
Final SQL: 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'
Database: browser_web
Question sequence:
Which accelerator ids are not compatible with any browsers?
Count those.
SQL query sequence:
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 );
Final question: How many accelerators are not compatible with the browsers listed ?
Final SQL: SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );
Database: browser_web
Question sequence:
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?
SQL query sequence:
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;
Final question: What distinct accelerator names are compatible with the browswers that have market share higher than 15?
Final SQL: 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;
Database: browser_web
Question sequence:
Which browser ids are compatible with CACHEbox?
Name those browsers.
Intersect that with those compatible with Fasterfox.
SQL query sequence:
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'
Final question: List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.
Final SQL: 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'
Database: browser_web
Question sequence:
Which accelerator ids are not compatible with Opera?
For these, show the names and supporting operating systems.
SQL query sequence:
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'
Final question: Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.
Final SQL: 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'
Database: browser_web
Question sequence:
Which accelerator name contains substring "Free"?
How about "Opera"
SQL query sequence:
SELECT name FROM web_client_accelerator WHERE name LIKE "%Free%"
SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%"
Final question: Which accelerator name contains substring "Opera"?
Final SQL: SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%"
Database: roller_coaster
Question sequence:
What are the status of all the roller coasters?
Give me the status of those longer than 3300.
Also show those higher than 100.
SQL query sequence:
SELECT Status FROM roller_coaster
SELECT Status FROM roller_coaster WHERE LENGTH  >  3300
SELECT Status FROM roller_coaster WHERE LENGTH  >  3300 OR Height  >  100
Final question: Show the statuses of roller coasters longer than 3300 or higher than 100.
Final SQL: SELECT Status FROM roller_coaster WHERE LENGTH  >  3300 OR Height  >  100
Database: roller_coaster
Question sequence:
What are name of all the roller coasters?
Which of them is the longest?
Give me its speed.
SQL query sequence:
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
Final question: What is the speed of the longest roller coaster?
Final SQL: SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
Database: roller_coaster
Question sequence:
What are name of all the roller coasters?
Give me their status.
What is the most common status?
SQL query sequence:
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
Final question: Please show the most common status of roller coasters.
Final SQL: SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
Database: roller_coaster
Question sequence:
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.
SQL query sequence:
SELECT name FROM Roller_coaster
SELECT name,status FROM Roller_coaster
SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*)  >  2
Final question: List the status shared by more than two roller coasters.
Final SQL: SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*)  >  2
Database: roller_coaster
Question sequence:
What are name of all the roller coasters?
Give me their speed.
Which one is the highest?
Show me its park.
SQL query sequence:
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
Final question: Show the park of the roller coaster with the highest speed.
Final SQL: SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
Database: roller_coaster
Question sequence:
What countries are there that have roller coasters?
Give me those that have more than one roller coaster.
SQL query sequence:
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
Final question: Show the names of countries that have more than one roller coaster.
Final SQL: 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
Database: roller_coaster
Question sequence:
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.
SQL query sequence:
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
Final question: Show the name and population of the country that has the highest roller coaster.
Final SQL: 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
Database: roller_coaster
Question sequence:
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.
SQL query sequence:
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
Final question: Show the names of countries and the average speed of roller coasters from each country.
Final SQL: 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
Database: roller_coaster
Question sequence:
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?
SQL query sequence:
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 )
Final question: How many countries do not have an roller coaster longer than 3000?
Final SQL: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 )
Database: dorm_1
Question sequence:
how many students are below age 25?
how many of them are female (sex is F)?
SQL query sequence:
SELECT count(*) FROM student WHERE age  <  25
SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25
Final question: How many female students (sex is F) whose age is below 25?
Final SQL: SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25
Database: dorm_1
Question sequence:
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.
SQL query sequence:
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
Final question: Find the first name of students living in city PHL whose age is between 20 and 25.
Final SQL: SELECT fname FROM student WHERE city_code  =  'PHL' AND age BETWEEN 20 AND 25
Database: dorm_1
Question sequence:
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?
SQL query sequence:
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'
Final question: Find the average and total capacity of dorms for the students with gender X.
Final SQL: SELECT avg(student_capacity) ,  sum(student_capacity) FROM dorm WHERE gender  =  'X'
Database: dorm_1
Question sequence:
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.
SQL query sequence:
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)
Final question: Find the name of dorms that do not have any amenity.
Final SQL: SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)
Database: dorm_1
Question sequence:
show the names of all dorms.
just list the dorm whose name has substring ‘Donor’.
what is its capacity and gender type?
SQL query sequence:
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%'
Final question: Find the capacity and gender type of the dorm whose name has substring ‘Donor’.
Final SQL: SELECT student_capacity,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'
Database: dorm_1
Question sequence:
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.
SQL query sequence:
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
Final question: Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.
Final SQL: SELECT dorm_name,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
Database: dorm_1
Question sequence:
show the info of all students.
how many distinct majors are there?
also count the number of different cities.
SQL query sequence:
SELECT * FROM student
SELECT count(DISTINCT major) FROM student
SELECT count(DISTINCT major),  count(DISTINCT city_code) FROM student
Final question: Find the numbers of different majors and cities.
Final SQL: SELECT count(DISTINCT major),  count(DISTINCT city_code) FROM student
Database: dorm_1
Question sequence:
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?
SQL query sequence:
SELECT dorm_name FROM dorm
SELECT 	amenity_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'
Final question: Find the name of dorms which have both TV Lounge and Study Room as amenities.
Final SQL: 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'
Database: dorm_1
Question sequence:
find the names of dorms that do not have a Study Room.
among them, which ones have a TV Lounge?
SQL query sequence:
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'
Final question: Find the name of dorms which have TV Lounge but no Study Room as amenity.
Final SQL: 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'
Database: dorm_1
Question sequence:
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?
SQL query sequence:
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
Final question: Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.
Final SQL: SELECT lname FROM student WHERE sex  =  'F' AND city_code  =  'BAL' UNION SELECT lname FROM student WHERE sex  =  'M' AND age  <  20
Database: dorm_1
Question sequence:
find the total student capacity of all dorms.
which dorm has the largest capacity?
just list its name.
SQL query sequence:
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
Final question: Find the name of the dorm with the largest capacity.
Final SQL: SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
Database: dorm_1
Question sequence:
how many students are there?
which cities are they living in?
Find the code of the city where most of them are living.
SQL query sequence:
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
Final question: Find the code of city where most of students are living in.
Final SQL: SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1
Database: dorm_1
Question sequence:
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.
SQL query sequence:
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)
Final question: Find the first and last name of students whose age is younger than the average age.
Final SQL: SELECT fname ,  lname FROM student WHERE age  <  (SELECT avg(age) FROM student)
Database: dorm_1
Question sequence:
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.
SQL query sequence:
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
Final question: List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.
Final SQL: SELECT fname,  lname FROM student WHERE city_code != 'HKG' ORDER BY age
Database: dorm_1
Question sequence:
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.
SQL query sequence:
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
Final question: List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.
Final SQL: 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
Database: dorm_1
Question sequence:
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.
SQL query sequence:
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
Final question: Find the number of dorms and total capacity for each gender.
Final SQL: SELECT count(*) ,  sum(student_capacity) ,  gender FROM dorm GROUP BY gender
Database: dorm_1
Question sequence:
how many students of each gender are there?
Find the average and oldest age for each gender.
SQL query sequence:
SELECT count(*),  sex FROM student GROUP BY sex
SELECT avg(age) ,  max(age) ,  sex FROM student GROUP BY sex
Final question: Find the average and oldest age for students with different sex.
Final SQL: SELECT avg(age) ,  max(age) ,  sex FROM student GROUP BY sex
Database: dorm_1
Question sequence:
how many different cities are there?
find the number of students living in each city.
also find the average age of students living in each city.
SQL query sequence:
SELECT count(distinct city_code) FROM student
SELECT count(*), city_code FROM student GROUP BY city_code
SELECT count(*) ,  avg(age) ,  city_code FROM student GROUP BY city_code
Final question: Find the number and average age of students living in each city.
Final SQL: SELECT count(*) ,  avg(age) ,  city_code FROM student GROUP BY city_code