sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the number of students in total.
SQL: SELECT count(*) FROM STUDENT
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many students are there in total?
SQL: SELECT count(*) FROM STUDENT
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the number of voting records in total.
SQL: SELECT count(*) FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many voting records do we have?
SQL: SELECT count(*) FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the distinct number of president votes.
SQL: SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many distinct president votes are recorded?
SQL: SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the maximum age of all the students.
SQL: SELECT max(Age) FROM STUDENT
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the oldest age among the students?
SQL: SELECT max(Age) FROM STUDENT
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the last names of students with major 50.
SQL: SELECT LName FROM STUDENT WHERE Major  =  50
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the last names of students studying major 50?
SQL: SELECT LName FROM STUDENT WHERE Major  =  50
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the first names of students with age above 22.
SQL: SELECT Fname FROM STUDENT WHERE Age  >  22
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the first names of all the students aged above 22?
SQL: SELECT Fname FROM STUDENT WHERE Age  >  22
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the majors of male (sex is M) students?
SQL: SELECT Major FROM STUDENT WHERE Sex  =  "M"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List the major of each male student.
SQL: SELECT Major FROM STUDENT WHERE Sex  =  "M"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the average age of female (sex is F) students?
SQL: SELECT avg(Age) FROM STUDENT WHERE Sex  =  "F"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the average age of female students.
SQL: SELECT avg(Age) FROM STUDENT WHERE Sex  =  "F"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the maximum and minimum age of students with major 600?
SQL: SELECT max(Age) ,  min(Age) FROM STUDENT WHERE Major  =  600
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the advisors of the students whose city of residence has city code "BAL".
SQL: SELECT Advisor FROM STUDENT WHERE city_code  =  "BAL"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the distinct secretary votes in the fall election cycle?
SQL: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE  =  "Fall"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Report the distinct registration date and the election cycle.
SQL: SELECT DISTINCT Registration_Date ,  Election_Cycle FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the distinct registration dates and the election cycles?
SQL: SELECT DISTINCT Registration_Date ,  Election_Cycle FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Report the distinct president vote and the vice president vote.
SQL: SELECT DISTINCT President_Vote ,  VICE_President_Vote FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List all the distinct president votes and the vice president votes.
SQL: SELECT DISTINCT President_Vote ,  VICE_President_Vote FROM VOTING_RECORD
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Count the number of male students who had 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.
SQL: 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: voting record 
columns : [['student id', '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']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which students live in the city with code "NYC" and have class senator votes in the spring election cycle? Count the numbers.
SQL: 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"