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
What are the distinct secretary votes in the fall election cycle?
assistant
SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = 'Fall'
human
Find the distinct Advisor of students who have treasurer votes in the spring election cycle.
assistant
SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = 'Spring'
human
Find the distinct ages of students who have secretary votes in the fall election cycle.
assistant
SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = 'Fall'
human
Report the distinct president vote and the vice president vote.
assistant
SELECT DISTINCT President_Vote , VICE_President_Vote FROM VOTING_RECORD
human
For each election cycle, report the number of voting records.
assistant
SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle
human
Report the distinct registration date and the election cycle.
assistant
SELECT DISTINCT Registration_Date , Election_Cycle FROM VOTING_RECORD ;