target-benchmark/spider-queries huggingface dataset:
Database: swimming (tables: stadium)
Question: How many stadiums are not in country "Russia"?
SQL: SELECT count(*) FROM stadium WHERE country != 'Russia'
Database: swimming (tables: swimmer)
Question: Find the names of all swimmers, sorted by their 100 meter scores in ascending order.
SQL: SELECT name FROM swimmer ORDER BY meter_100
Database: swimming (tables: swimmer)
Question: How many different countries are all the swimmers from?
SQL: SELECT count(DISTINCT nationality) FROM swimmer
Database: swimming (tables: swimmer)
Question: List countries that have more than one swimmer.
SQL: SELECT nationality ,  count(*) FROM swimmer GROUP BY nationality HAVING count(*)  >  1
Database: swimming (tables: swimmer)
Question: Find all 200 meter and 300 meter results of swimmers with nationality "Australia".
SQL: SELECT meter_200 ,  meter_300 FROM swimmer WHERE nationality  =  'Australia'
Database: swimming (tables: swimmer, record)
Question: Find the names of swimmers who has a result of "win".
SQL: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id WHERE RESULT  =  'Win'
Database: swimming (tables: stadium, event)
Question: What is the name of the stadium which held the most events?
SQL: SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id  =  t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1
Database: swimming (tables: stadium, event)
Question: Find the name and capacity of the stadium where the event named "World Junior" happened.
SQL: SELECT t1.name ,  t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id  =  t2.stadium_id WHERE t2.name  =  'World Junior'
Database: swimming (tables: stadium, event)
Question: Find the names of stadiums which have never had any event.
SQL: SELECT name FROM stadium WHERE id NOT IN (SELECT stadium_id FROM event)
Database: swimming (tables: swimmer, record)
Question: Find the name of the swimmer who has the most records.
SQL: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY count(*) DESC LIMIT 1
Database: swimming (tables: swimmer, record)
Question: Find the name of the swimmer who has at least 2 records.
SQL: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id GROUP BY t2.swimmer_id HAVING count(*)  >=  2
Database: swimming (tables: swimmer, record)
Question: Find the name and nationality of the swimmer who has won (i.e., has a result of "win") more than 1 time.
SQL: SELECT t1.name ,  t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id WHERE RESULT  =  'Win' GROUP BY t2.swimmer_id HAVING count(*)  >  1
Database: swimming (tables: swimmer, record)
Question: Find the names of the swimmers who have no record.
SQL: SELECT name FROM swimmer WHERE id NOT IN (SELECT swimmer_id FROM record)
Database: swimming (tables: swimmer, record)
Question: Find the names of the swimmers who have both "win" and "loss" results in the record.
SQL: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id WHERE RESULT  =  'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id WHERE RESULT  =  'Loss'
Database: swimming (tables: swimmer, record, stadium, event)
Question: Find the names of stadiums that some Australian swimmers have been to.
SQL: SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id JOIN event AS t3 ON t2.event_id  =  t3.id JOIN stadium AS t4 ON t4.id  =  t3.stadium_id WHERE t1.nationality  =  'Australia'
Database: swimming (tables: stadium, record, event)
Question: Find the names of stadiums that the most swimmers have been to.
SQL: SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id  =  t2.id JOIN stadium AS t3 ON t3.id  =  t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1
Database: swimming (tables: swimmer)
Question: Find all details for each swimmer.
SQL: SELECT * FROM swimmer
Database: swimming (tables: stadium)
Question: What is the average capacity of the stadiums that were opened in year 2005?
SQL: SELECT avg(capacity) FROM stadium WHERE opening_year  =  2005
Database: railway (tables: railway)
Question: How many railways are there?
SQL: SELECT count(*) FROM railway
Database: railway (tables: railway)
Question: List the builders of railways in ascending alphabetical order.
SQL: SELECT Builder FROM railway ORDER BY Builder ASC
Database: railway (tables: railway)
Question: List the wheels and locations of the railways.
SQL: SELECT Wheels ,  LOCATION FROM railway
Database: railway (tables: manager)
Question: What is the maximum level of managers in countries that are not "Australia"?
SQL: SELECT max(LEVEL) FROM manager WHERE Country != "Australia	"
Database: railway (tables: manager)
Question: What is the average age for all managers?
SQL: SELECT avg(Age) FROM manager
Database: railway (tables: manager)
Question: What are the names of managers in ascending order of level?
SQL: SELECT Name FROM manager ORDER BY LEVEL ASC
Database: railway (tables: train)
Question: What are the names and arrival times of trains?
SQL: SELECT Name ,  Arrival FROM train
Database: railway (tables: manager)
Question: What is the name of the oldest manager?
SQL: SELECT Name FROM manager ORDER BY Age DESC LIMIT 1
Database: railway (tables: train, railway)
Question: Show the names of trains and locations of railways they are in.
SQL: SELECT T2.Name ,  T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID
Database: railway (tables: train, railway)
Question: Show the builder of railways associated with the trains named "Andaman Exp".
SQL: SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID WHERE T2.Name  =  "Andaman Exp"
Database: railway (tables: train, railway)
Question: Show id and location of railways that are associated with more than one train.
SQL: SELECT T2.Railway_ID ,  T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*)  >  1
Database: railway (tables: train, railway)
Question: Show the id and builder of the railway that are associated with the most trains.
SQL: SELECT T2.Railway_ID ,  T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1
Database: railway (tables: railway)
Question: Show different builders of railways, along with the corresponding number of railways using each builder.
SQL: SELECT Builder ,  COUNT(*) FROM railway GROUP BY Builder
Database: railway (tables: railway)
Question: Show the most common builder of railways.
SQL: SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1
Database: railway (tables: railway)
Question: Show different locations of railways along with the corresponding number of railways at each location.
SQL: SELECT LOCATION ,  COUNT(*) FROM railway GROUP BY LOCATION
Database: railway (tables: railway)
Question: Show the locations that have more than one railways.
SQL: SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*)  >  1
Database: railway (tables: train, railway)
Question: List the object number of railways that do not have any trains.
SQL: SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train)
Database: railway (tables: manager)
Question: Show the countries that have both managers of age above 50 and managers of age below 46.
SQL: SELECT Country FROM manager WHERE Age  >  50 INTERSECT SELECT Country FROM manager WHERE Age  <  46
Database: railway (tables: manager)
Question: Show the distinct countries of managers.
SQL: SELECT DISTINCT Country FROM manager
Database: railway (tables: manager)
Question: Show the working years of managers in descending order of their level.
SQL: SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC
Database: railway (tables: manager)
Question: Show the countries that have managers of age above 50 or below 46.
SQL: SELECT Country FROM manager WHERE Age  >  50 OR Age  <  46
Database: customers_and_products_contacts (tables: addresses)
Question: How many addresses are there in country USA?
SQL: SELECT count(*) FROM addresses WHERE country  =  'USA'
Database: customers_and_products_contacts (tables: addresses)
Question: Show all distinct cities in the address record.
SQL: SELECT DISTINCT city FROM addresses
Database: customers_and_products_contacts (tables: addresses)
Question: Show each state and the number of addresses in each state.
SQL: SELECT state_province_county ,  count(*) FROM addresses GROUP BY state_province_county
Database: customers_and_products_contacts (tables: customer_address_history, customers)
Question: Show names and phones of customers who do not have address information.
SQL: SELECT customer_name ,  customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM customer_address_history)
Database: customers_and_products_contacts (tables: customer_orders, customers)
Question: Show the name of the customer who has the most orders.
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_and_products_contacts (tables: products)
Question: Show the product type codes which have at least two products.
SQL: SELECT product_type_code FROM products GROUP BY product_type_code HAVING count(*)  >=  2
Database: customers_and_products_contacts (tables: customer_orders, customers)
Question: Show the names of customers who have both an order in completed status and an order in part status.
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  'Part'
Database: customers_and_products_contacts (tables: customers)
Question: Show the name, phone, and payment method code for all customers in descending order of customer number.
SQL: SELECT customer_name ,  customer_phone ,  payment_method_code FROM customers ORDER BY customer_number DESC
Database: customers_and_products_contacts (tables: products, order_items)
Question: Show the product name and total order quantity for each product.
SQL: SELECT T1.product_name ,  sum(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.product_id
Database: customers_and_products_contacts (tables: products)
Question: Show the minimum, maximum, average price for all products.
SQL: SELECT min(product_price) ,  max(product_price) ,  avg(product_price) FROM products
Database: customers_and_products_contacts (tables: products)
Question: How many products have a price higher than the average?
SQL: SELECT count(*) FROM products WHERE product_price  >  (SELECT avg(product_price) FROM products)
Database: customers_and_products_contacts (tables: addresses, customer_address_history, customers)
Question: Show the customer name, customer address city, date from, and date to for each customer address history.
SQL: SELECT T2.customer_name ,  T3.city ,  T1.date_from ,  T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.customer_id JOIN addresses AS T3 ON T1.address_id  =  T3.address_id
Database: customers_and_products_contacts (tables: customer_orders, customers)
Question: Show the names of customers who use Credit Card payment method and have more than 2 orders.
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.payment_method_code  =  'Credit Card' GROUP BY T1.customer_id HAVING count(*)  >  2
Database: customers_and_products_contacts (tables: customer_orders, customers, order_items)
Question: What are the name and phone of the customer with the most ordered product quantity?
SQL: SELECT  T1.customer_name ,  T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T3.order_id  =  T2.order_id GROUP BY T1.customer_id ORDER BY sum(T3.order_quantity) DESC LIMIT 1
Database: customers_and_products_contacts (tables: products)
Question: Show the product type and name for the products with price higher than 1000 or lower than 500.
SQL: SELECT product_type_code ,  product_name FROM products WHERE product_price  >  1000 OR product_price  <  500
Database: dorm_1 (tables: dorm)
Question: Find the name of dorms only for female (F gender).
SQL: SELECT dorm_name FROM dorm WHERE gender  =  'F'
Database: dorm_1 (tables: dorm)
Question: What are the names of the all-female dorms?
SQL: SELECT dorm_name FROM dorm WHERE gender  =  'F'
Database: dorm_1 (tables: dorm)
Question: Find the name of dorms that can accommodate more than 300 students.
SQL: SELECT dorm_name FROM dorm WHERE student_capacity  >  300
Database: dorm_1 (tables: dorm)
Question: What are the names of all the dorms that can accomdate more than 300 students?
SQL: SELECT dorm_name FROM dorm WHERE student_capacity  >  300
Database: dorm_1 (tables: student)
Question: How many female students (sex is F) whose age is below 25?
SQL: SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25
Database: dorm_1 (tables: student)
Question: How many girl students who are younger than 25?
SQL: SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25
Database: dorm_1 (tables: student)
Question: Find the first name of students who is older than 20.
SQL: SELECT fname FROM student WHERE age  >  20
Database: dorm_1 (tables: student)
Question: What are the first names of all students who are older than 20?
SQL: SELECT fname FROM student WHERE age  >  20
Database: dorm_1 (tables: student)
Question: Find the first name of students living in city PHL whose age is between 20 and 25.
SQL: SELECT fname FROM student WHERE city_code  =  'PHL' AND age BETWEEN 20 AND 25
Database: dorm_1 (tables: student)
Question: What is the first name of the students who are in age 20 to 25 and living in PHL city?
SQL: SELECT fname FROM student WHERE city_code  =  'PHL' AND age BETWEEN 20 AND 25
Database: dorm_1 (tables: dorm)
Question: How many dorms are there?
SQL: SELECT count(*) FROM dorm
Database: dorm_1 (tables: dorm)
Question: How many dorms are in the database?
SQL: SELECT count(*) FROM dorm
Database: dorm_1 (tables: dorm_amenity)
Question: Find the number of distinct amenities.
SQL: SELECT count(*) FROM dorm_amenity
Database: dorm_1 (tables: dorm_amenity)
Question: How many diffrent dorm amenities are there?
SQL: SELECT count(*) FROM dorm_amenity
Database: dorm_1 (tables: dorm)
Question: Find the total capacity of all dorms.
SQL: SELECT sum(student_capacity) FROM dorm
Database: dorm_1 (tables: dorm)
Question: What is the total student capacity of all dorms?
SQL: SELECT sum(student_capacity) FROM dorm
Database: dorm_1 (tables: student)
Question: How many students are there?
SQL: SELECT count(*) FROM student
Database: dorm_1 (tables: student)
Question: How many students exist?
SQL: SELECT count(*) FROM student
Database: dorm_1 (tables: student)
Question: Find the average age of all students living in the each city.
SQL: SELECT avg(age) ,  city_code FROM student GROUP BY city_code
Database: dorm_1 (tables: student)
Question: What is the average age for each city and what are those cities?
SQL: SELECT avg(age) ,  city_code FROM student GROUP BY city_code
Database: dorm_1 (tables: dorm)
Question: Find the average and total capacity of dorms for the students with gender X.
SQL: SELECT avg(student_capacity) ,  sum(student_capacity) FROM dorm WHERE gender  =  'X'
Database: dorm_1 (tables: dorm)
Question: What is the average and total capacity for all dorms who are of gender X?
SQL: SELECT avg(student_capacity) ,  sum(student_capacity) FROM dorm WHERE gender  =  'X'
Database: dorm_1 (tables: has_amenity)
Question: Find the number of dorms that have some amenity.
SQL: SELECT count(DISTINCT dormid) FROM has_amenity
Database: dorm_1 (tables: has_amenity)
Question: How many dorms have amenities?
SQL: SELECT count(DISTINCT dormid) FROM has_amenity
Database: dorm_1 (tables: has_amenity, dorm)
Question: Find the name of dorms that do not have any amenity
SQL: SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)
Database: dorm_1 (tables: has_amenity, dorm)
Question: What are the names of all the dorms that don't have any amenities?
SQL: SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)
Database: dorm_1 (tables: dorm)
Question: Find the number of distinct gender for dorms.
SQL: SELECT count(DISTINCT gender) FROM dorm
Database: dorm_1 (tables: dorm)
Question: How many different genders are there in the dorms?
SQL: SELECT count(DISTINCT gender) FROM dorm
Database: dorm_1 (tables: dorm)
Question: Find the capacity and gender type of the dorm whose name has substring ‘Donor’.
SQL: SELECT student_capacity ,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'
Database: dorm_1 (tables: dorm)
Question: What is the student capacity and type of gender for the dorm whose name as the phrase Donor in it?
SQL: SELECT student_capacity ,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'
Database: dorm_1 (tables: dorm)
Question: Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.
SQL: SELECT dorm_name ,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
Database: dorm_1 (tables: dorm)
Question: What are the names and types of the dorms that have a capacity greater than 300 or less than 100?
SQL: SELECT dorm_name ,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
Database: dorm_1 (tables: student)
Question: Find the numbers of different majors and cities.
SQL: SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student
Database: dorm_1 (tables: student)
Question: How many different majors are there and how many different city codes are there for each student?
SQL: SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student
Database: dorm_1 (tables: has_amenity, dorm, dorm_amenity)
Question: Find the name of dorms which have both TV Lounge and Study Room as amenities.
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 (tables: has_amenity, dorm, dorm_amenity)
Question: What is the name of the dorm with both a TV Lounge and Study Room listed as amenities?
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 (tables: has_amenity, dorm, dorm_amenity)
Question: Find the name of dorms which have TV Lounge but no Study Room as amenity.
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 (tables: has_amenity, dorm, dorm_amenity)
Question: What is the name of each dorm that has a TV Lounge but no study rooms?
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 (tables: student)
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.
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 (tables: student)
Question: What is the last name of every student who is either female or living in a city with the code BAL or male and under 20?
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 (tables: dorm)
Question: Find the name of the dorm with the largest capacity.
SQL: SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
Database: dorm_1 (tables: dorm)
Question: What are the names of the dorm with the largest capacity?
SQL: SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
Database: dorm_1 (tables: dorm_amenity)
Question: List in alphabetic order all different amenities.
SQL: SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name
Database: dorm_1 (tables: dorm_amenity)
Question: What are the different dorm amenity names in alphabetical order?
SQL: SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name
Database: dorm_1 (tables: student)
Question: Find the code of city where most of students are living in.
SQL: SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1
Database: dorm_1 (tables: student)
Question: What is the code of the city with the most students?
SQL: SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1
Database: dorm_1 (tables: student)
Question: Find the first and last name of students whose age is younger than the average age.
SQL: SELECT fname ,  lname FROM student WHERE age  <  (SELECT avg(age) FROM student)
Database: dorm_1 (tables: student)
Question: What is the first and last name of all students who are younger than average?
SQL: SELECT fname ,  lname FROM student WHERE age  <  (SELECT avg(age) FROM student)
Database: dorm_1 (tables: student)
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.
SQL: SELECT fname ,  lname FROM student WHERE city_code != 'HKG' ORDER BY age
Database: dorm_1 (tables: student)
Question: What are the first and last names of all students who are not living in the city HKG and order the results by age?
SQL: SELECT fname ,  lname FROM student WHERE city_code != 'HKG' ORDER BY age
Database: dorm_1 (tables: has_amenity, dorm, dorm_amenity)
Question: List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.
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 (tables: has_amenity, dorm, dorm_amenity)
Question: What are the amenities in alphabetical order that Anonymous Donor Hall has?
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 (tables: dorm)
Question: Find the number of dorms and total capacity for each gender.
SQL: SELECT count(*) ,  sum(student_capacity) ,  gender FROM dorm GROUP BY gender
Database: dorm_1 (tables: dorm)
Question: How many dorms are there and what is the total capacity for each gender?
SQL: SELECT count(*) ,  sum(student_capacity) ,  gender FROM dorm GROUP BY gender
Database: dorm_1 (tables: student)
Question: Find the average and oldest age for students with different sex.
SQL: SELECT avg(age) ,  max(age) ,  sex FROM student GROUP BY sex
Database: dorm_1 (tables: student)
Question: What is the average and oldest age for each gender of student?
SQL: SELECT avg(age) ,  max(age) ,  sex FROM student GROUP BY sex
Database: dorm_1 (tables: student)
Question: Find the number of students in each major.
SQL: SELECT count(*) ,  major FROM student GROUP BY major