db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
shop_membership | select count(*) from branch where membership_amount > (select avg(membership_amount) from branch) | Question: how many branches where have more than average number of memberships are there? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_... | how many branches where have more than average number of memberships are there? |
shop_membership | select count(*) from branch where membership_amount > (select avg(membership_amount) from branch) | Question: what is the number of branches that have more than the average number of memberships? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> M... | what is the number of branches that have more than the average number of memberships? |
shop_membership | select name , address_road , city from branch order by open_year | Question: show name, address road, and city for all branches sorted by open year. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Bran... | show name, address road, and city for all branches sorted by open year. |
shop_membership | select name , address_road , city from branch order by open_year | Question: what are the names, address roads, and cities of the branches ordered by opening year? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> ... | what are the names, address roads, and cities of the branches ordered by opening year? |
shop_membership | select name from branch order by membership_amount desc limit 3 | Question: what are names for top three branches with most number of membership? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch... | what are names for top three branches with most number of membership? |
shop_membership | select name from branch order by membership_amount desc limit 3 | Question: what are the names for the 3 branches that have the most memberships? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch... | what are the names for the 3 branches that have the most memberships? |
shop_membership | select distinct city from branch where membership_amount >= 100 | Question: show all distinct city where branches with at least 100 memberships are located. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member... | show all distinct city where branches with at least 100 memberships are located. |
shop_membership | select distinct city from branch where membership_amount >= 100 | Question: what are the different cities that have more than 100 memberships? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID... | what are the different cities that have more than 100 memberships? |
shop_membership | select open_year from branch group by open_year having count(*) >= 2 | Question: list all open years when at least two shops are opened. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Tot... | list all open years when at least two shops are opened. |
shop_membership | select open_year from branch group by open_year having count(*) >= 2 | Question: what are the opening years in which at least two shops opened? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Ye... | what are the opening years in which at least two shops opened? |
shop_membership | select min(membership_amount) , max(membership_amount) from branch where open_year = 2011 or city = 'london' | Question: show minimum and maximum amount of memberships for all branches opened in 2011 or located at city london. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register... | show minimum and maximum amount of memberships for all branches opened in 2011 or located at city london. |
shop_membership | select min(membership_amount) , max(membership_amount) from branch where open_year = 2011 or city = 'london' | Question: what are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in london? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Bra... | what are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in london? |
shop_membership | select city , count(*) from branch where open_year < 2010 group by city | Question: show the city and the number of branches opened before 2010 for each city. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, B... | show the city and the number of branches opened before 2010 for each city. |
shop_membership | select city , count(*) from branch where open_year < 2010 group by city | Question: for each city, how many branches opened before 2010? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Total_... | for each city, how many branches opened before 2010? |
shop_membership | select count(distinct level) from member | Question: how many different levels do members have? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Total_pounds. | ... | how many different levels do members have? |
shop_membership | select count(distinct level) from member | Question: what are the different membership levels? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Total_pounds. | J... | what are the different membership levels? |
shop_membership | select card_number , name , hometown from member order by level desc | Question: show card number, name, and hometown for all members in a descending order of level. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Me... | show card number, name, and hometown for all members in a descending order of level. |
shop_membership | select card_number , name , hometown from member order by level desc | Question: what are the card numbers, names, and hometowns of every member ordered by descending level? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purcha... | what are the card numbers, names, and hometowns of every member ordered by descending level? |
shop_membership | select level from member group by level order by count(*) desc limit 1 | Question: show the membership level with most number of members. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Tota... | show the membership level with most number of members. |
shop_membership | select level from member group by level order by count(*) desc limit 1 | Question: what is the membership level with the most people? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Total_po... | what is the membership level with the most people? |
shop_membership | select t3.name , t2.name from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id join member as t3 on t1.member_id = t3.member_id order by t1.register_year | Question: show all member names and registered branch names sorted by register year. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, B... | show all member names and registered branch names sorted by register year. |
shop_membership | select t3.name , t2.name from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id join member as t3 on t1.member_id = t3.member_id order by t1.register_year | Question: what are the names of the members and branches at which they are registered sorted by year of registration? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Regist... | what are the names of the members and branches at which they are registered sorted by year of registration? |
shop_membership | select t2.name , count(*) from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id where t1.register_year > 2015 group by t2.branch_id | Question: show all branch names with the number of members in each branch registered after 2015. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> ... | show all branch names with the number of members in each branch registered after 2015. |
shop_membership | select t2.name , count(*) from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id where t1.register_year > 2015 group by t2.branch_id | Question: for each branch id, what are the names of the branches that were registered after 2015? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase ->... | for each branch id, what are the names of the branches that were registered after 2015? |
shop_membership | select name from member where member_id not in (select member_id from membership_register_branch) | Question: show member names without any registered branch. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Total_poun... | show member names without any registered branch. |
shop_membership | select name from member where member_id not in (select member_id from membership_register_branch) | Question: what are the names of the members that have never registered at any branch? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, ... | what are the names of the members that have never registered at any branch? |
shop_membership | select name , city from branch where branch_id not in (select branch_id from membership_register_branch) | Question: list the branch name and city without any registered members. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Yea... | list the branch name and city without any registered members. |
shop_membership | select name , city from branch where branch_id not in (select branch_id from membership_register_branch) | Question: what are the names and cities of the branches that do not have any registered members? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> ... | what are the names and cities of the branches that do not have any registered members? |
shop_membership | select t2.name , t2.open_year from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id where t1.register_year = 2016 group by t2.branch_id order by count(*) desc limit 1 | Question: what is the name and open year for the branch with most number of memberships registered in 2016? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. p... | what is the name and open year for the branch with most number of memberships registered in 2016? |
shop_membership | select t2.name , t2.open_year from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id where t1.register_year = 2016 group by t2.branch_id order by count(*) desc limit 1 | Question: what is the name and opening year for the branch that registered the most members in 2016? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase... | what is the name and opening year for the branch that registered the most members in 2016? |
shop_membership | select t2.name , t2.hometown from membership_register_branch as t1 join member as t2 on t1.member_id = t2.member_id where t1.register_year = 2016 | Question: show the member name and hometown who registered a branch in 2016. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID... | show the member name and hometown who registered a branch in 2016. |
shop_membership | select t2.name , t2.hometown from membership_register_branch as t1 join member as t2 on t1.member_id = t2.member_id where t1.register_year = 2016 | Question: what are the member names and hometowns of those who registered at a branch in 2016? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Me... | what are the member names and hometowns of those who registered at a branch in 2016? |
shop_membership | select city from branch where open_year = 2001 and membership_amount > 100 | Question: show all city with a branch opened in 2001 and a branch with more than 100 membership. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> ... | show all city with a branch opened in 2001 and a branch with more than 100 membership. |
shop_membership | select city from branch where open_year = 2001 and membership_amount > 100 | Question: what are the cities that have a branch that opened in 2001 and a branch with more than 100 members? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year.... | what are the cities that have a branch that opened in 2001 and a branch with more than 100 members? |
shop_membership | select city from branch except select city from branch where membership_amount > 100 | Question: show all cities without a branch having more than 100 memberships. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID... | show all cities without a branch having more than 100 memberships. |
shop_membership | select city from branch except select city from branch where membership_amount > 100 | Question: what are the cities that do not have any branches with more than 100 members? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID... | what are the cities that do not have any branches with more than 100 members? |
shop_membership | select sum(total_pounds) from purchase as t1 join branch as t2 on t1.branch_id = t2.branch_id where t2.city = 'london' and t1.year = 2018 | Question: what is the sum of total pounds of purchase in year 2018 for all branches in london? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Me... | what is the sum of total pounds of purchase in year 2018 for all branches in london? |
shop_membership | select sum(total_pounds) from purchase as t1 join branch as t2 on t1.branch_id = t2.branch_id where t2.city = 'london' and t1.year = 2018 | Question: how many total pounds were purchased in the year 2018 at all london branches? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID... | how many total pounds were purchased in the year 2018 at all london branches? |
shop_membership | select count(*) from purchase as t1 join member as t2 on t1.member_id = t2.member_id where t2.level = 6 | Question: what is the total number of purchases for members with level 6? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Y... | what is the total number of purchases for members with level 6? |
shop_membership | select count(*) from purchase as t1 join member as t2 on t1.member_id = t2.member_id where t2.level = 6 | Question: what are the total purchases for members rated at level 6? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, ... | what are the total purchases for members rated at level 6? |
shop_membership | select t2.name from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id join member as t3 on t1.member_id = t3.member_id where t3.hometown = 'louisville , kentucky' intersect select t2.name from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id join... | Question: find the name of branches where have some members whose hometown is in louisville, kentucky and some in hiram, georgia. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branc... | find the name of branches where have some members whose hometown is in louisville, kentucky and some in hiram, georgia. |
shop_membership | select t2.name from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id join member as t3 on t1.member_id = t3.member_id where t3.hometown = 'louisville , kentucky' intersect select t2.name from membership_register_branch as t1 join branch as t2 on t1.branch_id = t2.branch_id join... | Question: what are the names of the branches that have some members with a hometown in louisville, kentucky and also those from hiram, goergia? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Me... | what are the names of the branches that have some members with a hometown in louisville, kentucky and also those from hiram, goergia? |
shop_membership | select card_number from member where hometown like '%kentucky%' | Question: list the card number of all members whose hometown address includes word 'kentucky'. | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Me... | list the card number of all members whose hometown address includes word 'kentucky'. |
shop_membership | select card_number from member where hometown like '%kentucky%' | Question: what are the card numbers of members from kentucky? | Tables: member -> Member_ID, Card_Number, Name, Hometown, Level. branch -> Branch_ID, Name, Open_year, Address_road, City, membership_amount. membership_register_branch -> Member_ID, Branch_ID, Register_Year. purchase -> Member_ID, Branch_ID, Year, Total_p... | what are the card numbers of members from kentucky? |
voter_2 | select count(*) from student | Question: find the number of students in total. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_record.... | find the number of students in total. |
voter_2 | select count(*) from student | Question: how many students are there in total? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_record.... | how many students are there in total? |
voter_2 | select count(*) from voting_record | Question: find the number of voting records in total. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_r... | find the number of voting records in total. |
voter_2 | select count(*) from voting_record | Question: how many voting records do we have? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_record.Cl... | how many voting records do we have? |
voter_2 | select count(distinct president_vote) from voting_record | Question: find the distinct number of president votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_... | find the distinct number of president votes. |
voter_2 | select count(distinct president_vote) from voting_record | Question: how many distinct president votes are recorded? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voti... | how many distinct president votes are recorded? |
voter_2 | select max(age) from student | Question: find the maximum age of all the students. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_rec... | find the maximum age of all the students. |
voter_2 | select max(age) from student | Question: what is the oldest age among the students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_re... | what is the oldest age among the students? |
voter_2 | select lname from student where major = 50 | Question: find the last names of students with major 50. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Votin... | find the last names of students with major 50. |
voter_2 | select lname from student where major = 50 | Question: what are the last names of students studying major 50? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Join... | what are the last names of students studying major 50? |
voter_2 | select fname from student where age > 22 | Question: find the first names of students with age above 22. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: ... | find the first names of students with age above 22. |
voter_2 | select fname from student where age > 22 | Question: what are the first names of all the students aged above 22? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. |... | what are the first names of all the students aged above 22? |
voter_2 | select major from student where sex = 'm' | Question: what are the majors of male (sex is m) students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Vot... | what are the majors of male (sex is m) students? |
voter_2 | select major from student where sex = 'm' | Question: list the major of each male student. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_record.C... | list the major of each male student. |
voter_2 | select avg(age) from student where sex = 'f' | Question: what is the average age of female (sex is f) students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Join... | what is the average age of female (sex is f) students? |
voter_2 | select avg(age) from student where sex = 'f' | Question: find the average age of female students. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins: Voting_reco... | find the average age of female students. |
voter_2 | select max(age) , min(age) from student where major = 600 | Question: what are the maximum and minimum age of students with major 600? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vo... | what are the maximum and minimum age of students with major 600? |
voter_2 | select max(age) , min(age) from student where major = 600 | Question: tell me the ages of the oldest and youngest students studying major 600. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Se... | tell me the ages of the oldest and youngest students studying major 600. |
voter_2 | select advisor from student where city_code = 'bal' | Question: who are the advisors for students that live in a city with city code 'bal'? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class... | who are the advisors for students that live in a city with city code 'bal'? |
voter_2 | select advisor from student where city_code = 'bal' | Question: show the advisors of the students whose city of residence has city code 'bal'. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Cl... | show the advisors of the students whose city of residence has city code 'bal'. |
voter_2 | select distinct secretary_vote from voting_record where election_cycle = 'fall' | Question: what are the distinct secretary votes in the fall election cycle? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_V... | what are the distinct secretary votes in the fall election cycle? |
voter_2 | select distinct secretary_vote from voting_record where election_cycle = 'fall' | Question: return all the distinct secretary votes made in the fall election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Se... | return all the distinct secretary votes made in the fall election cycle. |
voter_2 | select distinct president_vote from voting_record where registration_date = '08/30/2015' | Question: what are the distinct president votes on 08/30/2015? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | Joins:... | what are the distinct president votes on 08/30/2015? |
voter_2 | select distinct president_vote from voting_record where registration_date = '08/30/2015' | Question: show all the distinct president votes made on 08/30/2015. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote. | J... | show all the distinct president votes made on 08/30/2015. |
voter_2 | select distinct registration_date , election_cycle from voting_record | Question: report the distinct registration date and the election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote.... | report the distinct registration date and the election cycle. |
voter_2 | select distinct registration_date , election_cycle from voting_record | Question: what are the distinct registration dates and the election cycles? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_V... | what are the distinct registration dates and the election cycles? |
voter_2 | select distinct president_vote , vice_president_vote from voting_record | Question: report the distinct president vote and the vice president vote. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vot... | report the distinct president vote and the vice president vote. |
voter_2 | select distinct president_vote , vice_president_vote from voting_record | Question: list all the distinct president votes and the vice president votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator... | list all the distinct president votes and the vice president votes. |
voter_2 | select distinct t1.lname from student as t1 join voting_record as t2 on t1.stuid = t2.class_president_vote | Question: find the distinct last names of the students who have class president votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Clas... | find the distinct last names of the students who have class president votes. |
voter_2 | select distinct t1.lname from student as t1 join voting_record as t2 on t1.stuid = t2.class_president_vote | Question: what are the distinct last names of the students who have class president votes? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, ... | what are the distinct last names of the students who have class president votes? |
voter_2 | select distinct t1.fname from student as t1 join voting_record as t2 on t1.stuid = t2.class_senator_vote | Question: find the distinct first names of the students who have class senator votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class... | find the distinct first names of the students who have class senator votes. |
voter_2 | select distinct t1.fname from student as t1 join voting_record as t2 on t1.stuid = t2.class_senator_vote | Question: what are the distinct first names of the students who have class president votes? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote,... | what are the distinct first names of the students who have class president votes? |
voter_2 | select distinct t1.age from student as t1 join voting_record as t2 on t1.stuid = t2.secretary_vote where t2.election_cycle = 'fall' | Question: find the distinct ages of students who have secretary votes in the fall election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President... | find the distinct ages of students who have secretary votes in the fall election cycle. |
voter_2 | select distinct t1.age from student as t1 join voting_record as t2 on t1.stuid = t2.secretary_vote where t2.election_cycle = 'fall' | Question: what are the distinct ages of students who have secretary votes in the fall election cycle? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_Presi... | what are the distinct ages of students who have secretary votes in the fall election cycle? |
voter_2 | select distinct t1.advisor from student as t1 join voting_record as t2 on t1.stuid = t2.treasurer_vote where t2.election_cycle = 'spring' | Question: find the distinct advisor of students who have treasurer votes in the spring election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_Pres... | find the distinct advisor of students who have treasurer votes in the spring election cycle. |
voter_2 | select distinct t1.advisor from student as t1 join voting_record as t2 on t1.stuid = t2.treasurer_vote where t2.election_cycle = 'spring' | Question: who served as an advisor for students who have treasurer votes in the spring election cycle? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_Pres... | who served as an advisor for students who have treasurer votes in the spring election cycle? |
voter_2 | select distinct t1.major from student as t1 join voting_record as t2 on t1.stuid = t2.treasurer_vote | Question: find the distinct majors of students who have treasurer votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote... | find the distinct majors of students who have treasurer votes. |
voter_2 | select distinct t1.major from student as t1 join voting_record as t2 on t1.stuid = t2.treasurer_vote | Question: what are the distinct majors that students with treasurer votes are studying? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Cla... | what are the distinct majors that students with treasurer votes are studying? |
voter_2 | select distinct t1.fname , t1.lname from student as t1 join voting_record as t2 on t1.stuid = t2.president_vote where t1.sex = 'f' | Question: find the first and last names of all the female (sex is f) students who have president votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_Pre... | find the first and last names of all the female (sex is f) students who have president votes. |
voter_2 | select distinct t1.fname , t1.lname from student as t1 join voting_record as t2 on t1.stuid = t2.president_vote where t1.sex = 'f' | Question: what are the first and last names of all the female students who have president votes? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_... | what are the first and last names of all the female students who have president votes? |
voter_2 | select distinct t1.fname , t1.lname from student as t1 join voting_record as t2 on t1.stuid = t2.vice_president_vote where t1.age = 18 | Question: find the first and last name of all the students of age 18 who have vice president votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_Preside... | find the first and last name of all the students of age 18 who have vice president votes. |
voter_2 | select distinct t1.fname , t1.lname from student as t1 join voting_record as t2 on t1.stuid = t2.vice_president_vote where t1.age = 18 | Question: what are the first names and last names of the students who are 18 years old and have vice president votes. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_V... | what are the first names and last names of the students who are 18 years old and have vice president votes. |
voter_2 | select count(*) from student as t1 join voting_record as t2 on t1.stuid = class_senator_vote where t1.sex = 'm' and t2.election_cycle = 'fall' | Question: how many male (sex is m) students have class senator votes in the fall election cycle? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_... | how many male (sex is m) students have class senator votes in the fall election cycle? |
voter_2 | select count(*) from student as t1 join voting_record as t2 on t1.stuid = class_senator_vote where t1.sex = 'm' and t2.election_cycle = 'fall' | Question: count the number of male students who had class senator votes in the fall election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_Preside... | count the number of male students who had class senator votes in the fall election cycle. |
voter_2 | select count(*) from student as t1 join voting_record as t2 on t1.stuid = class_senator_vote where t1.city_code = 'nyc' and t2.election_cycle = 'spring' | Question: find the number of students whose city code is nyc and who have class senator votes in the spring election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treas... | find the number of students whose city code is nyc and who have class senator votes in the spring election cycle. |
voter_2 | select count(*) from student as t1 join voting_record as t2 on t1.stuid = class_senator_vote where t1.city_code = 'nyc' and t2.election_cycle = 'spring' | Question: which students live in the city with code 'nyc' and have class senator votes in the spring election cycle? count the numbers. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary... | which students live in the city with code 'nyc' and have class senator votes in the spring election cycle? count the numbers. |
voter_2 | select avg(t1.age) from student as t1 join voting_record as t2 on t1.stuid = secretary_vote where t1.city_code = 'nyc' and t2.election_cycle = 'spring' | Question: find the average age of students who live in the city with code 'nyc' and have secretary votes in the spring election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_... | find the average age of students who live in the city with code 'nyc' and have secretary votes in the spring election cycle. |
voter_2 | select avg(t1.age) from student as t1 join voting_record as t2 on t1.stuid = secretary_vote where t1.city_code = 'nyc' and t2.election_cycle = 'spring' | Question: what is the average age of students who have city code 'nyc' and have secretary votes for the spring election cycle? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Tr... | what is the average age of students who have city code 'nyc' and have secretary votes for the spring election cycle? |
voter_2 | select avg(t1.age) from student as t1 join voting_record as t2 on t1.stuid = secretary_vote where t1.sex = 'f' and t2.election_cycle = 'spring' | Question: find the average age of female (sex is f) students who have secretary votes in the spring election cycle. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vot... | find the average age of female (sex is f) students who have secretary votes in the spring election cycle. |
voter_2 | select avg(t1.age) from student as t1 join voting_record as t2 on t1.stuid = secretary_vote where t1.sex = 'f' and t2.election_cycle = 'spring' | Question: what is the average age of the female students with secretary votes in the spring election cycle? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class... | what is the average age of the female students with secretary votes in the spring election cycle? |
voter_2 | select distinct t1.fname from student as t1 join voting_record as t2 on t1.stuid = t2.vice_president_vote except select distinct fname from student where city_code = 'pit' | Question: find the distinct first names of all the students who have vice president votes and whose city code is not pit. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasur... | find the distinct first names of all the students who have vice president votes and whose city code is not pit. |
voter_2 | select distinct t1.fname from student as t1 join voting_record as t2 on t1.stuid = t2.vice_president_vote except select distinct fname from student where city_code = 'pit' | Question: what are the distinct first names of the students who have vice president votes and reside in a city whose city code is not pit? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secret... | what are the distinct first names of the students who have vice president votes and reside in a city whose city code is not pit? |
voter_2 | select distinct t1.lname from student as t1 join voting_record as t2 on t1.stuid = president_vote except select distinct lname from student where advisor = '2192' | Question: find the distinct last names of all the students who have president votes and whose advisor is not 2192. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote... | find the distinct last names of all the students who have president votes and whose advisor is not 2192. |
voter_2 | select distinct t1.lname from student as t1 join voting_record as t2 on t1.stuid = president_vote except select distinct lname from student where advisor = '2192' | Question: what are the distinct last names of the students who have president votes but do not have 2192 as the advisor? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasure... | what are the distinct last names of the students who have president votes but do not have 2192 as the advisor? |
voter_2 | select distinct t1.lname from student as t1 join voting_record as t2 on t1.stuid = president_vote intersect select distinct lname from student where advisor = '8741' | Question: find the distinct last names of all the students who have president votes and whose advisor is 8741. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Cl... | find the distinct last names of all the students who have president votes and whose advisor is 8741. |
voter_2 | select distinct t1.lname from student as t1 join voting_record as t2 on t1.stuid = president_vote intersect select distinct lname from student where advisor = '8741' | Question: what are the distinct last names of the students who have president votes and have 8741 as the advisor? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Voting_record -> StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote,... | what are the distinct last names of the students who have president votes and have 8741 as the advisor? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.