CREATE TABLE Student (
    StuID NUMBER PRIMARY KEY,
    LName TEXT,
    Fname TEXT,
    Age NUMBER,
    Sex TEXT,
    Major NUMBER,
    Advisor NUMBER,
    city_code TEXT
);
CREATE TABLE Voting_record (
    StuID NUMBER,
    Registration_Date TEXT,
    Election_Cycle TEXT,
    President_Vote NUMBER,
    Vice_President_Vote NUMBER,
    Secretary_Vote NUMBER,
    Treasurer_Vote NUMBER,
    Class_President_Vote NUMBER,
    Class_Senator_Vote NUMBER,
    FOREIGN KEY ("Class_Senator_Vote") REFERENCES Student("StuID"),
    FOREIGN KEY ("Class_President_Vote") REFERENCES Student("StuID"),
    FOREIGN KEY ("Treasurer_Vote") REFERENCES Student("StuID"),
    FOREIGN KEY ("Secretary_Vote") REFERENCES Student("StuID"),
    FOREIGN KEY ("Vice_President_Vote") REFERENCES Student("StuID"),
    FOREIGN KEY ("President_Vote") REFERENCES Student("StuID"),
    FOREIGN KEY ("StuID") REFERENCES Student("StuID")
);

Question: Find the number of students in total.
SQL: SELECT count(*) FROM STUDENT

Question: How many students are there in total?
SQL: SELECT count(*) FROM STUDENT

Question: Find the number of voting records in total.
SQL: SELECT count(*) FROM VOTING_RECORD

Question: How many voting records do we have?
SQL: SELECT count(*) FROM VOTING_RECORD

Question: Find the distinct number of president votes.
SQL: SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD

Question: How many distinct president votes are recorded?
SQL: SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD

Question: Find the maximum age of all the students.
SQL: SELECT max(Age) FROM STUDENT

Question: What is the oldest age among the students?
SQL: SELECT max(Age) FROM STUDENT

Question: Find the last names of students with major 50.
SQL: SELECT LName FROM STUDENT WHERE Major  =  50

Question: What are the last names of students studying major 50?
SQL: SELECT LName FROM STUDENT WHERE Major  =  50

Question: Find the first names of students with age above 22.
SQL: SELECT Fname FROM STUDENT WHERE Age  >  22

Question: What are the first names of all the students aged above 22?
SQL: SELECT Fname FROM STUDENT WHERE Age  >  22

Question: What are the majors of male (sex is M) students?
SQL: SELECT Major FROM STUDENT WHERE Sex  =  "M"

Question: List the major of each male student.
SQL: SELECT Major FROM STUDENT WHERE Sex  =  "M"

Question: What is the average age of female (sex is F) students?
SQL: SELECT avg(Age) FROM STUDENT WHERE Sex  =  "F"

Question: Find the average age of female students.
SQL: SELECT avg(Age) FROM STUDENT WHERE Sex  =  "F"

Question: What are the maximum and minimum age of students with major 600?
SQL: SELECT max(Age) ,  min(Age) FROM STUDENT WHERE Major  =  600

Question: Tell me the ages of the oldest and youngest students studying major 600.
SQL: SELECT max(Age) ,  min(Age) FROM STUDENT WHERE Major  =  600

Question: Who are the advisors for students that live in a city with city code "BAL"?
SQL: SELECT Advisor FROM STUDENT WHERE city_code  =  "BAL"

Question: Show the advisors of the students whose city of residence has city code "BAL".
SQL: SELECT Advisor FROM STUDENT WHERE city_code  =  "BAL"

Question: What are the distinct secretary votes in the fall election cycle?
SQL: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE  =  "Fall"

Question: Return all the distinct secretary votes made in the fall election cycle.
SQL: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE  =  "Fall"

Question: What are the distinct president votes on 08/30/2015?
SQL: 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.
SQL: SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date  =  "08/30/2015"

Question: Report the distinct registration date and the election cycle.
SQL: SELECT DISTINCT Registration_Date ,  Election_Cycle FROM VOTING_RECORD

Question: What are the distinct registration dates and the election cycles?
SQL: SELECT DISTINCT Registration_Date ,  Election_Cycle FROM VOTING_RECORD

Question: Report the distinct president vote and the vice president vote.
SQL: SELECT DISTINCT President_Vote ,  VICE_President_Vote FROM VOTING_RECORD

Question: List all the distinct president votes and the vice president votes.
SQL: SELECT DISTINCT President_Vote ,  VICE_President_Vote FROM VOTING_RECORD

Question: Find the distinct last names of the students who have class president votes.
SQL: 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?
SQL: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.CLASS_President_VOTE

Question: Find the distinct first names of the students who have class senator votes.
SQL: 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?
SQL: SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.CLASS_Senator_VOTE

Question: Find the distinct ages of students who have secretary votes in the fall election cycle.
SQL: 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?
SQL: 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 Advisor of students who have treasurer votes in the spring election cycle.
SQL: 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?
SQL: 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 majors of students who have treasurer votes.
SQL: 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?
SQL: SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.Treasurer_Vote

Question: Find the first and last names of all the female (sex is F) students who have president votes.
SQL: 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?
SQL: 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 name of all the students of age 18 who have vice president votes.
SQL: 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.
SQL: 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: How many male (sex is M) students have class senator votes in the fall election cycle?
SQL: 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"