minktn/spider-data huggingface dataset:
Database: swimming
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
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
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
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
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
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
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
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
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
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
Question: Find all details for each swimmer.
SQL: SELECT * FROM swimmer
Database: swimming
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
Question: How many railways are there?
SQL: SELECT count(*) FROM railway
Database: railway
Question: List the builders of railways in ascending alphabetical order.
SQL: SELECT Builder FROM railway ORDER BY Builder ASC
Database: railway
Question: List the wheels and locations of the railways.
SQL: SELECT Wheels ,  LOCATION FROM railway
Database: railway
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
Question: What is the average age for all managers?
SQL: SELECT avg(Age) FROM manager
Database: railway
Question: What are the names of managers in ascending order of level?
SQL: SELECT Name FROM manager ORDER BY LEVEL ASC
Database: railway
Question: What are the names and arrival times of trains?
SQL: SELECT Name ,  Arrival FROM train
Database: railway
Question: What is the name of the oldest manager?
SQL: SELECT Name FROM manager ORDER BY Age DESC LIMIT 1
Database: 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
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
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
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
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
Question: Show the most common builder of railways.
SQL: SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1
Database: 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
Question: Show the locations that have more than one railways.
SQL: SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*)  >  1
Database: 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
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
Question: Show the distinct countries of managers.
SQL: SELECT DISTINCT Country FROM manager
Database: railway
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
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
Question: How many addresses are there in country USA?
SQL: SELECT count(*) FROM addresses WHERE country  =  'USA'
Database: customers_and_products_contacts
Question: Show all distinct cities in the address record.
SQL: SELECT DISTINCT city FROM addresses
Database: customers_and_products_contacts
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
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
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
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
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
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
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
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
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
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
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
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
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
Question: Find the name of dorms only for female (F gender).
SQL: SELECT dorm_name FROM dorm WHERE gender  =  'F'
Database: dorm_1
Question: What are the names of the all-female dorms?
SQL: SELECT dorm_name FROM dorm WHERE gender  =  'F'
Database: dorm_1
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
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
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
Question: How many girl students who are younger than 25?
SQL: SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25
Database: dorm_1
Question: Find the first name of students who is older than 20.
SQL: SELECT fname FROM student WHERE age  >  20
Database: dorm_1
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
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
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
Question: How many dorms are there?
SQL: SELECT count(*) FROM dorm
Database: dorm_1
Question: How many dorms are in the database?
SQL: SELECT count(*) FROM dorm
Database: dorm_1
Question: Find the number of distinct amenities.
SQL: SELECT count(*) FROM dorm_amenity
Database: dorm_1
Question: How many diffrent dorm amenities are there?
SQL: SELECT count(*) FROM dorm_amenity
Database: dorm_1
Question: Find the total capacity of all dorms.
SQL: SELECT sum(student_capacity) FROM dorm
Database: dorm_1
Question: What is the total student capacity of all dorms?
SQL: SELECT sum(student_capacity) FROM dorm
Database: dorm_1
Question: How many students are there?
SQL: SELECT count(*) FROM student
Database: dorm_1
Question: How many students exist?
SQL: SELECT count(*) FROM student
Database: dorm_1
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
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
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
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
Question: Find the number of dorms that have some amenity.
SQL: SELECT count(DISTINCT dormid) FROM has_amenity
Database: dorm_1
Question: How many dorms have amenities?
SQL: SELECT count(DISTINCT dormid) FROM has_amenity
Database: dorm_1
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
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
Question: Find the number of distinct gender for dorms.
SQL: SELECT count(DISTINCT gender) FROM dorm
Database: dorm_1
Question: How many different genders are there in the dorms?
SQL: SELECT count(DISTINCT gender) FROM dorm
Database: dorm_1
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
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
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
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
Question: Find the numbers of different majors and cities.
SQL: SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student
Database: dorm_1
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
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
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
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
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
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
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
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
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
Question: List in alphabetic order all different amenities.
SQL: SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name
Database: dorm_1
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
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
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
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
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
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
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
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
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
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
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
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
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
Question: Find the number of students in each major.
SQL: SELECT count(*) ,  major FROM student GROUP BY major
Database: dorm_1
Question: How many students are there in each major?
SQL: SELECT count(*) ,  major FROM student GROUP BY major
Database: dorm_1
Question: Find the number and average age of students living in each city.
SQL: SELECT count(*) ,  avg(age) ,  city_code FROM student GROUP BY city_code
Database: dorm_1
Question: How many students live in each city and what are their average ages?
SQL: SELECT count(*) ,  avg(age) ,  city_code FROM student GROUP BY city_code
Database: dorm_1
Question: Find the average age and number of male students (with sex M) from each city.
SQL: SELECT count(*) ,  avg(age) ,  city_code FROM student WHERE sex  =  'M' GROUP BY city_code
Database: dorm_1
Question: What is the average age and how many male students are there in each city?
SQL: SELECT count(*) ,  avg(age) ,  city_code FROM student WHERE sex  =  'M' GROUP BY city_code
Database: dorm_1
Question: Find the number of students for the cities where have more than one student.
SQL: SELECT count(*) ,  city_code FROM student GROUP BY city_code HAVING count(*)  >  1
Database: dorm_1
Question: How many students are from each city, and which cities have more than one cities?
SQL: SELECT count(*) ,  city_code FROM student GROUP BY city_code HAVING count(*)  >  1
Database: dorm_1
Question: Find the first and last name of students who are not in the largest major.
SQL: SELECT fname ,  lname FROM student WHERE major != (SELECT major FROM student GROUP BY major ORDER BY count(*) DESC LIMIT 1)
Database: dorm_1
Question: What is the first and last name of the students who are not in the largest major?
SQL: SELECT fname ,  lname FROM student WHERE major != (SELECT major FROM student GROUP BY major ORDER BY count(*) DESC LIMIT 1)
Database: dorm_1
Question: Find the number of students whose age is older than the average age for each gender.
SQL: SELECT count(*) ,  sex FROM student WHERE age  >  (SELECT avg(age) FROM student) GROUP BY sex
Database: dorm_1
Question: How many students are older than average for each gender?
SQL: SELECT count(*) ,  sex FROM student WHERE age  >  (SELECT avg(age) FROM student) GROUP BY sex
Database: dorm_1
Question: Find the average age of students living in each dorm and the name of dorm.
SQL: SELECT avg(T1.age) ,  T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid GROUP BY T3.dorm_name
Database: dorm_1
Question: What is the average age for each dorm and what are the names of each dorm?
SQL: SELECT avg(T1.age) ,  T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid GROUP BY T3.dorm_name
Database: dorm_1
Question: Find the number of amenities for each of the dorms that can accommodate more than 100 students.
SQL: SELECT count(*) ,  T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid WHERE T1.student_capacity  >  100 GROUP BY T1.dormid
Database: dorm_1
Question: For each dorm, how many amenities does it have?
SQL: SELECT count(*) ,  T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid WHERE T1.student_capacity  >  100 GROUP BY T1.dormid
Database: dorm_1
Question: Find the number of students who is older than 20 in each dorm.
SQL: SELECT count(*) ,  T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T1.age  >  20 GROUP BY T3.dorm_name
Database: dorm_1
Question: How many students are older than 20 in each dorm?
SQL: SELECT count(*) ,  T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T1.age  >  20 GROUP BY T3.dorm_name
Database: dorm_1
Question: Find the first name of students who are living in the Smith Hall.
SQL: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.dorm_name  =  'Smith Hall'
Database: dorm_1
Question: What are the first names of all students in Smith Hall?
SQL: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.dorm_name  =  'Smith Hall'
Database: dorm_1
Question: Find the average age of students who are living in the dorm with the largest capacity.
SQL: SELECT avg(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.student_capacity  =  (SELECT max(student_capacity) FROM dorm)
Database: dorm_1
Question: What is the average age of students who are living in the dorm with the largest capacity?
SQL: SELECT avg(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.student_capacity  =  (SELECT max(student_capacity) FROM dorm)
Database: dorm_1
Question: Find the total number of students living in the male dorm (with gender M).
SQL: SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.gender  =  'M'
Database: dorm_1
Question: What are the total number of students who are living in a male dorm?
SQL: SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.gender  =  'M'
Database: dorm_1
Question: Find the number of female students (with F sex) living in Smith Hall
SQL: SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.dorm_name  =  'Smith Hall' AND T1.sex  =  'F'
Database: dorm_1
Question: How many female students live in Smith Hall?
SQL: SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.dorm_name  =  'Smith Hall' AND T1.sex  =  'F'
Database: dorm_1
Question: Find the name of amenities Smith Hall dorm have.
SQL: SELECT T3.amenity_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 T1.dorm_name  =  'Smith Hall'
Database: dorm_1
Question: What are the names of the amenities that Smith Hall has?
SQL: SELECT T3.amenity_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 T1.dorm_name  =  'Smith Hall'
Database: dorm_1
Question: Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.
SQL: SELECT T3.amenity_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 T1.dorm_name  =  'Smith Hall' ORDER BY T3.amenity_name
Database: dorm_1
Question: What amenities does Smith Hall have in alphabetical order?
SQL: SELECT T3.amenity_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 T1.dorm_name  =  'Smith Hall' ORDER BY T3.amenity_name
Database: dorm_1
Question: Find the name of amenity that is most common in all dorms.
SQL: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid  =  T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1
Database: dorm_1
Question: What is the most common amenity in the dorms?
SQL: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid  =  T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1
Database: dorm_1
Question: Find the first name of students who are living in the dorm that has most number of amenities.
SQL: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid  =  T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid  =  T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)
Database: dorm_1
Question: What are the first names of all students who live in the dorm with the most amenities?
SQL: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid  =  T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid  =  T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)
Database: dorm_1
Question: Find the name and capacity of the dorm with least number of amenities.
SQL: SELECT T1.dorm_name ,  T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1
Database: dorm_1
Question: What is the name and capacity of the dorm with the fewest amount of amenities?
SQL: SELECT T1.dorm_name ,  T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1
Database: dorm_1
Question: Find the name of dorms that do not have amenity TV Lounge.
SQL: 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  =  'TV Lounge'
Database: dorm_1
Question: What are the names of the dorm that does not have a TV Lounge?
SQL: 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  =  'TV Lounge'
Database: dorm_1
Question: Find the first and last name of students who are living in the dorms that have amenity TV Lounge.
SQL: SELECT T1.fname ,  T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid  =  T4.amenid WHERE T4.amenity_name  =  'TV Lounge')
Database: dorm_1
Question: What are the first and last names of all students who are living in a dorm with a TV Lounge?
SQL: SELECT T1.fname ,  T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid  =  T4.amenid WHERE T4.amenity_name  =  'TV Lounge')
Database: dorm_1
Question: Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.
SQL: SELECT T1.fname ,  T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid NOT IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid  =  T4.amenid WHERE T4.amenity_name  =  'TV Lounge')
Database: dorm_1
Question: What is the first name and age of every student who lives in a dorm with a TV Lounge?
SQL: SELECT T1.fname ,  T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid NOT IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid  =  T4.amenid WHERE T4.amenity_name  =  'TV Lounge')
Database: dorm_1
Question: Find the name of amenities of the dorm where the student with last name Smith is living in.
SQL: SELECT T3.amenity_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 JOIN lives_in AS T4 ON T4.dormid  =  T1.dormid JOIN student AS T5 ON T5.stuid  =  T4.stuid WHERE T5.lname  =  'Smith'
Database: dorm_1
Question: What are the amenities in the dorm that a student who has the last name of Smith lives in?
SQL: SELECT T3.amenity_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 JOIN lives_in AS T4 ON T4.dormid  =  T1.dormid JOIN student AS T5 ON T5.stuid  =  T4.stuid WHERE T5.lname  =  'Smith'
Database: customer_complaints
Question: How many customers are there?
SQL: SELECT count(*) FROM customers
Database: customer_complaints
Question: Count the number of customers.
SQL: SELECT count(*) FROM customers
Database: customer_complaints
Question: Find the emails and phone numbers of all the customers, ordered by email address and phone number.
SQL: SELECT email_address ,  phone_number FROM customers ORDER BY email_address ,  phone_number
Database: customer_complaints
Question: What are the emails and phone numbers of all customers, sorted by email address and phone number?
SQL: SELECT email_address ,  phone_number FROM customers ORDER BY email_address ,  phone_number
Database: customer_complaints
Question: Which city has the least number of customers whose type code is "Good Credit Rating"?
SQL: SELECT town_city FROM customers WHERE customer_type_code  =  "Good Credit Rating" GROUP BY town_city ORDER BY count(*) LIMIT 1
Database: customer_complaints
Question: Return the city with the customer type code "Good Credit Rating" that had the fewest customers.
SQL: SELECT town_city FROM customers WHERE customer_type_code  =  "Good Credit Rating" GROUP BY town_city ORDER BY count(*) LIMIT 1
Database: customer_complaints
Question: List the name of all products along with the number of complaints that they have received.
SQL: SELECT t1.product_name ,  count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id  =  t2.product_id GROUP BY t1.product_name
Database: customer_complaints
Question: What are all the different product names, and how many complains has each received?
SQL: SELECT t1.product_name ,  count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id  =  t2.product_id GROUP BY t1.product_name
Database: customer_complaints
Question: Find the emails of customers who has filed a complaints of the product with the most complaints.
SQL: SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1
Database: customer_complaints
Question: What are the emails of customers who have filed complaints on the product which has had the greatest number of complaints?
SQL: SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1
Database: customer_complaints
Question: Which products has been complained by the customer who has filed least amount of complaints?
SQL: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id  =  t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1
Database: customer_complaints
Question: Return the names of products that have had complaints filed by the customer who has filed the fewest complaints.
SQL: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id  =  t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1
Database: customer_complaints
Question: What is the phone number of the customer who has filed the most recent complaint?
SQL: SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id  =  t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1
Database: customer_complaints
Question: Return the phone number of the customer who filed the complaint that was raised most recently.
SQL: SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id  =  t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1
Database: customer_complaints
Question: Find the email and phone number of the customers who have never filed a complaint before.
SQL: SELECT email_address ,  phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)
Database: customer_complaints
Question: What are the emails and phone numbers of custoemrs who have never filed a complaint?
SQL: SELECT email_address ,  phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)
Database: customer_complaints
Question: Find the phone number of all the customers and staff.
SQL: SELECT phone_number FROM customers UNION SELECT phone_number FROM staff
Database: customer_complaints
Question: What are the phone numbers of all customers and all staff members?
SQL: SELECT phone_number FROM customers UNION SELECT phone_number FROM staff
Database: customer_complaints
Question: What is the description of the product named "Chocolate"?
SQL: SELECT product_description FROM products WHERE product_name  =  "Chocolate"
Database: customer_complaints
Question: Return the description of the product called "Chocolate".
SQL: SELECT product_description FROM products WHERE product_name  =  "Chocolate"
Database: customer_complaints
Question: Find the name and category of the most expensive product.
SQL: SELECT product_name ,  product_category_code FROM products ORDER BY product_price DESC LIMIT 1
Database: customer_complaints
Question: What is the name and category code of the product with the highest price?
SQL: SELECT product_name ,  product_category_code FROM products ORDER BY product_price DESC LIMIT 1
Database: customer_complaints
Question: Find the prices of products which has never received a single complaint.
SQL: SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)
Database: customer_complaints
Question: What are the prices of products that have never gotten a complaint?
SQL: SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)
Database: customer_complaints
Question: What is the average price of the products for each category?
SQL: SELECT avg(product_price) ,  product_category_code FROM products GROUP BY product_category_code
Database: customer_complaints
Question: Return the average price of products that have each category code.
SQL: SELECT avg(product_price) ,  product_category_code FROM products GROUP BY product_category_code
Database: customer_complaints
Question: Find the last name of the staff member who processed the complaint of the cheapest product.
SQL: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id JOIN products AS t3 ON t2.product_id  =  t3.product_id ORDER BY t3.product_price LIMIT 1
Database: customer_complaints
Question: What is the last name of the staff member in charge of the complaint on the product with the lowest price?
SQL: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id JOIN products AS t3 ON t2.product_id  =  t3.product_id ORDER BY t3.product_price LIMIT 1
Database: customer_complaints
Question: Which complaint status has more than 3 records on file?
SQL: SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING count(*)  >  3
Database: customer_complaints
Question: Return complaint status codes have more than 3 corresponding complaints?
SQL: SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING count(*)  >  3
Database: customer_complaints
Question: Find the last name of the staff whose email address contains "wrau".
SQL: SELECT last_name FROM staff WHERE email_address LIKE "%wrau%"
Database: customer_complaints
Question: What are the last names of staff with email addressed containing the substring "wrau"?
SQL: SELECT last_name FROM staff WHERE email_address LIKE "%wrau%"
Database: customer_complaints
Question: How many customers are there in the customer type with the most customers?
SQL: SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1
Database: customer_complaints
Question: Count the number of customers that have the customer type that is most common.
SQL: SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1
Database: customer_complaints
Question: What is the last name of the staff who has handled the first ever complaint?
SQL: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
Database: customer_complaints
Question: Return the last name of the staff member who handled the complaint with the earliest date raised.
SQL: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
Database: customer_complaints
Question: How many distinct complaint type codes are there in the database?
SQL: SELECT count(DISTINCT complaint_type_code) FROM complaints
Database: customer_complaints
Question: Count the number of different complaint type codes.
SQL: SELECT count(DISTINCT complaint_type_code) FROM complaints
Database: customer_complaints
Question: Find the address line 1 and 2 of the customer with email "vbogisich@example.org".
SQL: SELECT address_line_1 ,  address_line_2 FROM customers WHERE email_address  =  "vbogisich@example.org"
Database: customer_complaints
Question: What are lines 1 and 2 of the addressed of the customer with the email "vbogisich@example.org"?
SQL: SELECT address_line_1 ,  address_line_2 FROM customers WHERE email_address  =  "vbogisich@example.org"
Database: customer_complaints
Question: Find the number of complaints with Product Failure type for each complaint status.
SQL: SELECT complaint_status_code ,  count(*) FROM complaints WHERE complaint_type_code  =  "Product Failure" GROUP BY complaint_status_code
Database: customer_complaints
Question: Of complaints with the type code "Product Failure", how many had each different status code?
SQL: SELECT complaint_status_code ,  count(*) FROM complaints WHERE complaint_type_code  =  "Product Failure" GROUP BY complaint_status_code
Database: customer_complaints
Question: What is first names of the top 5 staff who have handled the greatest number of complaints?
SQL: SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
Database: customer_complaints
Question: Return the first names of the 5 staff members who have handled the most complaints.
SQL: SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
Database: customer_complaints
Question: Which state has the most customers?
SQL: SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
Database: customer_complaints
Question: Give the state that has the most customers.
SQL: SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
Database: workshop_paper
Question: How many submissions are there?
SQL: SELECT count(*) FROM submission
Database: workshop_paper
Question: Count the number of submissions.
SQL: SELECT count(*) FROM submission
Database: workshop_paper
Question: List the authors of submissions in ascending order of scores.
SQL: SELECT Author FROM submission ORDER BY Scores ASC
Database: workshop_paper
Question: Find the author for each submission and list them in ascending order of submission score.
SQL: SELECT Author FROM submission ORDER BY Scores ASC
Database: workshop_paper
Question: What are the authors of submissions and their colleges?
SQL: SELECT Author ,  College FROM submission
Database: workshop_paper
Question: For each submission, show the author and their affiliated college.
SQL: SELECT Author ,  College FROM submission
Database: workshop_paper
Question: Show the names of authors from college "Florida" or "Temple"
SQL: SELECT Author FROM submission WHERE College  =  "Florida" OR College  =  "Temple"
Database: workshop_paper
Question: Which authors with submissions are from college "Florida" or "Temple"?
SQL: SELECT Author FROM submission WHERE College  =  "Florida" OR College  =  "Temple"
Database: workshop_paper
Question: What is the average score of submissions?
SQL: SELECT avg(Scores) FROM submission
Database: workshop_paper
Question: Compute the average score of submissions.
SQL: SELECT avg(Scores) FROM submission
Database: workshop_paper
Question: What is the author of the submission with the highest score?
SQL: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
Database: workshop_paper
Question: Find the author who achieved the highest score in a submission.
SQL: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
Database: workshop_paper
Question: Show different colleges along with the number of authors of submission from each college.
SQL: SELECT College ,  COUNT(*) FROM submission GROUP BY College
Database: workshop_paper
Question: For each college, return the college name and the count of authors with submissions from that college.
SQL: SELECT College ,  COUNT(*) FROM submission GROUP BY College
Database: workshop_paper
Question: Show the most common college of authors of submissions.
SQL: SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
Database: workshop_paper
Question: Which college has the most authors with submissions?
SQL: SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
Database: workshop_paper
Question: Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.
SQL: SELECT College FROM submission WHERE Scores  >  90 INTERSECT SELECT College FROM submission WHERE Scores  <  80
Database: workshop_paper
Question: Which colleges have both authors with submission score above 90 and authors with submission score below 80?
SQL: SELECT College FROM submission WHERE Scores  >  90 INTERSECT SELECT College FROM submission WHERE Scores  <  80
Database: workshop_paper
Question: Show the authors of submissions and the acceptance results of their submissions.
SQL: SELECT T2.Author ,  T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID
Database: workshop_paper
Question: For each submission, find its author and acceptance result.
SQL: SELECT T2.Author ,  T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID
Database: workshop_paper
Question: Show the result of the submission with the highest score.
SQL: SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
Database: workshop_paper
Question: Which submission received the highest score in acceptance result. Show me the result.
SQL: SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
Database: workshop_paper
Question: Show each author and the number of workshops they submitted to.
SQL: SELECT T2.Author ,  COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author
Database: workshop_paper
Question: How many workshops did each author submit to? Return the author name and the number of workshops.
SQL: SELECT T2.Author ,  COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author
Database: workshop_paper
Question: Show the authors who have submissions to more than one workshop.
SQL: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id)  >  1
Database: workshop_paper
Question: Which authors have submitted to more than one workshop?
SQL: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id)  >  1
Database: workshop_paper
Question: Show the date and venue of each workshop in ascending alphabetical order of the venue.
SQL: SELECT Date ,  Venue FROM workshop ORDER BY Venue
Database: workshop_paper
Question: Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.
SQL: SELECT Date ,  Venue FROM workshop ORDER BY Venue
Database: workshop_paper
Question: List the authors who do not have submission to any workshop.
SQL: SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)