db_id
stringclasses
146 values
question
stringlengths
3
224
query
stringlengths
18
577
query_format
stringlengths
18
577
answer
stringlengths
13
874k
flight_1
What are the numbers of the shortest flights?
SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
[{'flno': 68}, {'flno': 346}, {'flno': 13}]
flight_1
What is the average distance and average price for flights from Los Angeles.
SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"
SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"
[{'avg(distance)': 3247.625, 'avg(price)': 345.16}]
flight_1
What is the average distance and price for all flights from LA?
SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"
SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"
[{'avg(distance)': 3247.625, 'avg(price)': 345.16}]
flight_1
Show all origins and the number of flights from each origin.
SELECT origin , count(*) FROM Flight GROUP BY origin
SELECT origin , count(*) FROM Flight GROUP BY origin
[{'origin': 'Chicago', 'count(*)': 2}, {'origin': 'Los Angeles', 'count(*)': 8}]
flight_1
For each origin, how many flights came from there?
SELECT origin , count(*) FROM Flight GROUP BY origin
SELECT origin , count(*) FROM Flight GROUP BY origin
[{'origin': 'Chicago', 'count(*)': 2}, {'origin': 'Los Angeles', 'count(*)': 8}]
flight_1
Show all destinations and the number of flights to each destination.
SELECT destination , count(*) FROM Flight GROUP BY destination
SELECT destination , count(*) FROM Flight GROUP BY destination
[{'destination': 'Boston', 'count(*)': 1}, {'destination': 'Chicago', 'count(*)': 1}, {'destination': 'Dallas', 'count(*)': 1}, {'destination': 'Honolulu', 'count(*)': 2}, {'destination': 'Los Angeles', 'count(*)': 1}, {'destination': 'New York', 'count(*)': 1}, {'destination': 'Sydney', 'count(*)': 1}, {'destination': 'Tokyo', 'count(*)': 1}, {'destination': 'Washington D.C.', 'count(*)': 1}]
flight_1
What are the destinations and number of flights to each one?
SELECT destination , count(*) FROM Flight GROUP BY destination
SELECT destination , count(*) FROM Flight GROUP BY destination
[{'destination': 'Boston', 'count(*)': 1}, {'destination': 'Chicago', 'count(*)': 1}, {'destination': 'Dallas', 'count(*)': 1}, {'destination': 'Honolulu', 'count(*)': 2}, {'destination': 'Los Angeles', 'count(*)': 1}, {'destination': 'New York', 'count(*)': 1}, {'destination': 'Sydney', 'count(*)': 1}, {'destination': 'Tokyo', 'count(*)': 1}, {'destination': 'Washington D.C.', 'count(*)': 1}]
flight_1
Which origin has most number of flights?
SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
[{'origin': 'Los Angeles'}]
flight_1
What place has the most flights coming from there?
SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
[{'origin': 'Los Angeles'}]
flight_1
Which destination has least number of flights?
SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
[{'destination': 'Boston'}]
flight_1
What destination has the fewest number of flights?
SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
[{'destination': 'Boston'}]
flight_1
What is the aircraft name for the flight with number 99
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
[{'name': 'Boeing 747-400'}]
flight_1
What is the name of the aircraft that was on flight number 99?
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
[{'name': 'Boeing 747-400'}]
flight_1
Show all flight numbers with aircraft Airbus A340-300.
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
[{'flno': 13}, {'flno': 7}]
flight_1
What are the flight numbers for the aircraft Airbus A340-300?
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
[{'flno': 13}, {'flno': 7}]
flight_1
Show aircraft names and number of flights for each aircraft.
SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
[{'name': 'Boeing 747-400', 'count(*)': 1}, {'name': 'Boeing 737-800', 'count(*)': 1}, {'name': 'Airbus A340-300', 'count(*)': 2}, {'name': 'Embraer ERJ-145', 'count(*)': 1}, {'name': 'SAAB 340', 'count(*)': 1}, {'name': 'Piper Archer III', 'count(*)': 1}, {'name': 'Lockheed L1011', 'count(*)': 2}, {'name': 'Boeing 757-300', 'count(*)': 1}]
flight_1
What is the name of each aircraft and how many flights does each one complete?
SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
[{'name': 'Boeing 747-400', 'count(*)': 1}, {'name': 'Boeing 737-800', 'count(*)': 1}, {'name': 'Airbus A340-300', 'count(*)': 2}, {'name': 'Embraer ERJ-145', 'count(*)': 1}, {'name': 'SAAB 340', 'count(*)': 1}, {'name': 'Piper Archer III', 'count(*)': 1}, {'name': 'Lockheed L1011', 'count(*)': 2}, {'name': 'Boeing 757-300', 'count(*)': 1}]
flight_1
Show names for all aircraft with at least two flights.
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2
[{'name': 'Airbus A340-300'}, {'name': 'Lockheed L1011'}]
flight_1
What are the names for all aircrafts with at least 2 flights?
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2
[{'name': 'Airbus A340-300'}, {'name': 'Lockheed L1011'}]
flight_1
How many employees have certificate.
SELECT count(DISTINCT eid) FROM Certificate
SELECT count(DISTINCT eid) FROM Certificate
[{'count(DISTINCT eid)': 20}]
flight_1
What is the count of distinct employees with certificates?
SELECT count(DISTINCT eid) FROM Certificate
SELECT count(DISTINCT eid) FROM Certificate
[{'count(DISTINCT eid)': 20}]
flight_1
Show ids for all employees who don't have a certificate.
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
[{'eid': 15645489}, {'eid': 248965255}, {'eid': 254099823}, {'eid': 287321212}, {'eid': 310454877}, {'eid': 348121549}, {'eid': 486512566}, {'eid': 489221823}, {'eid': 489456522}, {'eid': 552455348}, {'eid': 619023588}]
flight_1
What are the ids of all employees that don't have certificates?
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
[{'eid': 15645489}, {'eid': 248965255}, {'eid': 254099823}, {'eid': 287321212}, {'eid': 310454877}, {'eid': 348121549}, {'eid': 486512566}, {'eid': 489221823}, {'eid': 489456522}, {'eid': 552455348}, {'eid': 619023588}]
flight_1
Show names for all aircrafts of which John Williams has certificates.
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"
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"
[{'name': 'Boeing 737-800'}, {'name': 'Boeing 757-300'}]
flight_1
What are the names of all aircrafts that John Williams have certificates to be able to fly?
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"
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"
[{'name': 'Boeing 737-800'}, {'name': 'Boeing 757-300'}]
flight_1
Show names for all employees who have certificate of Boeing 737-800.
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"
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"
[{'name': 'John Williams'}, {'name': 'Mary Johnson'}, {'name': 'Betty Adams'}, {'name': 'James Smith'}, {'name': 'George Wright'}, {'name': 'Larry West'}, {'name': 'Mark Young'}, {'name': 'Lisa Walker'}]
flight_1
What are the names of all employees who have a certificate to fly Boeing 737-800?
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"
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"
[{'name': 'John Williams'}, {'name': 'Mary Johnson'}, {'name': 'Betty Adams'}, {'name': 'James Smith'}, {'name': 'George Wright'}, {'name': 'Larry West'}, {'name': 'Mark Young'}, {'name': 'Lisa Walker'}]
flight_1
Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
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"
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"
[{'name': 'Betty Adams'}, {'name': 'George Wright'}, {'name': 'Lisa Walker'}, {'name': 'Mark Young'}]
flight_1
What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300?
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"
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"
[{'name': 'Betty Adams'}, {'name': 'George Wright'}, {'name': 'Lisa Walker'}, {'name': 'Mark Young'}]
flight_1
Show names for all employees who do not have certificate of Boeing 737-800.
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"
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"
[{'name': 'Angela Martinez'}, {'name': 'Barbara Wilson'}, {'name': 'Chad Stewart'}, {'name': 'David Anderson'}, {'name': 'Donald King'}, {'name': 'Dorthy Lewis'}, {'name': 'Elizabeth Taylor'}, {'name': 'Eric Cooper'}, {'name': 'Haywood Kelly'}, {'name': 'Jennifer Thomas'}, {'name': 'Joseph Thompson'}, {'name': 'Karen Scott'}, {'name': 'Lawrence Sperry'}, {'name': 'Linda Davis'}, {'name': 'Michael Miller'}, {'name': 'Milo Brooks'}, {'name': 'Patricia Jones'}, {'name': 'Richard Jackson'}, {'name': 'Robert Brown'}, {'name': 'William Jones'}, {'name': 'William Moore'}, {'name': 'William Ward'}]
flight_1
What are the names of all employees who are not certified to fly Boeing 737-800s?
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"
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"
[{'name': 'Angela Martinez'}, {'name': 'Barbara Wilson'}, {'name': 'Chad Stewart'}, {'name': 'David Anderson'}, {'name': 'Donald King'}, {'name': 'Dorthy Lewis'}, {'name': 'Elizabeth Taylor'}, {'name': 'Eric Cooper'}, {'name': 'Haywood Kelly'}, {'name': 'Jennifer Thomas'}, {'name': 'Joseph Thompson'}, {'name': 'Karen Scott'}, {'name': 'Lawrence Sperry'}, {'name': 'Linda Davis'}, {'name': 'Michael Miller'}, {'name': 'Milo Brooks'}, {'name': 'Patricia Jones'}, {'name': 'Richard Jackson'}, {'name': 'Robert Brown'}, {'name': 'William Jones'}, {'name': 'William Moore'}, {'name': 'William Ward'}]
flight_1
Show the name of aircraft which fewest people have its certificate.
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
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
[{'name': 'Boeing 737-800'}]
flight_1
What are the names of the aircraft that the least people are certified to fly?
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
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
[{'name': 'Boeing 737-800'}]
flight_1
Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.
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
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
[{'name': 'Boeing 747-400'}, {'name': 'Lockheed L1011'}, {'name': 'Boeing 777-300'}, {'name': 'Airbus A340-300'}, {'name': 'Boeing 767-400ER'}]
flight_1
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?
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
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
[{'name': 'Boeing 747-400'}, {'name': 'Lockheed L1011'}, {'name': 'Boeing 777-300'}, {'name': 'Airbus A340-300'}, {'name': 'Boeing 767-400ER'}]
flight_1
what is the salary and name of the employee who has the most number of aircraft certificates?
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
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
[{'name': 'George Wright', 'salary': 289950}]
flight_1
What is the salaray and name of the employee that is certified to fly the most planes?
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
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
[{'name': 'George Wright', 'salary': 289950}]
flight_1
What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?
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
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
[{'name': 'Lisa Walker'}]
flight_1
What is the salaray and name of the employee with the most certificates to fly planes more than 5000?
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
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
[{'name': 'Lisa Walker'}]
allergy_1
How many allergies are there?
SELECT count(DISTINCT allergy) FROM Allergy_type
SELECT count(DISTINCT allergy) FROM Allergy_type
[{'count(DISTINCT allergy)': 14}]
allergy_1
How many allergy entries are there?
SELECT count(DISTINCT allergy) FROM Allergy_type
SELECT count(DISTINCT allergy) FROM Allergy_type
[{'count(DISTINCT allergy)': 14}]
allergy_1
How many different allergy types exist?
SELECT count(DISTINCT allergytype) FROM Allergy_type
SELECT count(DISTINCT allergytype) FROM Allergy_type
[{'count(DISTINCT allergytype)': 3}]
allergy_1
How many distinct allergies are there?
SELECT count(DISTINCT allergytype) FROM Allergy_type
SELECT count(DISTINCT allergytype) FROM Allergy_type
[{'count(DISTINCT allergytype)': 3}]
allergy_1
Show all allergy types.
SELECT DISTINCT allergytype FROM Allergy_type
SELECT DISTINCT allergytype FROM Allergy_type
[{'AllergyType': 'food'}, {'AllergyType': 'environmental'}, {'AllergyType': 'animal'}]
allergy_1
What are the different allergy types?
SELECT DISTINCT allergytype FROM Allergy_type
SELECT DISTINCT allergytype FROM Allergy_type
[{'AllergyType': 'food'}, {'AllergyType': 'environmental'}, {'AllergyType': 'animal'}]
allergy_1
Show all allergies and their types.
SELECT allergy , allergytype FROM Allergy_type
SELECT allergy , allergytype FROM Allergy_type
[{'Allergy': 'Eggs', 'AllergyType': 'food'}, {'Allergy': 'Nuts', 'AllergyType': 'food'}, {'Allergy': 'Milk', 'AllergyType': 'food'}, {'Allergy': 'Shellfish', 'AllergyType': 'food'}, {'Allergy': 'Anchovies', 'AllergyType': 'food'}, {'Allergy': 'Wheat', 'AllergyType': 'food'}, {'Allergy': 'Soy', 'AllergyType': 'food'}, {'Allergy': 'Ragweed', 'AllergyType': 'environmental'}, {'Allergy': 'Tree Pollen', 'AllergyType': 'environmental'}, {'Allergy': 'Grass Pollen', 'AllergyType': 'environmental'}, {'Allergy': 'Cat', 'AllergyType': 'animal'}, {'Allergy': 'Dog', 'AllergyType': 'animal'}, {'Allergy': 'Rodent', 'AllergyType': 'animal'}, {'Allergy': 'Bee Stings', 'AllergyType': 'animal'}]
allergy_1
What are the allergies and their types?
SELECT allergy , allergytype FROM Allergy_type
SELECT allergy , allergytype FROM Allergy_type
[{'Allergy': 'Eggs', 'AllergyType': 'food'}, {'Allergy': 'Nuts', 'AllergyType': 'food'}, {'Allergy': 'Milk', 'AllergyType': 'food'}, {'Allergy': 'Shellfish', 'AllergyType': 'food'}, {'Allergy': 'Anchovies', 'AllergyType': 'food'}, {'Allergy': 'Wheat', 'AllergyType': 'food'}, {'Allergy': 'Soy', 'AllergyType': 'food'}, {'Allergy': 'Ragweed', 'AllergyType': 'environmental'}, {'Allergy': 'Tree Pollen', 'AllergyType': 'environmental'}, {'Allergy': 'Grass Pollen', 'AllergyType': 'environmental'}, {'Allergy': 'Cat', 'AllergyType': 'animal'}, {'Allergy': 'Dog', 'AllergyType': 'animal'}, {'Allergy': 'Rodent', 'AllergyType': 'animal'}, {'Allergy': 'Bee Stings', 'AllergyType': 'animal'}]
allergy_1
Show all allergies with type food.
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"
[{'Allergy': 'Anchovies'}, {'Allergy': 'Eggs'}, {'Allergy': 'Milk'}, {'Allergy': 'Nuts'}, {'Allergy': 'Shellfish'}, {'Allergy': 'Soy'}, {'Allergy': 'Wheat'}]
allergy_1
What are all the different food allergies?
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"
[{'Allergy': 'Anchovies'}, {'Allergy': 'Eggs'}, {'Allergy': 'Milk'}, {'Allergy': 'Nuts'}, {'Allergy': 'Shellfish'}, {'Allergy': 'Soy'}, {'Allergy': 'Wheat'}]
allergy_1
What is the type of allergy Cat?
SELECT allergytype FROM Allergy_type WHERE allergy = "Cat"
SELECT allergytype FROM Allergy_type WHERE allergy = "Cat"
[{'AllergyType': 'animal'}]
allergy_1
What is allergy type of a cat allergy?
SELECT allergytype FROM Allergy_type WHERE allergy = "Cat"
SELECT allergytype FROM Allergy_type WHERE allergy = "Cat"
[{'AllergyType': 'animal'}]
allergy_1
How many allergies have type animal?
SELECT count(*) FROM Allergy_type WHERE allergytype = "animal"
SELECT count(*) FROM Allergy_type WHERE allergytype = "animal"
[{'count(*)': 4}]
allergy_1
How many animal type allergies exist?
SELECT count(*) FROM Allergy_type WHERE allergytype = "animal"
SELECT count(*) FROM Allergy_type WHERE allergytype = "animal"
[{'count(*)': 4}]
allergy_1
Show all allergy types and the number of allergies in each type.
SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype
SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype
[{'AllergyType': 'animal', 'count(*)': 4}, {'AllergyType': 'environmental', 'count(*)': 3}, {'AllergyType': 'food', 'count(*)': 7}]
allergy_1
What are the allergy types and how many allergies correspond to each one?
SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype
SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype
[{'AllergyType': 'animal', 'count(*)': 4}, {'AllergyType': 'environmental', 'count(*)': 3}, {'AllergyType': 'food', 'count(*)': 7}]
allergy_1
Which allergy type has most number of allergies?
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1
[{'AllergyType': 'food'}]
allergy_1
Which allergy type is most common?
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1
[{'AllergyType': 'food'}]
allergy_1
Which allergy type has least number of allergies?
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
[{'AllergyType': 'environmental'}]
allergy_1
Which allergy type is the least common?
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
[{'AllergyType': 'environmental'}]
allergy_1
How many students are there?
SELECT count(*) FROM Student
SELECT count(*) FROM Student
[{'count(*)': 34}]
allergy_1
What is the total number of students?
SELECT count(*) FROM Student
SELECT count(*) FROM Student
[{'count(*)': 34}]
allergy_1
Show first name and last name for all students.
SELECT Fname , Lname FROM Student
SELECT Fname , Lname FROM Student
[{'Fname': 'Linda', 'LName': 'Smith'}, {'Fname': 'Tracy', 'LName': 'Kim'}, {'Fname': 'Shiela', 'LName': 'Jones'}, {'Fname': 'Dinesh', 'LName': 'Kumar'}, {'Fname': 'Paul', 'LName': 'Gompers'}, {'Fname': 'Andy', 'LName': 'Schultz'}, {'Fname': 'Lisa', 'LName': 'Apap'}, {'Fname': 'Jandy', 'LName': 'Nelson'}, {'Fname': 'Eric', 'LName': 'Tai'}, {'Fname': 'Derek', 'LName': 'Lee'}, {'Fname': 'David', 'LName': 'Adams'}, {'Fname': 'Steven', 'LName': 'Davis'}, {'Fname': 'Charles', 'LName': 'Norris'}, {'Fname': 'Susan', 'LName': 'Lee'}, {'Fname': 'Mark', 'LName': 'Schwartz'}, {'Fname': 'Bruce', 'LName': 'Wilson'}, {'Fname': 'Michael', 'LName': 'Leighton'}, {'Fname': 'Arthur', 'LName': 'Pang'}, {'Fname': 'Ian', 'LName': 'Thornton'}, {'Fname': 'George', 'LName': 'Andreou'}, {'Fname': 'Michael', 'LName': 'Woods'}, {'Fname': 'David', 'LName': 'Shieber'}, {'Fname': 'Stacy', 'LName': 'Prater'}, {'Fname': 'Mark', 'LName': 'Goldman'}, {'Fname': 'Eric', 'LName': 'Pang'}, {'Fname': 'Paul', 'LName': 'Brody'}, {'Fname': 'Eric', 'LName': 'Rugh'}, {'Fname': 'Jun', 'LName': 'Han'}, {'Fname': 'Lisa', 'LName': 'Cheng'}, {'Fname': 'Sarah', 'LName': 'Smith'}, {'Fname': 'Eric', 'LName': 'Brown'}, {'Fname': 'William', 'LName': 'Simms'}, {'Fname': 'Eric', 'LName': 'Epp'}, {'Fname': 'Sarah', 'LName': 'Schmidt'}]
allergy_1
What are the full names of all students
SELECT Fname , Lname FROM Student
SELECT Fname , Lname FROM Student
[{'Fname': 'Linda', 'LName': 'Smith'}, {'Fname': 'Tracy', 'LName': 'Kim'}, {'Fname': 'Shiela', 'LName': 'Jones'}, {'Fname': 'Dinesh', 'LName': 'Kumar'}, {'Fname': 'Paul', 'LName': 'Gompers'}, {'Fname': 'Andy', 'LName': 'Schultz'}, {'Fname': 'Lisa', 'LName': 'Apap'}, {'Fname': 'Jandy', 'LName': 'Nelson'}, {'Fname': 'Eric', 'LName': 'Tai'}, {'Fname': 'Derek', 'LName': 'Lee'}, {'Fname': 'David', 'LName': 'Adams'}, {'Fname': 'Steven', 'LName': 'Davis'}, {'Fname': 'Charles', 'LName': 'Norris'}, {'Fname': 'Susan', 'LName': 'Lee'}, {'Fname': 'Mark', 'LName': 'Schwartz'}, {'Fname': 'Bruce', 'LName': 'Wilson'}, {'Fname': 'Michael', 'LName': 'Leighton'}, {'Fname': 'Arthur', 'LName': 'Pang'}, {'Fname': 'Ian', 'LName': 'Thornton'}, {'Fname': 'George', 'LName': 'Andreou'}, {'Fname': 'Michael', 'LName': 'Woods'}, {'Fname': 'David', 'LName': 'Shieber'}, {'Fname': 'Stacy', 'LName': 'Prater'}, {'Fname': 'Mark', 'LName': 'Goldman'}, {'Fname': 'Eric', 'LName': 'Pang'}, {'Fname': 'Paul', 'LName': 'Brody'}, {'Fname': 'Eric', 'LName': 'Rugh'}, {'Fname': 'Jun', 'LName': 'Han'}, {'Fname': 'Lisa', 'LName': 'Cheng'}, {'Fname': 'Sarah', 'LName': 'Smith'}, {'Fname': 'Eric', 'LName': 'Brown'}, {'Fname': 'William', 'LName': 'Simms'}, {'Fname': 'Eric', 'LName': 'Epp'}, {'Fname': 'Sarah', 'LName': 'Schmidt'}]
allergy_1
How many different advisors are listed?
SELECT count(DISTINCT advisor) FROM Student
SELECT count(DISTINCT advisor) FROM Student
[{'count(DISTINCT advisor)': 18}]
allergy_1
How many advisors are there?
SELECT count(DISTINCT advisor) FROM Student
SELECT count(DISTINCT advisor) FROM Student
[{'count(DISTINCT advisor)': 18}]
allergy_1
Show all majors.
SELECT DISTINCT Major FROM Student
SELECT DISTINCT Major FROM Student
[{'Major': 600}, {'Major': 520}, {'Major': 540}, {'Major': 550}, {'Major': 100}, {'Major': 50}]
allergy_1
What are the different majors?
SELECT DISTINCT Major FROM Student
SELECT DISTINCT Major FROM Student
[{'Major': 600}, {'Major': 520}, {'Major': 540}, {'Major': 550}, {'Major': 100}, {'Major': 50}]
allergy_1
Show all cities where students live.
SELECT DISTINCT city_code FROM Student
SELECT DISTINCT city_code FROM Student
[{'city_code': 'BAL'}, {'city_code': 'HKG'}, {'city_code': 'WAS'}, {'city_code': 'CHI'}, {'city_code': 'YYZ'}, {'city_code': 'PIT'}, {'city_code': 'HOU'}, {'city_code': 'PHL'}, {'city_code': 'DAL'}, {'city_code': 'DET'}, {'city_code': 'LON'}, {'city_code': 'NYC'}, {'city_code': 'LOS'}, {'city_code': 'ROC'}, {'city_code': 'PEK'}, {'city_code': 'SFO'}, {'city_code': 'ATL'}, {'city_code': 'NAR'}, {'city_code': 'BOS'}]
allergy_1
What cities do students live in?
SELECT DISTINCT city_code FROM Student
SELECT DISTINCT city_code FROM Student
[{'city_code': 'BAL'}, {'city_code': 'HKG'}, {'city_code': 'WAS'}, {'city_code': 'CHI'}, {'city_code': 'YYZ'}, {'city_code': 'PIT'}, {'city_code': 'HOU'}, {'city_code': 'PHL'}, {'city_code': 'DAL'}, {'city_code': 'DET'}, {'city_code': 'LON'}, {'city_code': 'NYC'}, {'city_code': 'LOS'}, {'city_code': 'ROC'}, {'city_code': 'PEK'}, {'city_code': 'SFO'}, {'city_code': 'ATL'}, {'city_code': 'NAR'}, {'city_code': 'BOS'}]
allergy_1
Show first name, last name, age for all female students. Their sex is F.
SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'
SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'
[{'Fname': 'Linda', 'LName': 'Smith', 'Age': 18}, {'Fname': 'Tracy', 'LName': 'Kim', 'Age': 19}, {'Fname': 'Shiela', 'LName': 'Jones', 'Age': 21}, {'Fname': 'Lisa', 'LName': 'Apap', 'Age': 18}, {'Fname': 'Jandy', 'LName': 'Nelson', 'Age': 20}, {'Fname': 'Susan', 'LName': 'Lee', 'Age': 16}, {'Fname': 'Stacy', 'LName': 'Prater', 'Age': 18}, {'Fname': 'Lisa', 'LName': 'Cheng', 'Age': 21}, {'Fname': 'Sarah', 'LName': 'Smith', 'Age': 20}, {'Fname': 'Sarah', 'LName': 'Schmidt', 'Age': 26}]
allergy_1
What are the full names and ages for all female students whose sex is F?
SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'
SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'
[{'Fname': 'Linda', 'LName': 'Smith', 'Age': 18}, {'Fname': 'Tracy', 'LName': 'Kim', 'Age': 19}, {'Fname': 'Shiela', 'LName': 'Jones', 'Age': 21}, {'Fname': 'Lisa', 'LName': 'Apap', 'Age': 18}, {'Fname': 'Jandy', 'LName': 'Nelson', 'Age': 20}, {'Fname': 'Susan', 'LName': 'Lee', 'Age': 16}, {'Fname': 'Stacy', 'LName': 'Prater', 'Age': 18}, {'Fname': 'Lisa', 'LName': 'Cheng', 'Age': 21}, {'Fname': 'Sarah', 'LName': 'Smith', 'Age': 20}, {'Fname': 'Sarah', 'LName': 'Schmidt', 'Age': 26}]
allergy_1
Show student ids for all male students.
SELECT StuID FROM Student WHERE Sex = 'M'
SELECT StuID FROM Student WHERE Sex = 'M'
[{'StuID': 1004}, {'StuID': 1005}, {'StuID': 1006}, {'StuID': 1009}, {'StuID': 1010}, {'StuID': 1011}, {'StuID': 1012}, {'StuID': 1014}, {'StuID': 1016}, {'StuID': 1017}, {'StuID': 1018}, {'StuID': 1019}, {'StuID': 1020}, {'StuID': 1021}, {'StuID': 1022}, {'StuID': 1023}, {'StuID': 1025}, {'StuID': 1026}, {'StuID': 1027}, {'StuID': 1028}, {'StuID': 1029}, {'StuID': 1032}, {'StuID': 1033}, {'StuID': 1034}]
allergy_1
What are the student ids for all male students?
SELECT StuID FROM Student WHERE Sex = 'M'
SELECT StuID FROM Student WHERE Sex = 'M'
[{'StuID': 1004}, {'StuID': 1005}, {'StuID': 1006}, {'StuID': 1009}, {'StuID': 1010}, {'StuID': 1011}, {'StuID': 1012}, {'StuID': 1014}, {'StuID': 1016}, {'StuID': 1017}, {'StuID': 1018}, {'StuID': 1019}, {'StuID': 1020}, {'StuID': 1021}, {'StuID': 1022}, {'StuID': 1023}, {'StuID': 1025}, {'StuID': 1026}, {'StuID': 1027}, {'StuID': 1028}, {'StuID': 1029}, {'StuID': 1032}, {'StuID': 1033}, {'StuID': 1034}]
allergy_1
How many students are age 18?
SELECT count(*) FROM Student WHERE age = 18
SELECT count(*) FROM Student WHERE age = 18
[{'count(*)': 10}]
allergy_1
How many students are 18 years old?
SELECT count(*) FROM Student WHERE age = 18
SELECT count(*) FROM Student WHERE age = 18
[{'count(*)': 10}]
allergy_1
Show all student ids who are older than 20.
SELECT StuID FROM Student WHERE age > 20
SELECT StuID FROM Student WHERE age > 20
[{'StuID': 1003}, {'StuID': 1005}, {'StuID': 1011}, {'StuID': 1017}, {'StuID': 1020}, {'StuID': 1030}, {'StuID': 1035}]
allergy_1
What are the student ids for students over 20 years old?
SELECT StuID FROM Student WHERE age > 20
SELECT StuID FROM Student WHERE age > 20
[{'StuID': 1003}, {'StuID': 1005}, {'StuID': 1011}, {'StuID': 1017}, {'StuID': 1020}, {'StuID': 1030}, {'StuID': 1035}]
allergy_1
Which city does the student whose last name is "Kim" live in?
SELECT city_code FROM Student WHERE LName = "Kim"
SELECT city_code FROM Student WHERE LName = "Kim"
[{'city_code': 'HKG'}]
allergy_1
Give the city that the student whose family name is Kim lives in.
SELECT city_code FROM Student WHERE LName = "Kim"
SELECT city_code FROM Student WHERE LName = "Kim"
[{'city_code': 'HKG'}]
allergy_1
Who is the advisor of student with ID 1004?
SELECT Advisor FROM Student WHERE StuID = 1004
SELECT Advisor FROM Student WHERE StuID = 1004
[{'Advisor': 8423}]
allergy_1
Who advises student 1004?
SELECT Advisor FROM Student WHERE StuID = 1004
SELECT Advisor FROM Student WHERE StuID = 1004
[{'Advisor': 8423}]
allergy_1
How many students live in HKG or CHI?
SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI"
SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI"
[{'count(*)': 4}]
allergy_1
Give the number of students living in either HKG or CHI.
SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI"
SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI"
[{'count(*)': 4}]
allergy_1
Show the minimum, average, and maximum age of all students.
SELECT min(age) , avg(age) , max(age) FROM Student
SELECT min(age) , avg(age) , max(age) FROM Student
[{'min(age)': 16, 'avg(age)': 19.558823529411764, 'max(age)': 27}]
allergy_1
What is the minimum, mean, and maximum age across all students?
SELECT min(age) , avg(age) , max(age) FROM Student
SELECT min(age) , avg(age) , max(age) FROM Student
[{'min(age)': 16, 'avg(age)': 19.558823529411764, 'max(age)': 27}]
allergy_1
What is the last name of the youngest student?
SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)
SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)
[{'LName': 'Lee'}]
allergy_1
Provide the last name of the youngest student.
SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)
SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)
[{'LName': 'Lee'}]
allergy_1
Show the student id of the oldest student.
SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)
SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)
[{'StuID': 1017}]
allergy_1
What student id corresponds to the oldest student?
SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)
SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)
[{'StuID': 1017}]
allergy_1
Show all majors and corresponding number of students.
SELECT major , count(*) FROM Student GROUP BY major
SELECT major , count(*) FROM Student GROUP BY major
[{'Major': 50, 'count(*)': 2}, {'Major': 100, 'count(*)': 1}, {'Major': 520, 'count(*)': 6}, {'Major': 540, 'count(*)': 2}, {'Major': 550, 'count(*)': 5}, {'Major': 600, 'count(*)': 18}]
allergy_1
How many students are there for each major?
SELECT major , count(*) FROM Student GROUP BY major
SELECT major , count(*) FROM Student GROUP BY major
[{'Major': 50, 'count(*)': 2}, {'Major': 100, 'count(*)': 1}, {'Major': 520, 'count(*)': 6}, {'Major': 540, 'count(*)': 2}, {'Major': 550, 'count(*)': 5}, {'Major': 600, 'count(*)': 18}]
allergy_1
Which major has most number of students?
SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1
SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1
[{'Major': 600}]
allergy_1
What is the largest major?
SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1
SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1
[{'Major': 600}]
allergy_1
Show all ages and corresponding number of students.
SELECT age , count(*) FROM Student GROUP BY age
SELECT age , count(*) FROM Student GROUP BY age
[{'Age': 16, 'count(*)': 1}, {'Age': 17, 'count(*)': 4}, {'Age': 18, 'count(*)': 10}, {'Age': 19, 'count(*)': 4}, {'Age': 20, 'count(*)': 8}, {'Age': 21, 'count(*)': 2}, {'Age': 22, 'count(*)': 2}, {'Age': 26, 'count(*)': 2}, {'Age': 27, 'count(*)': 1}]
allergy_1
How old is each student and how many students are each age?
SELECT age , count(*) FROM Student GROUP BY age
SELECT age , count(*) FROM Student GROUP BY age
[{'Age': 16, 'count(*)': 1}, {'Age': 17, 'count(*)': 4}, {'Age': 18, 'count(*)': 10}, {'Age': 19, 'count(*)': 4}, {'Age': 20, 'count(*)': 8}, {'Age': 21, 'count(*)': 2}, {'Age': 22, 'count(*)': 2}, {'Age': 26, 'count(*)': 2}, {'Age': 27, 'count(*)': 1}]
allergy_1
Show the average age for male and female students.
SELECT avg(age) , sex FROM Student GROUP BY sex
SELECT avg(age) , sex FROM Student GROUP BY sex
[{'avg(age)': 19.7, 'Sex': 'F'}, {'avg(age)': 19.5, 'Sex': 'M'}]
allergy_1
What are the average ages for male and female students?
SELECT avg(age) , sex FROM Student GROUP BY sex
SELECT avg(age) , sex FROM Student GROUP BY sex
[{'avg(age)': 19.7, 'Sex': 'F'}, {'avg(age)': 19.5, 'Sex': 'M'}]
allergy_1
Show all cities and corresponding number of students.
SELECT city_code , count(*) FROM Student GROUP BY city_code
SELECT city_code , count(*) FROM Student GROUP BY city_code
[{'city_code': 'ATL', 'count(*)': 1}, {'city_code': 'BAL', 'count(*)': 4}, {'city_code': 'BOS', 'count(*)': 1}, {'city_code': 'CHI', 'count(*)': 1}, {'city_code': 'DAL', 'count(*)': 1}, {'city_code': 'DET', 'count(*)': 1}, {'city_code': 'HKG', 'count(*)': 3}, {'city_code': 'HOU', 'count(*)': 1}, {'city_code': 'LON', 'count(*)': 1}, {'city_code': 'LOS', 'count(*)': 1}, {'city_code': 'NAR', 'count(*)': 1}, {'city_code': 'NYC', 'count(*)': 3}, {'city_code': 'PEK', 'count(*)': 1}, {'city_code': 'PHL', 'count(*)': 3}, {'city_code': 'PIT', 'count(*)': 4}, {'city_code': 'ROC', 'count(*)': 1}, {'city_code': 'SFO', 'count(*)': 1}, {'city_code': 'WAS', 'count(*)': 3}, {'city_code': 'YYZ', 'count(*)': 2}]
allergy_1
How many students live in each city?
SELECT city_code , count(*) FROM Student GROUP BY city_code
SELECT city_code , count(*) FROM Student GROUP BY city_code
[{'city_code': 'ATL', 'count(*)': 1}, {'city_code': 'BAL', 'count(*)': 4}, {'city_code': 'BOS', 'count(*)': 1}, {'city_code': 'CHI', 'count(*)': 1}, {'city_code': 'DAL', 'count(*)': 1}, {'city_code': 'DET', 'count(*)': 1}, {'city_code': 'HKG', 'count(*)': 3}, {'city_code': 'HOU', 'count(*)': 1}, {'city_code': 'LON', 'count(*)': 1}, {'city_code': 'LOS', 'count(*)': 1}, {'city_code': 'NAR', 'count(*)': 1}, {'city_code': 'NYC', 'count(*)': 3}, {'city_code': 'PEK', 'count(*)': 1}, {'city_code': 'PHL', 'count(*)': 3}, {'city_code': 'PIT', 'count(*)': 4}, {'city_code': 'ROC', 'count(*)': 1}, {'city_code': 'SFO', 'count(*)': 1}, {'city_code': 'WAS', 'count(*)': 3}, {'city_code': 'YYZ', 'count(*)': 2}]
allergy_1
Show all advisors and corresponding number of students.
SELECT advisor , count(*) FROM Student GROUP BY advisor
SELECT advisor , count(*) FROM Student GROUP BY advisor
[{'Advisor': 1121, 'count(*)': 3}, {'Advisor': 1148, 'count(*)': 3}, {'Advisor': 2192, 'count(*)': 4}, {'Advisor': 2311, 'count(*)': 3}, {'Advisor': 5718, 'count(*)': 2}, {'Advisor': 7134, 'count(*)': 2}, {'Advisor': 7271, 'count(*)': 2}, {'Advisor': 7712, 'count(*)': 1}, {'Advisor': 7723, 'count(*)': 1}, {'Advisor': 7792, 'count(*)': 1}, {'Advisor': 8423, 'count(*)': 1}, {'Advisor': 8721, 'count(*)': 1}, {'Advisor': 8722, 'count(*)': 3}, {'Advisor': 8723, 'count(*)': 1}, {'Advisor': 8741, 'count(*)': 1}, {'Advisor': 8772, 'count(*)': 3}, {'Advisor': 8918, 'count(*)': 1}, {'Advisor': 9172, 'count(*)': 1}]