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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 video games with type Collectible card game.
SQL: SELECT gname FROM Video_games WHERE gtype  =  "Collectible card game"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 names of all video games that are collectible cards?
SQL: SELECT gname FROM Video_games WHERE gtype  =  "Collectible card game"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 type of video game Call of Destiny.
SQL: SELECT gtype FROM Video_games WHERE gname  =  "Call of Destiny"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 type of game is Call of Destiny?
SQL: SELECT gtype FROM Video_games WHERE gname  =  "Call of Destiny"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 video games have type Massively multiplayer online game?
SQL: SELECT count(*) FROM Video_games WHERE gtype  =  "Massively multiplayer online game"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 video games with Massively multiplayer online game type .
SQL: SELECT count(*) FROM Video_games WHERE gtype  =  "Massively multiplayer online game"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 video game types and the number of video games in each type.
SQL: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 types of video games and how many are in each type?
SQL: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 game type has most number of games?
SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 type has the most games?
SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 game type has least number of games?
SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 type with the fewest games?
SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 ids for all students who live in CHI.
SQL: SELECT StuID FROM Student WHERE city_code  =  "CHI"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 ids of all students who live in CHI?
SQL: SELECT StuID FROM Student WHERE city_code  =  "CHI"
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 ids for all students who have advisor 1121.
SQL: SELECT StuID FROM Student WHERE Advisor  =  1121
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 ids of all students who have advisor number 1121?
SQL: SELECT StuID FROM Student WHERE Advisor  =  1121
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 first name for all students with major 600.
SQL: SELECT Fname 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 for all students who are from the major numbered 600?
SQL: SELECT Fname 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 average, minimum, and maximum age for different majors.
SQL: SELECT major ,  avg(age) ,  min(age) ,  max(age) FROM Student GROUP BY major
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 average, minimum, and max ages for each of the different majors?
SQL: SELECT major ,  avg(age) ,  min(age) ,  max(age) FROM Student GROUP BY major
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 advisors who have at least two students.
SQL: SELECT advisor FROM Student GROUP BY advisor HAVING count(*)  >=  2
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 advisors
SQL: SELECT advisor FROM Student GROUP BY advisor HAVING count(*)  >=  2
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 sports do we have?
SQL: SELECT count(DISTINCT sportname) FROM Sportsinfo
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 different types of sports do we offer?
SQL: SELECT count(DISTINCT sportname) FROM Sportsinfo
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 play sports?
SQL: SELECT count(DISTINCT StuID) FROM Sportsinfo
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 different students are involved in sports?
SQL: SELECT count(DISTINCT StuID) FROM Sportsinfo
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 ids for all student who are on scholarship.
SQL: SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y'
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 ids for all sporty students who are on scholarship?
SQL: SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y'
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 last names for all student who are on scholarship.
SQL: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  'Y'
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 for all scholarship students?
SQL: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  'Y'
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 games are played for all students?
SQL: SELECT sum(gamesplayed) FROM Sportsinfo
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 total number of games played?
SQL: SELECT sum(gamesplayed) FROM Sportsinfo
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 games are played for all football games by students on scholarship?
SQL: SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "Football" AND onscholarship  =  'Y'
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 total number of all football games played by scholarship students?
SQL: SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "Football" AND onscholarship  =  'Y'
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 sport name and the number of students.
SQL: SELECT sportname ,  count(*) FROM Sportsinfo GROUP BY sportname
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 play each sport?
SQL: SELECT sportname ,  count(*) FROM Sportsinfo GROUP BY sportname
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 student IDs with the number of sports and total number of games played
SQL: SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 ids of all students along with how many sports and games did they play?
SQL: SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 student IDs with more than total 10 hours per week on all sports played.
SQL: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek)  >  10
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 student IDs for everybody who worked for more than 10 hours per week on all sports?
SQL: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek)  >  10
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 first name and last name of the student who have most number of sports?
SQL: SELECT T2.Fname ,  T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 first and last name of the student who played the most sports?
SQL: SELECT T2.Fname ,  T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 sport has most number of students on scholarship?
SQL: SELECT sportname FROM Sportsinfo WHERE onscholarship  =  'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1
-- 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: video games 
columns : [['game id', 'number'], ['game name', 'text'], ['game type', 'text']]

 -- Table: plays games 
columns : [['student id', 'number'], ['game id', 'number'], ['hours played', 'number']]

 -- Table: sports info 
columns : [['student id', 'number'], ['sport name', 'text'], ['hours per week', 'number'], ['games played', 'number'], ['on scholarship', 'text']]

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 sport with the most scholarship students?
SQL: SELECT sportname FROM Sportsinfo WHERE onscholarship  =  'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1