id
int64
0
8.66k
db_id
stringclasses
146 values
schema
stringclasses
146 values
question
stringlengths
3
224
output
stringlengths
18
577
5,400
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
How many branches where have more than average number of memberships are there?
SELECT count(*) FROM branch WHERE membership_amount > (SELECT avg(membership_amount) FROM branch)
5,401
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What is the number of branches that have more than the average number of memberships?
SELECT count(*) FROM branch WHERE membership_amount > (SELECT avg(membership_amount) FROM branch)
5,402
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show name, address road, and city for all branches sorted by open year.
SELECT name , address_road , city FROM branch ORDER BY open_year
5,403
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the names, address roads, and cities of the branches ordered by opening year?
SELECT name , address_road , city FROM branch ORDER BY open_year
5,404
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are names for top three branches with most number of membership?
SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
5,405
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the names for the 3 branches that have the most memberships?
SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
5,406
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show all distinct city where branches with at least 100 memberships are located.
SELECT DISTINCT city FROM branch WHERE membership_amount >= 100
5,407
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the different cities that have more than 100 memberships?
SELECT DISTINCT city FROM branch WHERE membership_amount >= 100
5,408
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
List all open years when at least two shops are opened.
SELECT open_year FROM branch GROUP BY open_year HAVING count(*) >= 2
5,409
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the opening years in which at least two shops opened?
SELECT open_year FROM branch GROUP BY open_year HAVING count(*) >= 2
5,410
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.
SELECT min(membership_amount) , max(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'
5,411
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in London?
SELECT min(membership_amount) , max(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'
5,412
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show the city and the number of branches opened before 2010 for each city.
SELECT city , count(*) FROM branch WHERE open_year < 2010 GROUP BY city
5,413
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
For each city, how many branches opened before 2010?
SELECT city , count(*) FROM branch WHERE open_year < 2010 GROUP BY city
5,414
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
How many different levels do members have?
SELECT count(DISTINCT LEVEL) FROM member
5,415
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the different membership levels?
SELECT count(DISTINCT LEVEL) FROM member
5,416
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show card number, name, and hometown for all members in a descending order of level.
SELECT card_number , name , hometown FROM member ORDER BY LEVEL DESC
5,417
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the card numbers, names, and hometowns of every member ordered by descending level?
SELECT card_number , name , hometown FROM member ORDER BY LEVEL DESC
5,418
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show the membership level with most number of members.
SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY count(*) DESC LIMIT 1
5,419
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What is the membership level with the most people?
SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY count(*) DESC LIMIT 1
5,420
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show all member names and registered branch names sorted by register year.
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
5,421
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the names of the members and branches at which they are registered sorted by year of registration?
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
5,422
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show all branch names with the number of members in each branch registered after 2015.
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
5,423
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
For each branch id, what are the names of the branches that were registered after 2015?
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
5,424
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show member names without any registered branch.
SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)
5,425
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the names of the members that have never registered at any branch?
SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)
5,426
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
List the branch name and city without any registered members.
SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)
5,427
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the names and cities of the branches that do not have any registered members?
SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)
5,428
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What is the name and open year for the branch with most number of memberships registered in 2016?
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
5,429
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What is the name and opening year for the branch that registered the most members in 2016?
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
5,430
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show the member name and hometown who registered a branch in 2016.
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
5,431
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the member names and hometowns of those who registered at a branch in 2016?
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
5,432
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show all city with a branch opened in 2001 and a branch with more than 100 membership.
SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100
5,433
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the cities that have a branch that opened in 2001 and a branch with more than 100 members?
SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100
5,434
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Show all cities without a branch having more than 100 memberships.
SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100
5,435
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the cities that do not have any branches with more than 100 members?
SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100
5,436
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What is the sum of total pounds of purchase in year 2018 for all branches in London?
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
5,437
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
How many total pounds were purchased in the year 2018 at all London branches?
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
5,438
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What is the total number of purchases for members with level 6?
SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
5,439
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the total purchases for members rated at level 6?
SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
5,440
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
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...
5,441
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the names of the branches that have some members with a hometown in Louisville, Kentucky and also those from Hiram, Goergia?
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...
5,442
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
list the card number of all members whose hometown address includes word "Kentucky".
SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%"
5,443
shop_membership
CREATE TABLE "member" ( "Member_ID" int, "Card_Number" text, "Name" text, "Hometown" text, "Level" int, PRIMARY KEY ( "Member_ID" ) ); CREATE TABLE "branch" ( "Branch_ID" int, "Name" text, "Open_year" text, "Address_road" text, "City" text, "membership_amount" text, PRIMARY KEY ( "Branch_ID" ) ); ...
What are the card numbers of members from Kentucky?
SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%"
5,444
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the number of students in total.
SELECT count(*) FROM STUDENT
5,445
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
How many students are there in total?
SELECT count(*) FROM STUDENT
5,446
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the number of voting records in total.
SELECT count(*) FROM VOTING_RECORD
5,447
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
How many voting records do we have?
SELECT count(*) FROM VOTING_RECORD
5,448
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct number of president votes.
SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD
5,449
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
How many distinct president votes are recorded?
SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD
5,450
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the maximum age of all the students.
SELECT max(Age) FROM STUDENT
5,451
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What is the oldest age among the students?
SELECT max(Age) FROM STUDENT
5,452
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the last names of students with major 50.
SELECT LName FROM STUDENT WHERE Major = 50
5,453
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the last names of students studying major 50?
SELECT LName FROM STUDENT WHERE Major = 50
5,454
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the first names of students with age above 22.
SELECT Fname FROM STUDENT WHERE Age > 22
5,455
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the first names of all the students aged above 22?
SELECT Fname FROM STUDENT WHERE Age > 22
5,456
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the majors of male (sex is M) students?
SELECT Major FROM STUDENT WHERE Sex = "M"
5,457
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
List the major of each male student.
SELECT Major FROM STUDENT WHERE Sex = "M"
5,458
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What is the average age of female (sex is F) students?
SELECT avg(Age) FROM STUDENT WHERE Sex = "F"
5,459
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the average age of female students.
SELECT avg(Age) FROM STUDENT WHERE Sex = "F"
5,460
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the maximum and minimum age of students with major 600?
SELECT max(Age) , min(Age) FROM STUDENT WHERE Major = 600
5,461
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Tell me the ages of the oldest and youngest students studying major 600.
SELECT max(Age) , min(Age) FROM STUDENT WHERE Major = 600
5,462
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Who are the advisors for students that live in a city with city code "BAL"?
SELECT Advisor FROM STUDENT WHERE city_code = "BAL"
5,463
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Show the advisors of the students whose city of residence has city code "BAL".
SELECT Advisor FROM STUDENT WHERE city_code = "BAL"
5,464
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct secretary votes in the fall election cycle?
SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall"
5,465
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Return all the distinct secretary votes made in the fall election cycle.
SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall"
5,466
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct president votes on 08/30/2015?
SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = "08/30/2015"
5,467
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Show all the distinct president votes made on 08/30/2015.
SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = "08/30/2015"
5,468
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Report the distinct registration date and the election cycle.
SELECT DISTINCT Registration_Date , Election_Cycle FROM VOTING_RECORD
5,469
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct registration dates and the election cycles?
SELECT DISTINCT Registration_Date , Election_Cycle FROM VOTING_RECORD
5,470
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Report the distinct president vote and the vice president vote.
SELECT DISTINCT President_Vote , VICE_President_Vote FROM VOTING_RECORD
5,471
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
List all the distinct president votes and the vice president votes.
SELECT DISTINCT President_Vote , VICE_President_Vote FROM VOTING_RECORD
5,472
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct last names of the students who have class president votes.
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
5,473
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct last names of the students who have class president votes?
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
5,474
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct first names of the students who have class senator votes.
SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE
5,475
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct first names of the students who have class president votes?
SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE
5,476
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct ages of students who have secretary votes in the fall election cycle.
SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = "Fall"
5,477
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct ages of students who have secretary votes in the fall election cycle?
SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = "Fall"
5,478
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct Advisor of students who have treasurer votes in the spring election cycle.
SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = "Spring"
5,479
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Who served as an advisor for students who have treasurer votes in the spring election cycle?
SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = "Spring"
5,480
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct majors of students who have treasurer votes.
SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
5,481
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct majors that students with treasurer votes are studying?
SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
5,482
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the first and last names of all the female (sex is F) students who have president votes.
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"
5,483
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the first and last names of all the female students who have president votes?
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"
5,484
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the first and last name of all the students of age 18 who have vice president votes.
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
5,485
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the first names and last names of the students who are 18 years old and have vice president votes.
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
5,486
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
How many male (sex is M) students have class senator votes in the fall election cycle?
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"
5,487
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Count the number of male students who had class senator votes in the fall election cycle.
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"
5,488
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.
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"
5,489
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Which students live in the city with code "NYC" and have class senator votes in the spring election cycle? Count the numbers.
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"
5,490
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the average age of students who live in the city with code "NYC" and have secretary votes in the spring election cycle.
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"
5,491
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What is the average age of students who have city code "NYC" and have secretary votes for the spring election cycle?
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"
5,492
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.
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"
5,493
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What is the average age of the female students with secretary votes in the spring election cycle?
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"
5,494
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.
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"
5,495
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
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?
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"
5,496
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct last names of all the students who have president votes and whose advisor is not 2192.
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"
5,497
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct last names of the students who have president votes but do not have 2192 as the advisor?
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"
5,498
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
Find the distinct last names of all the students who have president votes and whose advisor is 8741.
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"
5,499
voter_2
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR( 12 ), Fname VARCHAR( 12 ), Age INTEGER, Sex VARCHAR( 1 ), Major INTEGER, Advisor INTEGER, city_code VARCHAR( 3 ) ); CREAT...
What are the distinct last names of the students who have president votes and have 8741 as the advisor?
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"