minktn/spider-data huggingface dataset:
Database: book_2
Question: List the titles of books that are not published.
SQL: SELECT Title FROM book WHERE Book_ID NOT IN (SELECT Book_ID FROM publication)
Database: book_2
Question: Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.
SQL: SELECT Publisher FROM publication WHERE Price  >  10000000 INTERSECT SELECT Publisher FROM publication WHERE Price  <  5000000
Database: book_2
Question: What is the number of distinct publication dates?
SQL: SELECT COUNT (DISTINCT Publication_Date) FROM publication
Database: book_2
Question: How many distinct publication dates are there in our record?
SQL: SELECT COUNT (DISTINCT Publication_Date) FROM publication
Database: book_2
Question: Show the prices of publications whose publisher is either "Person" or "Wiley"
SQL: SELECT Price FROM publication WHERE Publisher  =  "Person" OR Publisher  =  "Wiley"
Database: musical
Question: How many actors are there?
SQL: SELECT count(*) FROM actor
Database: musical
Question: Count the number of actors.
SQL: SELECT count(*) FROM actor
Database: musical
Question: List the name of actors in ascending alphabetical order.
SQL: SELECT Name FROM actor ORDER BY Name ASC
Database: musical
Question: What are the names of actors, ordered alphabetically?
SQL: SELECT Name FROM actor ORDER BY Name ASC
Database: musical
Question: What are the characters and duration of actors?
SQL: SELECT Character ,  Duration FROM actor
Database: musical
Question: Return the characters and durations for each actor.
SQL: SELECT Character ,  Duration FROM actor
Database: musical
Question: List the name of actors whose age is not 20.
SQL: SELECT Name FROM actor WHERE Age != 20
Database: musical
Question: What are the names of actors who are not 20 years old?
SQL: SELECT Name FROM actor WHERE Age != 20
Database: musical
Question: What are the characters of actors in descending order of age?
SQL: SELECT Character FROM actor ORDER BY age DESC
Database: musical
Question: Return the characters for actors, ordered by age descending.
SQL: SELECT Character FROM actor ORDER BY age DESC
Database: musical
Question: What is the duration of the oldest actor?
SQL: SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
Database: musical
Question: Return the duration of the actor with the greatest age.
SQL: SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
Database: musical
Question: What are the names of musicals with nominee "Bob Fosse"?
SQL: SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse"
Database: musical
Question: Return the names of musicals who have the nominee Bob Fosse.
SQL: SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse"
Database: musical
Question: What are the distinct nominees of the musicals with the award that is not "Tony Award"?
SQL: SELECT DISTINCT Nominee FROM musical WHERE Award != "Tony Award"
Database: musical
Question: Return the different nominees of musicals that have an award that is not the Tony Award.
SQL: SELECT DISTINCT Nominee FROM musical WHERE Award != "Tony Award"
Database: musical
Question: Show names of actors and names of musicals they are in.
SQL: SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
Database: musical
Question: What are the names of actors and the musicals that they are in?
SQL: SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
Database: musical
Question: Show names of actors that have appeared in musical with name "The Phantom of the Opera".
SQL: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID WHERE T2.Name  =  "The Phantom of the Opera"
Database: musical
Question: What are the names of actors who have been in the musical titled The Phantom of the Opera?
SQL: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID WHERE T2.Name  =  "The Phantom of the Opera"
Database: musical
Question: Show names of actors in descending order of the year their musical is awarded.
SQL: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID ORDER BY T2.Year DESC
Database: musical
Question: What are the names of actors ordered descending by the year in which their musical was awarded?
SQL: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID ORDER BY T2.Year DESC
Database: musical
Question: Show names of musicals and the number of actors who have appeared in the musicals.
SQL: SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID
Database: musical
Question: How many actors have appeared in each musical?
SQL: SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID
Database: musical
Question: Show names of musicals which have at least three actors.
SQL: SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  >=  3
Database: musical
Question: What are the names of musicals who have at 3 or more actors?
SQL: SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  >=  3
Database: musical
Question: Show different nominees and the number of musicals they have been nominated.
SQL: SELECT Nominee ,  COUNT(*) FROM musical GROUP BY Nominee
Database: musical
Question: How many musicals has each nominee been nominated for?
SQL: SELECT Nominee ,  COUNT(*) FROM musical GROUP BY Nominee
Database: musical
Question: Please show the nominee who has been nominated the greatest number of times.
SQL: SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1
Database: musical
Question: Who is the nominee who has been nominated for the most musicals?
SQL: SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1
Database: musical
Question: List the most common result of the musicals.
SQL: SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
Database: musical
Question: Return the most frequent result across all musicals.
SQL: SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
Database: musical
Question: List the nominees that have been nominated more than two musicals.
SQL: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2
Database: musical
Question: Who are the nominees who have been nominated more than two times?
SQL: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2
Database: musical
Question: List the name of musicals that do not have actors.
SQL: SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)
Database: musical
Question: What are the names of musicals who have no actors?
SQL: SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)
Database: musical
Question: Show the nominees that have nominated musicals for both "Tony Award" and "Drama Desk Award".
SQL: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award"
Database: musical
Question: Who are the nominees who have been nominated for both a Tony Award and a Drama Desk Award?
SQL: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award"
Database: musical
Question: Show the musical nominee with award "Bob Fosse" or "Cleavant Derricks".
SQL: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" OR Award  =  "Cleavant Derricks"
Database: musical
Question: Who are the nominees who were nominated for either of the Bob Fosse or Cleavant Derricks awards?
SQL: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" OR Award  =  "Cleavant Derricks"
Database: twitter_1
Question: Find the emails of the user named "Mary".
SQL: SELECT email FROM user_profiles WHERE name  =  'Mary'
Database: twitter_1
Question: What is the partition id of the user named "Iron Man".
SQL: SELECT partitionid FROM user_profiles WHERE name  =  'Iron Man'
Database: twitter_1
Question: How many users are there?
SQL: SELECT count(*) FROM user_profiles
Database: twitter_1
Question: How many followers does each user have?
SQL: SELECT count(*) FROM follows
Database: twitter_1
Question: Find the number of followers for each user.
SQL: SELECT count(*) FROM follows GROUP BY f1
Database: twitter_1
Question: Find the number of tweets in record.
SQL: SELECT count(*) FROM tweets
Database: twitter_1
Question: Find the number of users who posted some tweets.
SQL: SELECT count(DISTINCT UID) FROM tweets
Database: twitter_1
Question: Find the name and email of the user whose name contains the word ‘Swift’.
SQL: SELECT name ,  email FROM user_profiles WHERE name LIKE '%Swift%'
Database: twitter_1
Question: Find the names of users whose emails contain ‘superstar’ or ‘edu’.
SQL: SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'
Database: twitter_1
Question: Return the text of tweets about the topic 'intern'.
SQL: SELECT text FROM tweets WHERE text LIKE '%intern%'
Database: twitter_1
Question: Find the name and email of the users who have more than 1000 followers.
SQL: SELECT name ,  email FROM user_profiles WHERE followers  >  1000
Database: twitter_1
Question: Find the names of the users whose number of followers is greater than that of the user named "Tyler Swift".
SQL: SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 WHERE T1.name  =  'Tyler Swift')
Database: twitter_1
Question: Find the name and email for the users who have more than one follower.
SQL: SELECT T1.name ,  T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  1
Database: twitter_1
Question: Find the names of users who have more than one tweet.
SQL: SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1
Database: twitter_1
Question: Find the id of users who are followed by Mary and Susan.
SQL: SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Mary" INTERSECT SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Susan"
Database: twitter_1
Question: Find the id of users who are followed by Mary or Susan.
SQL: SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Mary" OR T1.name  =  "Susan"
Database: twitter_1
Question: Find the name of the user who has the largest number of followers.
SQL: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1
Database: twitter_1
Question: Find the name and email of the user followed by the least number of people.
SQL: SELECT name ,  email FROM user_profiles ORDER BY followers LIMIT 1
Database: twitter_1
Question: List the name and number of followers for each user, and sort the results by the number of followers in descending order.
SQL: SELECT name ,  followers FROM user_profiles ORDER BY followers DESC
Database: twitter_1
Question: List the names of 5 users followed by the largest number of other users.
SQL: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5
Database: twitter_1
Question: List the text of all tweets in the order of date.
SQL: SELECT text FROM tweets ORDER BY createdate
Database: twitter_1
Question: Find the name of each user and number of tweets tweeted by each of them.
SQL: SELECT T1.name ,  count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid
Database: twitter_1
Question: Find the name and partition id for users who tweeted less than twice.
SQL: SELECT T1.name ,  T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  <  2
Database: twitter_1
Question: Find the name of the user who tweeted more than once, and number of tweets tweeted by them.
SQL: SELECT T1.name ,  count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1
Database: twitter_1
Question: Find the average number of followers for the users who do not have any tweet.
SQL: SELECT avg(followers) FROM user_profiles WHERE UID NOT IN (SELECT UID FROM tweets)
Database: twitter_1
Question: Find the average number of followers for the users who had some tweets.
SQL: SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)
Database: twitter_1
Question: Find the maximum and total number of followers of all users.
SQL: SELECT max(followers) ,  sum(followers) FROM user_profiles
Database: product_catalog
Question: Find the names of all the catalog entries.
SQL: SELECT distinct(catalog_entry_name) FROM catalog_contents
Database: product_catalog
Question: What are all the catalog entry names?
SQL: SELECT distinct(catalog_entry_name) FROM catalog_contents
Database: product_catalog
Question: Find the list of attribute data types possessed by more than 3 attribute definitions.
SQL: SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*)  >  3
Database: product_catalog
Question: What are the attribute data types with more than 3 attribute definitions?
SQL: SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*)  >  3
Database: product_catalog
Question: What is the attribute data type of the attribute with name "Green"?
SQL: SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name  =  "Green"
Database: product_catalog
Question: Find the attribute data type for the attribute named "Green".
SQL: SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name  =  "Green"
Database: product_catalog
Question: Find the name and level of catalog structure with level between 5 and 10.
SQL: SELECT catalog_level_name ,  catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
Database: product_catalog
Question: What are the name and level of catalog structure with level number between 5 and 10
SQL: SELECT catalog_level_name ,  catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
Database: product_catalog
Question: Find all the catalog publishers whose name contains "Murray"
SQL: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"
Database: product_catalog
Question: Which catalog publishers have substring "Murray" in their names?
SQL: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"
Database: product_catalog
Question: Which catalog publisher has published the most catalogs?
SQL: SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1
Database: product_catalog
Question: Find the catalog publisher that has the most catalogs.
SQL: SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1
Database: product_catalog
Question: Find the names and publication dates of all catalogs that have catalog level number greater than 5.
SQL: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  5
Database: product_catalog
Question: What are the name and publication date of the catalogs with catalog level number above 5?
SQL: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  5
Database: product_catalog
Question: What are the entry names of catalog with the attribute possessed by most entries.
SQL: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)
Database: product_catalog
Question: Find the entry names of the catalog with the attribute that have the most entries.
SQL: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)
Database: product_catalog
Question: What is the entry name of the most expensive catalog (in USD)?
SQL: SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
Database: product_catalog
Question: Find the entry name of the catalog with the highest price (in USD).
SQL: SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
Database: product_catalog
Question: What is the level name of the cheapest catalog (in USD)?
SQL: SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number  =  t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1
Database: product_catalog
Question: Find the level name of the catalog with the lowest price (in USD).
SQL: SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number  =  t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1
Database: product_catalog
Question: What are the average and minimum price (in Euro) of all products?
SQL: SELECT avg(price_in_euros) ,  min(price_in_euros) FROM catalog_contents
Database: product_catalog
Question: Give me the average and minimum price (in Euro) of the products.
SQL: SELECT avg(price_in_euros) ,  min(price_in_euros) FROM catalog_contents
Database: product_catalog
Question: What is the product with the highest height? Give me the catalog entry name.
SQL: SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
Database: product_catalog
Question: Which catalog content has the highest height? Give me the catalog entry name.
SQL: SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
Database: product_catalog
Question: Find the name of the product that has the smallest capacity.
SQL: SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
Database: product_catalog
Question: Which catalog content has the smallest capacity? Return the catalog entry name.
SQL: SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
Database: product_catalog
Question: Find the names of all the products whose stock number starts with "2".
SQL: SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"
Database: product_catalog
Question: Which catalog contents have a product stock number that starts from "2"? Show the catalog entry names.
SQL: SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"
Database: product_catalog
Question: Find the names of catalog entries with level number 8.
SQL: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.catalog_level_number  =  "8"
Database: product_catalog
Question: What are the names of catalog entries with level number 8?
SQL: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.catalog_level_number  =  "8"
Database: product_catalog
Question: Find the names of the products with length smaller than 3 or height greater than 5.
SQL: SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH  <  3 OR width  >  5
Database: product_catalog
Question: Which catalog contents have length below 3 or above 5? Find the catalog entry names.
SQL: SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH  <  3 OR width  >  5
Database: product_catalog
Question: Find the name and attribute ID of the attribute definitions with attribute value 0.
SQL: SELECT t1.attribute_name ,  t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id  =  t2.attribute_id WHERE t2.attribute_value  =  0
Database: product_catalog
Question: Which attribute definitions have attribute value 0? Give me the attribute name and attribute ID.
SQL: SELECT t1.attribute_name ,  t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id  =  t2.attribute_id WHERE t2.attribute_value  =  0
Database: product_catalog
Question: Find the name and capacity of products with price greater than 700 (in USD).
SQL: SELECT catalog_entry_name ,  capacity FROM Catalog_Contents WHERE price_in_dollars  >  700
Database: product_catalog
Question: Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities.
SQL: SELECT catalog_entry_name ,  capacity FROM Catalog_Contents WHERE price_in_dollars  >  700
Database: product_catalog
Question: Find the dates on which more than one revisions were made.
SQL: SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*)  >  1
Database: product_catalog
Question: On which days more than one revisions were made on catalogs.
SQL: SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*)  >  1
Database: product_catalog
Question: How many products are there in the records?
SQL: SELECT count(*) FROM catalog_contents
Database: product_catalog
Question: Find the total number of catalog contents.
SQL: SELECT count(*) FROM catalog_contents
Database: product_catalog
Question: Name all the products with next entry ID greater than 8.
SQL: SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id  >  8
Database: product_catalog
Question: What are the catalog entry names of the products with next entry ID above 8?
SQL: SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id  >  8
Database: flight_1
Question: How many aircrafts do we have?
SQL: SELECT count(*) FROM Aircraft
Database: flight_1
Question: How many aircrafts exist in the database?
SQL: SELECT count(*) FROM Aircraft
Database: flight_1
Question: Show name and distance for all aircrafts.
SQL: SELECT name ,  distance FROM Aircraft
Database: flight_1
Question: What are the names and distances for all airplanes?
SQL: SELECT name ,  distance FROM Aircraft
Database: flight_1
Question: Show ids for all aircrafts with more than 1000 distance.
SQL: SELECT aid FROM Aircraft WHERE distance  >  1000
Database: flight_1
Question: What are the ids of all aircrafts that can cover a distance of more than 1000?
SQL: SELECT aid FROM Aircraft WHERE distance  >  1000
Database: flight_1
Question: How many aircrafts have distance between 1000 and 5000?
SQL: SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
Database: flight_1
Question: What is the count of aircrafts that have a distance between 1000 and 5000?
SQL: SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
Database: flight_1
Question: What is the name and distance for aircraft with id 12?
SQL: SELECT name ,  distance FROM Aircraft WHERE aid  =  12
Database: flight_1
Question: What is the name and distance for the aircraft that has an id of 12?
SQL: SELECT name ,  distance FROM Aircraft WHERE aid  =  12
Database: flight_1
Question: What is the minimum, average, and maximum distance of all aircrafts.
SQL: SELECT min(distance) ,  avg(distance) ,  max(distance) FROM Aircraft
Database: flight_1
Question: Return the minimum, average and maximum distances traveled across all aircrafts.
SQL: SELECT min(distance) ,  avg(distance) ,  max(distance) FROM Aircraft
Database: flight_1
Question: Show the id and name of the aircraft with the maximum distance.
SQL: SELECT aid ,  name FROM Aircraft ORDER BY distance DESC LIMIT 1
Database: flight_1
Question: What is the id and name of the aircraft that can cover the maximum distance?
SQL: SELECT aid ,  name FROM Aircraft ORDER BY distance DESC LIMIT 1
Database: flight_1
Question: Show the name of aircrafts with top three lowest distances.
SQL: SELECT name FROM Aircraft ORDER BY distance LIMIT 3
Database: flight_1
Question: What are the aircrafts with top 3 shortest lengthes? List their names.
SQL: SELECT name FROM Aircraft ORDER BY distance LIMIT 3
Database: flight_1
Question: Show names for all aircrafts with distances more than the average.
SQL: SELECT name FROM Aircraft WHERE distance  >  (SELECT avg(distance) FROM Aircraft)
Database: flight_1
Question: What are the names of all aircrafts that can cover more distances than average?
SQL: SELECT name FROM Aircraft WHERE distance  >  (SELECT avg(distance) FROM Aircraft)
Database: flight_1
Question: How many employees do we have?
SQL: SELECT count(*) FROM Employee
Database: flight_1
Question: What is the number of employees?
SQL: SELECT count(*) FROM Employee
Database: flight_1
Question: Show name and salary for all employees sorted by salary.
SQL: SELECT name ,  salary FROM Employee ORDER BY salary
Database: flight_1
Question: What is the name and salary of all employees in order of salary?
SQL: SELECT name ,  salary FROM Employee ORDER BY salary
Database: flight_1
Question: Show ids for all employees with at least 100000 salary.
SQL: SELECT eid FROM Employee WHERE salary  >  100000
Database: flight_1
Question: What is the id of every employee who has at least a salary of  100000?
SQL: SELECT eid FROM Employee WHERE salary  >  100000
Database: flight_1
Question: How many employees have salary between 100000 and 200000?
SQL: SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
Database: flight_1
Question: What is the number of employees that have a salary between 100000 and 200000?
SQL: SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
Database: flight_1
Question: What is the name and salary for employee with id 242518965?
SQL: SELECT name ,  salary FROM Employee WHERE eid  =  242518965
Database: flight_1
Question: What is the name and salary of the employee with the id 242518965?
SQL: SELECT name ,  salary FROM Employee WHERE eid  =  242518965
Database: flight_1
Question: What is average and maximum salary of all employees.
SQL: SELECT avg(salary) ,  max(salary) FROM Employee
Database: flight_1
Question: What is the average and largest salary of all employees?
SQL: SELECT avg(salary) ,  max(salary) FROM Employee
Database: flight_1
Question: Show the id and name of the employee with maximum salary.
SQL: SELECT eid ,  name FROM Employee ORDER BY salary DESC LIMIT 1
Database: flight_1
Question: What is the id and name of the employee with the highest salary?
SQL: SELECT eid ,  name FROM Employee ORDER BY salary DESC LIMIT 1
Database: flight_1
Question: Show the name of employees with three lowest salaries.
SQL: SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
Database: flight_1
Question: What is the name of the 3 employees who get paid the least?
SQL: SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
Database: flight_1
Question: Show names for all employees with salary more than the average.
SQL: SELECT name FROM Employee WHERE salary  >  (SELECT avg(salary) FROM Employee)
Database: flight_1
Question: What are the names of all employees who have a salary higher than average?
SQL: SELECT name FROM Employee WHERE salary  >  (SELECT avg(salary) FROM Employee)
Database: flight_1
Question: Show the id and salary of Mark Young.
SQL: SELECT eid ,  salary FROM Employee WHERE name  =  'Mark Young'
Database: flight_1
Question: What is the id and salary of the employee named Mark Young?
SQL: SELECT eid ,  salary FROM Employee WHERE name  =  'Mark Young'
Database: flight_1
Question: How many flights do we have?
SQL: SELECT count(*) FROM Flight
Database: flight_1
Question: What is the number of flights?
SQL: SELECT count(*) FROM Flight
Database: flight_1
Question: Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
SQL: SELECT flno ,  origin ,  destination FROM Flight ORDER BY origin
Database: flight_1
Question: What is the flight number, origin, and destination for all flights in alphabetical order by departure cities?
SQL: SELECT flno ,  origin ,  destination FROM Flight ORDER BY origin
Database: flight_1
Question: Show all flight number from Los Angeles.
SQL: SELECT flno FROM Flight WHERE origin  =  "Los Angeles"
Database: flight_1
Question: What are the numbers of all flights coming from Los Angeles?
SQL: SELECT flno FROM Flight WHERE origin  =  "Los Angeles"
Database: flight_1
Question: Show origins of all flights with destination Honolulu.
SQL: SELECT origin FROM Flight WHERE destination  =  "Honolulu"
Database: flight_1
Question: What are the origins of all flights that are headed to Honolulu?
SQL: SELECT origin FROM Flight WHERE destination  =  "Honolulu"
Database: flight_1
Question: Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
SQL: SELECT departure_date ,  arrival_date FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
Database: flight_1
Question: What are the departure and arrival dates of all flights from LA to Honolulu?
SQL: SELECT departure_date ,  arrival_date FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
Database: flight_1
Question: Show flight number for all flights with more than 2000 distance.
SQL: SELECT flno FROM Flight WHERE distance  >  2000
Database: flight_1
Question: What are the numbers of all flights that can cover a distance of more than 2000?
SQL: SELECT flno FROM Flight WHERE distance  >  2000
Database: flight_1
Question: What is the average price for flights from Los Angeles to Honolulu.
SQL: SELECT avg(price) FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
Database: flight_1
Question: What is the average price for flights from LA to Honolulu?
SQL: SELECT avg(price) FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
Database: flight_1
Question: Show origin and destination for flights with price higher than 300.
SQL: SELECT origin ,  destination FROM Flight WHERE price  >  300
Database: flight_1
Question: What is the origin and destination for all flights whose price is higher than 300?
SQL: SELECT origin ,  destination FROM Flight WHERE price  >  300
Database: flight_1
Question: Show the flight number and distance of the flight with maximum price.
SQL: SELECT flno ,  distance FROM Flight ORDER BY price DESC LIMIT 1
Database: flight_1
Question: What is the flight number and its distance for the one with the maximum price?
SQL: SELECT flno ,  distance FROM Flight ORDER BY price DESC LIMIT 1
Database: flight_1
Question: Show the flight number of flights with three lowest distances.
SQL: SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
Database: flight_1
Question: What are the numbers of the shortest flights?
SQL: SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
Database: flight_1
Question: What is the average distance and average price for flights from Los Angeles.
SQL: SELECT avg(distance) ,  avg(price) FROM Flight WHERE origin  =  "Los Angeles"
Database: flight_1
Question: What is the average distance and price for all flights from LA?
SQL: SELECT avg(distance) ,  avg(price) FROM Flight WHERE origin  =  "Los Angeles"
Database: flight_1
Question: Show all origins and the number of flights from each origin.
SQL: SELECT origin ,  count(*) FROM Flight GROUP BY origin
Database: flight_1
Question: For each origin, how many flights came from there?
SQL: SELECT origin ,  count(*) FROM Flight GROUP BY origin
Database: flight_1
Question: Show all destinations and the number of flights to each destination.
SQL: SELECT destination ,  count(*) FROM Flight GROUP BY destination
Database: flight_1
Question: What are the destinations and number of flights to each one?
SQL: SELECT destination ,  count(*) FROM Flight GROUP BY destination
Database: flight_1
Question: Which origin has most number of flights?
SQL: SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
Database: flight_1
Question: What place has the most flights coming from there?
SQL: SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
Database: flight_1
Question: Which destination has least number of flights?
SQL: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
Database: flight_1
Question: What destination has the fewest number of flights?
SQL: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
Database: flight_1
Question: What is the aircraft name for the flight with number 99
SQL: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99
Database: flight_1
Question: What is the name of the aircraft that was on flight number 99?
SQL: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99
Database: flight_1
Question: Show all flight numbers with aircraft Airbus A340-300.
SQL: SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T2.name  =  "Airbus A340-300"
Database: flight_1
Question: What are the flight numbers for the aircraft Airbus A340-300?
SQL: SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T2.name  =  "Airbus A340-300"
Database: flight_1
Question: Show aircraft names and number of flights for each aircraft.
SQL: SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid
Database: flight_1
Question: What is the name of each aircraft and how many flights does each one complete?
SQL: SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid
Database: flight_1
Question: Show names for all aircraft with at least two flights.
SQL: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2
Database: flight_1
Question: What are the names for all aircrafts with at least 2 flights?
SQL: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2
Database: flight_1
Question: How many employees have certificate.
SQL: SELECT count(DISTINCT eid) FROM Certificate
Database: flight_1
Question: What is the count of distinct employees with certificates?
SQL: SELECT count(DISTINCT eid) FROM Certificate
Database: flight_1
Question: Show ids for all employees who don't have a certificate.
SQL: SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
Database: flight_1
Question: What are the ids of all employees that don't have certificates?
SQL: SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
Database: flight_1
Question: Show names for all aircrafts of which John Williams has certificates.
SQL: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams"
Database: flight_1
Question: What are the names of all aircrafts that John Williams have certificates to be able to fly?
SQL: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams"
Database: flight_1
Question: Show names for all employees who have certificate of Boeing 737-800.
SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Database: flight_1
Question: What are the names of all employees who have a certificate to fly Boeing 737-800?
SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Database: flight_1
Question: Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Airbus A340-300"
Database: flight_1
Question: What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300?
SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Airbus A340-300"
Database: flight_1
Question: Show names for all employees who do not have certificate of Boeing 737-800.
SQL: SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Database: flight_1
Question: What are the names of all employees who are not certified to fly Boeing 737-800s?
SQL: SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Database: flight_1
Question: Show the name of aircraft which fewest people have its certificate.
SQL: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1
Database: flight_1
Question: What are the names of the aircraft that the least people are certified to fly?
SQL: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1
Database: flight_1
Question: Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.
SQL: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5
Database: flight_1
Question: What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly?
SQL: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5
Database: flight_1
Question: what is the salary and name of the employee who has the most number of aircraft certificates?
SQL: SELECT T1.name ,  T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
Database: flight_1
Question: What is the salaray and name of the employee that is certified to fly the most planes?
SQL: SELECT T1.name ,  T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
Database: flight_1
Question: What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?
SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.distance  >  5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
Database: flight_1
Question: What is the salaray and name of the employee with the most certificates to fly planes more than 5000?
SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.distance  >  5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: How many allergies are there?
SQL: SELECT count(DISTINCT allergy) FROM Allergy_type
Database: allergy_1
Question: How many allergy entries are there?
SQL: SELECT count(DISTINCT allergy) FROM Allergy_type
Database: allergy_1
Question: How many different allergy types exist?
SQL: SELECT count(DISTINCT allergytype) FROM Allergy_type
Database: allergy_1
Question: How many distinct allergies are there?
SQL: SELECT count(DISTINCT allergytype) FROM Allergy_type
Database: allergy_1
Question: Show all allergy types.
SQL: SELECT DISTINCT allergytype FROM Allergy_type
Database: allergy_1
Question: What are the different allergy types?
SQL: SELECT DISTINCT allergytype FROM Allergy_type
Database: allergy_1
Question: Show all allergies and their types.
SQL: SELECT allergy ,  allergytype FROM Allergy_type
Database: allergy_1
Question: What are the allergies and their types?
SQL: SELECT allergy ,  allergytype FROM Allergy_type
Database: allergy_1
Question: Show all allergies with type food.
SQL: SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype  =  "food"
Database: allergy_1
Question: What are all the different food allergies?
SQL: SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype  =  "food"
Database: allergy_1
Question: What is the type of allergy Cat?
SQL: SELECT allergytype FROM Allergy_type WHERE allergy  =  "Cat"
Database: allergy_1
Question: What is allergy type of a cat allergy?
SQL: SELECT allergytype FROM Allergy_type WHERE allergy  =  "Cat"
Database: allergy_1
Question: How many allergies have type animal?
SQL: SELECT count(*) FROM Allergy_type WHERE allergytype  =  "animal"
Database: allergy_1
Question: How many animal type allergies exist?
SQL: SELECT count(*) FROM Allergy_type WHERE allergytype  =  "animal"
Database: allergy_1
Question: Show all allergy types and the number of allergies in each type.
SQL: SELECT allergytype ,  count(*) FROM Allergy_type GROUP BY allergytype
Database: allergy_1
Question: What are the allergy types and how many allergies correspond to each one?
SQL: SELECT allergytype ,  count(*) FROM Allergy_type GROUP BY allergytype
Database: allergy_1
Question: Which allergy type has most number of allergies?
SQL: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: Which allergy type is most common?
SQL: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: Which allergy type has least number of allergies?
SQL: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
Database: allergy_1
Question: Which allergy type is the least common?
SQL: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
Database: allergy_1
Question: How many students are there?
SQL: SELECT count(*) FROM Student
Database: allergy_1
Question: What is the total number of students?
SQL: SELECT count(*) FROM Student
Database: allergy_1
Question: Show first name and last name for all students.
SQL: SELECT Fname ,  Lname FROM Student
Database: allergy_1
Question: What are the full names of all students
SQL: SELECT Fname ,  Lname FROM Student
Database: allergy_1
Question: How many different advisors are listed?
SQL: SELECT count(DISTINCT advisor) FROM Student
Database: allergy_1
Question: How many advisors are there?
SQL: SELECT count(DISTINCT advisor) FROM Student
Database: allergy_1
Question: Show all majors.
SQL: SELECT DISTINCT Major FROM Student
Database: allergy_1
Question: What are the different majors?
SQL: SELECT DISTINCT Major FROM Student
Database: allergy_1
Question: Show all cities where students live.
SQL: SELECT DISTINCT city_code FROM Student
Database: allergy_1
Question: What cities do students live in?
SQL: SELECT DISTINCT city_code FROM Student
Database: allergy_1
Question: Show first name, last name, age for all female students. Their sex is F.
SQL: SELECT Fname ,  Lname ,  Age FROM Student WHERE Sex  =  'F'
Database: allergy_1
Question: What are the full names and ages for all female students whose sex is F?
SQL: SELECT Fname ,  Lname ,  Age FROM Student WHERE Sex  =  'F'
Database: allergy_1
Question: Show student ids for all male students.
SQL: SELECT StuID FROM Student WHERE Sex  =  'M'
Database: allergy_1
Question: What are the student ids for all male students?
SQL: SELECT StuID FROM Student WHERE Sex  =  'M'
Database: allergy_1
Question: How many students are age 18?
SQL: SELECT count(*) FROM Student WHERE age  =  18
Database: allergy_1
Question: How many students are 18 years old?
SQL: SELECT count(*) FROM Student WHERE age  =  18
Database: allergy_1
Question: Show all student ids who are older than 20.
SQL: SELECT StuID FROM Student WHERE age  >  20
Database: allergy_1
Question: What are the student ids for students over 20 years old?
SQL: SELECT StuID FROM Student WHERE age  >  20
Database: allergy_1
Question: Which city does the student whose last name is "Kim" live in?
SQL: SELECT city_code FROM Student WHERE LName  =  "Kim"
Database: allergy_1
Question: Give the city that the student whose family name is Kim lives in.
SQL: SELECT city_code FROM Student WHERE LName  =  "Kim"
Database: allergy_1
Question: Who is the advisor of student with ID 1004?
SQL: SELECT Advisor FROM Student WHERE StuID  =  1004
Database: allergy_1
Question: Who advises student 1004?
SQL: SELECT Advisor FROM Student WHERE StuID  =  1004
Database: allergy_1
Question: How many students live in HKG or CHI?
SQL: SELECT count(*) FROM Student WHERE city_code  =  "HKG" OR city_code  =  "CHI"
Database: allergy_1
Question: Give the number of students living in either HKG or CHI.
SQL: SELECT count(*) FROM Student WHERE city_code  =  "HKG" OR city_code  =  "CHI"
Database: allergy_1
Question: Show the minimum, average, and maximum age of all students.
SQL: SELECT min(age) ,  avg(age) ,  max(age) FROM Student
Database: allergy_1
Question: What is the minimum, mean, and maximum age across all students?
SQL: SELECT min(age) ,  avg(age) ,  max(age) FROM Student
Database: allergy_1
Question: What is the last name of the youngest student?
SQL: SELECT LName FROM Student WHERE age  =  (SELECT min(age) FROM Student)
Database: allergy_1
Question: Provide the last name of the youngest student.
SQL: SELECT LName FROM Student WHERE age  =  (SELECT min(age) FROM Student)
Database: allergy_1
Question: Show the student id of the oldest student.
SQL: SELECT StuID FROM Student WHERE age  =  (SELECT max(age) FROM Student)
Database: allergy_1
Question: What student id corresponds to the oldest student?
SQL: SELECT StuID FROM Student WHERE age  =  (SELECT max(age) FROM Student)
Database: allergy_1
Question: Show all majors and corresponding number of students.
SQL: SELECT major ,  count(*) FROM Student GROUP BY major
Database: allergy_1
Question: How many students are there for each major?
SQL: SELECT major ,  count(*) FROM Student GROUP BY major
Database: allergy_1
Question: Which major has most number of students?
SQL: SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: What is the largest major?
SQL: SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: Show all ages and corresponding number of students.
SQL: SELECT age ,  count(*) FROM Student GROUP BY age
Database: allergy_1
Question: How old is each student and how many students are each age?
SQL: SELECT age ,  count(*) FROM Student GROUP BY age
Database: allergy_1
Question: Show the average age for male and female students.
SQL: SELECT avg(age) ,  sex FROM Student GROUP BY sex
Database: allergy_1
Question: What are the average ages for male and female students?
SQL: SELECT avg(age) ,  sex FROM Student GROUP BY sex
Database: allergy_1
Question: Show all cities and corresponding number of students.
SQL: SELECT city_code ,  count(*) FROM Student GROUP BY city_code
Database: allergy_1
Question: How many students live in each city?
SQL: SELECT city_code ,  count(*) FROM Student GROUP BY city_code
Database: allergy_1
Question: Show all advisors and corresponding number of students.
SQL: SELECT advisor ,  count(*) FROM Student GROUP BY advisor
Database: allergy_1
Question: How many students does each advisor have?
SQL: SELECT advisor ,  count(*) FROM Student GROUP BY advisor
Database: allergy_1
Question: Which advisor has most number of students?
SQL: SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: Give the advisor with the most students.
SQL: SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1
Database: allergy_1
Question: How many students have cat allergies?
SQL: SELECT count(*) FROM Has_allergy WHERE Allergy  =  "Cat"
Database: allergy_1
Question: How many students are affected by cat allergies?
SQL: SELECT count(*) FROM Has_allergy WHERE Allergy  =  "Cat"
Database: allergy_1
Question: Show all student IDs who have at least two allergies.
SQL: SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*)  >=  2