human
Schema:
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)
Please answer with SQL.
assistant
Sure, I understand.
human
Report the distinct president vote and the vice president vote.
assistant
SELECT DISTINCT President_Vote , VICE_President_Vote FROM VOTING_RECORD
human
How many male (sex is M) students have class senator votes in the fall election cycle?
assistant
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'
human
Find the distinct last names of the students who have class president votes.
assistant
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
human
Find the distinct number of president votes.
assistant
SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD
human
What are the distinct secretary votes in the fall election cycle?
assistant
SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = 'Fall'
human
What are the distinct president votes on 08/30/2015?
assistant
SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = "08/30/2015" ;