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 student ids who don't have any sports.
SQL: SELECT StuID FROM Student EXCEPT SELECT 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: What are the ids of all students who don't play sports?
SQL: SELECT StuID FROM Student EXCEPT SELECT 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: Show student ids who are on scholarship and have major 600.
SQL: SELECT StuID FROM Student WHERE major  =  600 INTERSECT 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 student ids for those on scholarship in major number 600?
SQL: SELECT StuID FROM Student WHERE major  =  600 INTERSECT 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 student ids who are female and play football.
SQL: SELECT StuID FROM Student WHERE sex  =  'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"
-- 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 female students who play football?
SQL: SELECT StuID FROM Student WHERE sex  =  'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"
-- 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 male student ids who don't play football.
SQL: SELECT StuID FROM Student WHERE sex  =  'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"
-- 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 male students who do not play football?
SQL: SELECT StuID FROM Student WHERE sex  =  'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"
-- 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 total hours per week and number of games played for student David Shieber.
SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.Fname  =  "David" AND T2.Lname  =  "Shieber"
-- 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 hours per work and number of games played by David Shieber?
SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.Fname  =  "David" AND T2.Lname  =  "Shieber"
-- 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 total hours per week and number of games played for students under 20.
SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.age  <  20
-- 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 hours per week and number of games played by students under 20?
SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.age  <  20
-- 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 video games?
SQL: SELECT count(DISTINCT StuID) FROM Plays_games
-- 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 play games?
SQL: SELECT count(DISTINCT StuID) FROM Plays_games
-- 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 of students who don't play video game.
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games
-- 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 are not video game players?
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games
-- 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 of students who play video game and play sports.
SQL: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games
-- 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 played video games and sports?
SQL: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games
-- 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 game ids and the number of hours played.
SQL: SELECT gameid ,  sum(hours_played) FROM Plays_games GROUP BY gameid
-- 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 ids and total number of hours played for each game?
SQL: SELECT gameid ,  sum(hours_played) FROM Plays_games GROUP BY gameid
-- 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 and the number of hours played.
SQL: SELECT Stuid ,  sum(hours_played) FROM Plays_games 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 and number of hours played?
SQL: SELECT Stuid ,  sum(hours_played) FROM Plays_games 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 the game name that has most number of hours played.
SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) 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 name of the game that has been played the most?
SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) 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: Show all game names played by at least 1000 hours.
SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid HAVING sum(hours_played)  >=  1000
-- 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 the games that have been played for at least 1000 hours?
SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid HAVING sum(hours_played)  >=  1000
-- 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 game names played by Linda Smith
SQL: SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid JOIN Student AS T3 ON T3.Stuid  =  T1.Stuid WHERE T3.Lname  =  "Smith" AND T3.Fname  =  "Linda"
-- 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 games played by Linda Smith?
SQL: SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid JOIN Student AS T3 ON T3.Stuid  =  T1.Stuid WHERE T3.Lname  =  "Smith" AND T3.Fname  =  "Linda"
-- 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: Find the last and first name of students who are playing Football or Lacrosse.
SQL: SELECT T2.lname ,  T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.SportName  =  "Football" OR T1.SportName  =  "Lacrosse"
-- 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 all students who play Football or Lacrosse?
SQL: SELECT T2.lname ,  T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.SportName  =  "Football" OR T1.SportName  =  "Lacrosse"
-- 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: Find the first name and age of the students who are playing both Football and Lacrosse.
SQL: SELECT fname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName  =  "Football" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName  =  "Lacrosse")
-- 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 and ages of all students who are playing both Football and Lacrosse?
SQL: SELECT fname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName  =  "Football" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName  =  "Lacrosse")
-- 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: Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.
SQL: SELECT lname ,  sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "Call of Destiny" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "Works of Widenius")
-- 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 last name and gender of all students who played both Call of Destiny and Works of Widenius?
SQL: SELECT lname ,  sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "Call of Destiny" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "Works of Widenius")
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address content', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method', 'text'], ['customer name', 'text'], ['date became customer', 'time'], ['other customer details', 'text']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type', 'text'], ['date address to', 'time']]

 -- Table: customer contact channels 
columns : [['customer id', 'number'], ['channel code', 'text'], ['active from date', 'time'], ['active to date', 'time'], ['contact number', 'text']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status', 'text'], ['order date', 'time'], ['order details', 'text']]

 -- Table: order items 
columns : [['order id', 'number'], ['product id', 'number'], ['order quantity', '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: Find the name of all customers.
SQL: SELECT customer_name FROM customers
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address content', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method', 'text'], ['customer name', 'text'], ['date became customer', 'time'], ['other customer details', 'text']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type', 'text'], ['date address to', 'time']]

 -- Table: customer contact channels 
columns : [['customer id', 'number'], ['channel code', 'text'], ['active from date', 'time'], ['active to date', 'time'], ['contact number', 'text']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status', 'text'], ['order date', 'time'], ['order details', 'text']]

 -- Table: order items 
columns : [['order id', 'number'], ['product id', 'number'], ['order quantity', '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 the customers?
SQL: SELECT customer_name FROM customers
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address content', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method', 'text'], ['customer name', 'text'], ['date became customer', 'time'], ['other customer details', 'text']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type', 'text'], ['date address to', 'time']]

 -- Table: customer contact channels 
columns : [['customer id', 'number'], ['channel code', 'text'], ['active from date', 'time'], ['active to date', 'time'], ['contact number', 'text']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status', 'text'], ['order date', 'time'], ['order details', 'text']]

 -- Table: order items 
columns : [['order id', 'number'], ['product id', 'number'], ['order quantity', '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 customers are there?
SQL: SELECT count(*) FROM customers
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address content', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method', 'text'], ['customer name', 'text'], ['date became customer', 'time'], ['other customer details', 'text']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type', 'text'], ['date address to', 'time']]

 -- Table: customer contact channels 
columns : [['customer id', 'number'], ['channel code', 'text'], ['active from date', 'time'], ['active to date', 'time'], ['contact number', 'text']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status', 'text'], ['order date', 'time'], ['order details', 'text']]

 -- Table: order items 
columns : [['order id', 'number'], ['product id', 'number'], ['order quantity', '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: Return the total number of distinct customers.
SQL: SELECT count(*) FROM customers
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address content', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method', 'text'], ['customer name', 'text'], ['date became customer', 'time'], ['other customer details', 'text']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type', 'text'], ['date address to', 'time']]

 -- Table: customer contact channels 
columns : [['customer id', 'number'], ['channel code', 'text'], ['active from date', 'time'], ['active to date', 'time'], ['contact number', 'text']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status', 'text'], ['order date', 'time'], ['order details', 'text']]

 -- Table: order items 
columns : [['order id', 'number'], ['product id', 'number'], ['order quantity', '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 average amount of items ordered in each order?
SQL: SELECT avg(order_quantity) FROM order_items