db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
flight_1 | select flno from flight order by distance asc limit 3 | Question: what are the numbers of the shortest flights? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid, certific... | what are the numbers of the shortest flights? |
flight_1 | select avg(distance) , avg(price) from flight where origin = 'los angeles' | Question: what is the average distance and average price for flights from los angeles. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certifica... | what is the average distance and average price for flights from los angeles. |
flight_1 | select avg(distance) , avg(price) from flight where origin = 'los angeles' | Question: what is the average distance and price for all flights from la? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = airc... | what is the average distance and price for all flights from la? |
flight_1 | select origin , count(*) from flight group by origin | Question: show all origins and the number of flights from each origin. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraf... | show all origins and the number of flights from each origin. |
flight_1 | select origin , count(*) from flight group by origin | Question: for each origin, how many flights came from there? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid, cer... | for each origin, how many flights came from there? |
flight_1 | select destination , count(*) from flight group by destination | Question: show all destinations and the number of flights to each destination. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid =... | show all destinations and the number of flights to each destination. |
flight_1 | select destination , count(*) from flight group by destination | Question: what are the destinations and number of flights to each one? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraf... | what are the destinations and number of flights to each one? |
flight_1 | select origin from flight group by origin order by count(*) desc limit 1 | Question: which origin has most number of flights? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid, certificate.e... | which origin has most number of flights? |
flight_1 | select origin from flight group by origin order by count(*) desc limit 1 | Question: what place has the most flights coming from there? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid, cer... | what place has the most flights coming from there? |
flight_1 | select destination from flight group by destination order by count(*) limit 1 | Question: which destination has least number of flights? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid, certifi... | which destination has least number of flights? |
flight_1 | select destination from flight group by destination order by count(*) limit 1 | Question: what destination has the fewest number of flights? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid, cer... | what destination has the fewest number of flights? |
flight_1 | select t2.name from flight as t1 join aircraft as t2 on t1.aid = t2.aid where t1.flno = 99 | Question: what is the aircraft name for the flight with number 99 | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid... | what is the aircraft name for the flight with number 99 |
flight_1 | select t2.name from flight as t1 join aircraft as t2 on t1.aid = t2.aid where t1.flno = 99 | Question: what is the name of the aircraft that was on flight number 99? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircr... | what is the name of the aircraft that was on flight number 99? |
flight_1 | select t1.flno from flight as t1 join aircraft as t2 on t1.aid = t2.aid where t2.name = 'airbus a340-300' | Question: show all flight numbers with aircraft airbus a340-300. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid,... | show all flight numbers with aircraft airbus a340-300. |
flight_1 | select t1.flno from flight as t1 join aircraft as t2 on t1.aid = t2.aid where t2.name = 'airbus a340-300' | Question: what are the flight numbers for the aircraft airbus a340-300? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircra... | what are the flight numbers for the aircraft airbus a340-300? |
flight_1 | select t2.name , count(*) from flight as t1 join aircraft as t2 on t1.aid = t2.aid group by t1.aid | Question: show aircraft names and number of flights for each aircraft. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraf... | show aircraft names and number of flights for each aircraft. |
flight_1 | select t2.name , count(*) from flight as t1 join aircraft as t2 on t1.aid = t2.aid group by t1.aid | Question: what is the name of each aircraft and how many flights does each one complete? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certifi... | what is the name of each aircraft and how many flights does each one complete? |
flight_1 | select t2.name from flight as t1 join aircraft as t2 on t1.aid = t2.aid group by t1.aid having count(*) >= 2 | Question: show names for all aircraft with at least two flights. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid,... | show names for all aircraft with at least two flights. |
flight_1 | select t2.name from flight as t1 join aircraft as t2 on t1.aid = t2.aid group by t1.aid having count(*) >= 2 | Question: what are the names for all aircrafts with at least 2 flights? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircra... | what are the names for all aircrafts with at least 2 flights? |
flight_1 | select count(distinct eid) from certificate | Question: how many employees have certificate. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.aid, certificate.eid =... | how many employees have certificate. |
flight_1 | select count(distinct eid) from certificate | Question: what is the count of distinct employees with certificates? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.... | what is the count of distinct employees with certificates? |
flight_1 | select eid from employee except select eid from certificate | Question: show ids for all employees who don't have a certificate. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = aircraft.ai... | show ids for all employees who don't have a certificate. |
flight_1 | select eid from employee except select eid from certificate | Question: what are the ids of all employees that don't have certificates? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = airc... | what are the ids of all employees that don't have certificates? |
flight_1 | 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' | Question: show names for all aircrafts of which john williams has certificates. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid ... | show names for all aircrafts of which john williams has certificates. |
flight_1 | 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' | Question: what are the names of all aircrafts that john williams have certificates to be able to fly? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft... | what are the names of all aircrafts that john williams have certificates to be able to fly? |
flight_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.name = 'boeing 737-800' | Question: show names for all employees who have certificate of boeing 737-800. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid =... | show names for all employees who have certificate of boeing 737-800. |
flight_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.name = 'boeing 737-800' | Question: what are the names of all employees who have a certificate to fly boeing 737-800? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, cert... | what are the names of all employees who have a certificate to fly boeing 737-800? |
flight_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.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' | Question: show names for all employees who have certificates on both boeing 737-800 and airbus a340-300. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircr... | show names for all employees who have certificates on both boeing 737-800 and airbus a340-300. |
flight_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.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' | Question: what are the names of all employees who can fly both the boeing 737-800 and the airbus a340-300? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = air... | what are the names of all employees who can fly both the boeing 737-800 and the airbus a340-300? |
flight_1 | 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' | Question: show names for all employees who do not have certificate of boeing 737-800. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificat... | show names for all employees who do not have certificate of boeing 737-800. |
flight_1 | 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' | Question: what are the names of all employees who are not certified to fly boeing 737-800s? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, cert... | what are the names of all employees who are not certified to fly boeing 737-800s? |
flight_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 | Question: show the name of aircraft which fewest people have its certificate. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certificate.aid = ... | show the name of aircraft which fewest people have its certificate. |
flight_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 | Question: what are the names of the aircraft that the least people are certified to fly? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid, certifi... | what are the names of the aircraft that the least people are certified to fly? |
flight_1 | 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 | Question: show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate. | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid.... | show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate. |
flight_1 | 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 | 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? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid... | 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? |
flight_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 | Question: what is the salary and name of the employee who has the most number of aircraft certificates? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircra... | what is the salary and name of the employee who has the most number of aircraft certificates? |
flight_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 | Question: what is the salaray and name of the employee that is certified to fly the most planes? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid = aircraft.aid,... | what is the salaray and name of the employee that is certified to fly the most planes? |
flight_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 | Question: what is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, ... | what is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000? |
flight_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 | Question: what is the salaray and name of the employee with the most certificates to fly planes more than 5000? | Tables: flight -> flno, origin, destination, distance, departure_date, arrival_date, price, aid. aircraft -> aid, name, distance. employee -> eid, name, salary. certificate -> eid, aid. | Joins: flight.aid ... | what is the salaray and name of the employee with the most certificates to fly planes more than 5000? |
allergy_1 | select count(distinct allergy) from allergy_type | Question: how many allergies are there? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many allergies are there? |
allergy_1 | select count(distinct allergy) from allergy_type | Question: how many allergy entries are there? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many allergy entries are there? |
allergy_1 | select count(distinct allergytype) from allergy_type | Question: how many different allergy types exist? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many different allergy types exist? |
allergy_1 | select count(distinct allergytype) from allergy_type | Question: how many distinct allergies are there? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many distinct allergies are there? |
allergy_1 | select distinct allergytype from allergy_type | Question: show all allergy types. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all allergy types. |
allergy_1 | select distinct allergytype from allergy_type | Question: what are the different allergy types? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the different allergy types? |
allergy_1 | select allergy , allergytype from allergy_type | Question: show all allergies and their types. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all allergies and their types. |
allergy_1 | select allergy , allergytype from allergy_type | Question: what are the allergies and their types? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the allergies and their types? |
allergy_1 | select distinct allergy from allergy_type where allergytype = 'food' | Question: show all allergies with type food. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all allergies with type food. |
allergy_1 | select distinct allergy from allergy_type where allergytype = 'food' | Question: what are all the different food allergies? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are all the different food allergies? |
allergy_1 | select allergytype from allergy_type where allergy = 'cat' | Question: what is the type of allergy cat? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what is the type of allergy cat? |
allergy_1 | select allergytype from allergy_type where allergy = 'cat' | Question: what is allergy type of a cat allergy? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what is allergy type of a cat allergy? |
allergy_1 | select count(*) from allergy_type where allergytype = 'animal' | Question: how many allergies have type animal? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many allergies have type animal? |
allergy_1 | select count(*) from allergy_type where allergytype = 'animal' | Question: how many animal type allergies exist? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many animal type allergies exist? |
allergy_1 | select allergytype , count(*) from allergy_type group by allergytype | Question: show all allergy types and the number of allergies in each type. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all allergy types and the number of allergies in each type. |
allergy_1 | select allergytype , count(*) from allergy_type group by allergytype | Question: what are the allergy types and how many allergies correspond to each one? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the allergy types and how many allergies correspond to each one? |
allergy_1 | select allergytype from allergy_type group by allergytype order by count(*) desc limit 1 | Question: which allergy type has most number of allergies? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | which allergy type has most number of allergies? |
allergy_1 | select allergytype from allergy_type group by allergytype order by count(*) desc limit 1 | Question: which allergy type is most common? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | which allergy type is most common? |
allergy_1 | select allergytype from allergy_type group by allergytype order by count(*) asc limit 1 | Question: which allergy type has least number of allergies? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | which allergy type has least number of allergies? |
allergy_1 | select allergytype from allergy_type group by allergytype order by count(*) asc limit 1 | Question: which allergy type is the least common? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | which allergy type is the least common? |
allergy_1 | select count(*) from student | Question: how many students are there? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many students are there? |
allergy_1 | select count(*) from student | Question: what is the total number of students? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what is the total number of students? |
allergy_1 | select fname , lname from student | Question: show first name and last name for all students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show first name and last name for all students. |
allergy_1 | select fname , lname from student | Question: what are the full names of all students | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the full names of all students |
allergy_1 | select count(distinct advisor) from student | Question: how many different advisors are listed? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many different advisors are listed? |
allergy_1 | select count(distinct advisor) from student | Question: how many advisors are there? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many advisors are there? |
allergy_1 | select distinct major from student | Question: show all majors. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all majors. |
allergy_1 | select distinct major from student | Question: what are the different majors? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the different majors? |
allergy_1 | select distinct city_code from student | Question: show all cities where students live. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all cities where students live. |
allergy_1 | select distinct city_code from student | Question: what cities do students live in? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what cities do students live in? |
allergy_1 | select fname , lname , age from student where sex = 'f' | Question: show first name, last name, age for all female students. their sex is f. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show first name, last name, age for all female students. their sex is f. |
allergy_1 | select fname , lname , age from student where sex = 'f' | Question: what are the full names and ages for all female students whose sex is f? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the full names and ages for all female students whose sex is f? |
allergy_1 | select stuid from student where sex = 'm' | Question: show student ids for all male students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show student ids for all male students. |
allergy_1 | select stuid from student where sex = 'm' | Question: what are the student ids for all male students? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the student ids for all male students? |
allergy_1 | select count(*) from student where age = 18 | Question: how many students are age 18? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many students are age 18? |
allergy_1 | select count(*) from student where age = 18 | Question: how many students are 18 years old? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many students are 18 years old? |
allergy_1 | select stuid from student where age > 20 | Question: show all student ids who are older than 20. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all student ids who are older than 20. |
allergy_1 | select stuid from student where age > 20 | Question: what are the student ids for students over 20 years old? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the student ids for students over 20 years old? |
allergy_1 | select city_code from student where lname = 'kim' | Question: which city does the student whose last name is 'kim' live in? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | which city does the student whose last name is 'kim' live in? |
allergy_1 | select city_code from student where lname = 'kim' | Question: give the city that the student whose family name is kim lives in. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | give the city that the student whose family name is kim lives in. |
allergy_1 | select advisor from student where stuid = 1004 | Question: who is the advisor of student with id 1004? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | who is the advisor of student with id 1004? |
allergy_1 | select advisor from student where stuid = 1004 | Question: who advises student 1004? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | who advises student 1004? |
allergy_1 | select count(*) from student where city_code = 'hkg' or city_code = 'chi' | Question: how many students live in hkg or chi? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many students live in hkg or chi? |
allergy_1 | select count(*) from student where city_code = 'hkg' or city_code = 'chi' | Question: give the number of students living in either hkg or chi. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | give the number of students living in either hkg or chi. |
allergy_1 | select min(age) , avg(age) , max(age) from student | Question: show the minimum, average, and maximum age of all students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show the minimum, average, and maximum age of all students. |
allergy_1 | select min(age) , avg(age) , max(age) from student | Question: what is the minimum, mean, and maximum age across all students? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what is the minimum, mean, and maximum age across all students? |
allergy_1 | select lname from student where age = (select min(age) from student) | Question: what is the last name of the youngest student? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what is the last name of the youngest student? |
allergy_1 | select lname from student where age = (select min(age) from student) | Question: provide the last name of the youngest student. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | provide the last name of the youngest student. |
allergy_1 | select stuid from student where age = (select max(age) from student) | Question: show the student id of the oldest student. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show the student id of the oldest student. |
allergy_1 | select stuid from student where age = (select max(age) from student) | Question: what student id corresponds to the oldest student? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what student id corresponds to the oldest student? |
allergy_1 | select major , count(*) from student group by major | Question: show all majors and corresponding number of students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all majors and corresponding number of students. |
allergy_1 | select major , count(*) from student group by major | Question: how many students are there for each major? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many students are there for each major? |
allergy_1 | select major from student group by major order by count(*) desc limit 1 | Question: which major has most number of students? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | which major has most number of students? |
allergy_1 | select major from student group by major order by count(*) desc limit 1 | Question: what is the largest major? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what is the largest major? |
allergy_1 | select age , count(*) from student group by age | Question: show all ages and corresponding number of students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all ages and corresponding number of students. |
allergy_1 | select age , count(*) from student group by age | Question: how old is each student and how many students are each age? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how old is each student and how many students are each age? |
allergy_1 | select avg(age) , sex from student group by sex | Question: show the average age for male and female students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show the average age for male and female students. |
allergy_1 | select avg(age) , sex from student group by sex | Question: what are the average ages for male and female students? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | what are the average ages for male and female students? |
allergy_1 | select city_code , count(*) from student group by city_code | Question: show all cities and corresponding number of students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all cities and corresponding number of students. |
allergy_1 | select city_code , count(*) from student group by city_code | Question: how many students live in each city? | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | how many students live in each city? |
allergy_1 | select advisor , count(*) from student group by advisor | Question: show all advisors and corresponding number of students. | Tables: Allergy_Type -> Allergy, AllergyType. Has_Allergy -> StuID, Allergy. Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. | Joins: Has_Allergy.Allergy = Allergy_Type.Allergy, Has_Allergy.StuID = Student.StuID, | show all advisors and corresponding number of students. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.