sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 schools are in the basketball match?
SQL: SELECT count(DISTINCT school_id) FROM basketball_match
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 schools that have had basketball matches.
SQL: SELECT count(DISTINCT school_id) FROM basketball_match
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 highest acc percent score in the competition?
SQL: SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 highest acc percent across all basketball matches.
SQL: SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 primary conference of the school that has the lowest acc percent score in the competition?
SQL: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 primary conference of the school with the lowest acc percentage score.
SQL: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 team name and acc regular season score of the school that was founded for the longest time?
SQL: SELECT t2.team_name ,  t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 name of the team and the acc during the regular season for the school that was founded the earliest.
SQL: SELECT t2.team_name ,  t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 location and all games score of the school that has Clemson as its team name.
SQL: SELECT t2.All_Games ,  t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 all games score and location of the school called Clemson?
SQL: SELECT t2.All_Games ,  t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 enrollment size of the universities that are founded before 1850?
SQL: SELECT avg(enrollment) FROM university WHERE founded  <  1850
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 average enrollment of universities founded before 1850.
SQL: SELECT avg(enrollment) FROM university WHERE founded  <  1850
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 enrollment and primary_conference of the oldest college.
SQL: SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 enrollment and primary conference for the university which was founded the earliest?
SQL: SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 and minimum enrollment of all schools?
SQL: SELECT sum(enrollment) ,  min(enrollment) FROM university
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 and minimum enrollments across all schools.
SQL: SELECT sum(enrollment) ,  min(enrollment) FROM university
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 total student enrollment for different affiliation type schools.
SQL: SELECT sum(enrollment) ,  affiliation FROM university GROUP BY affiliation
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 total enrollments of universities of each affiliation type?
SQL: SELECT sum(enrollment) ,  affiliation FROM university GROUP BY affiliation
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 schools do not participate in the basketball match?
SQL: SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 universities that do not participate in the baketball match.
SQL: SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 schools that were either founded after 1850 or public.
SQL: SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 schools that were either founded before 1850 or are public?
SQL: SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 how many different affiliation types there are.
SQL: SELECT count(DISTINCT affiliation) FROM university
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 different affiliation types.
SQL: SELECT count(DISTINCT affiliation) FROM university
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 how many school locations have the word 'NY'.
SQL: SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 universities have a location that contains NY?
SQL: SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 team names of the universities whose enrollments are smaller than the average enrollment size.
SQL: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 teams from universities that have a below average enrollment?
SQL: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 number of universities that have over a 20000 enrollment size for each affiliation type.
SQL: SELECT count(*) ,  affiliation FROM university WHERE enrollment  >  20000 GROUP BY affiliation
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 different affiliations, and how many schools with each have an enrollment size of above 20000?
SQL: SELECT count(*) ,  affiliation FROM university WHERE enrollment  >  20000 GROUP BY affiliation
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type.
SQL: SELECT sum(Enrollment) ,  affiliation FROM university WHERE founded  >  1850 GROUP BY affiliation
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?
SQL: SELECT sum(Enrollment) ,  affiliation FROM university WHERE founded  >  1850 GROUP BY affiliation
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 maximum enrollment across all schools?
SQL: SELECT max(Enrollment) FROM university
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 maximum enrollment across all schools.
SQL: SELECT max(Enrollment) FROM university
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 all information regarding the basketball match.
SQL: SELECT * FROM basketball_match
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 all the information about the basketball match?
SQL: SELECT * FROM basketball_match
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 names of all teams in the basketball competition, ordered by all home scores in descending order.
SQL: SELECT team_name FROM basketball_match ORDER BY All_Home DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: basketball match 
columns : [['team id', 'number'], ['school id', 'number'], ['team name', 'text'], ['acc regular season', 'text'], ['acc percent', 'text'], ['acc home', 'text'], ['acc road', 'text'], ['all games', 'text'], ['all games percent', 'number'], ['all home', 'text'], ['all road', 'text'], ['all neutral', 'text']]

 -- Table: university 
columns : [['school id', 'number'], ['school', 'text'], ['location', 'text'], ['founded', 'number'], ['affiliation', 'text'], ['enrollment', 'number'], ['nickname', 'text'], ['primary conference', '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 teams in the basketball competition, sorted by all home scores in descending order?
SQL: SELECT team_name FROM basketball_match ORDER BY All_Home DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: chip model 
columns : [['model name', 'text'], ['launch year', 'number'], ['ram mib', 'number'], ['rom mib', 'number'], ['slots', 'text'], ['wifi', 'text'], ['bluetooth', 'text']]

 -- Table: screen mode 
columns : [['graphics mode', 'number'], ['char cells', 'text'], ['pixels', 'text'], ['hardware colours', 'number'], ['used kb', 'number'], ['map', 'text'], ['type', 'text']]

 -- Table: phone 
columns : [['company name', 'text'], ['hardware model name', 'text'], ['accreditation type', 'text'], ['accreditation level', 'text'], ['date', 'text'], ['chip model', 'text'], ['screen mode', '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: the names of models that launched between 2002 and 2004.
SQL: SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004;
-- Language PostgreSQL
        -- Tables: 
             -- Table: chip model 
columns : [['model name', 'text'], ['launch year', 'number'], ['ram mib', 'number'], ['rom mib', 'number'], ['slots', 'text'], ['wifi', 'text'], ['bluetooth', 'text']]

 -- Table: screen mode 
columns : [['graphics mode', 'number'], ['char cells', 'text'], ['pixels', 'text'], ['hardware colours', 'number'], ['used kb', 'number'], ['map', 'text'], ['type', 'text']]

 -- Table: phone 
columns : [['company name', 'text'], ['hardware model name', 'text'], ['accreditation type', 'text'], ['accreditation level', 'text'], ['date', 'text'], ['chip model', 'text'], ['screen mode', '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 model has the least amount of RAM? List the model name and the amount of RAM.
SQL: SELECT Model_name ,  RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1;
-- Language PostgreSQL
        -- Tables: 
             -- Table: chip model 
columns : [['model name', 'text'], ['launch year', 'number'], ['ram mib', 'number'], ['rom mib', 'number'], ['slots', 'text'], ['wifi', 'text'], ['bluetooth', 'text']]

 -- Table: screen mode 
columns : [['graphics mode', 'number'], ['char cells', 'text'], ['pixels', 'text'], ['hardware colours', 'number'], ['used kb', 'number'], ['map', 'text'], ['type', 'text']]

 -- Table: phone 
columns : [['company name', 'text'], ['hardware model name', 'text'], ['accreditation type', 'text'], ['accreditation level', 'text'], ['date', 'text'], ['chip model', 'text'], ['screen mode', '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 chip model and screen mode of the phone with hardware model name "LG-P760"?
SQL: SELECT chip_model ,  screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760";
-- Language PostgreSQL
        -- Tables: 
             -- Table: chip model 
columns : [['model name', 'text'], ['launch year', 'number'], ['ram mib', 'number'], ['rom mib', 'number'], ['slots', 'text'], ['wifi', 'text'], ['bluetooth', 'text']]

 -- Table: screen mode 
columns : [['graphics mode', 'number'], ['char cells', 'text'], ['pixels', 'text'], ['hardware colours', 'number'], ['used kb', 'number'], ['map', 'text'], ['type', 'text']]

 -- Table: phone 
columns : [['company name', 'text'], ['hardware model name', 'text'], ['accreditation type', 'text'], ['accreditation level', 'text'], ['date', 'text'], ['chip model', 'text'], ['screen mode', '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 phone hardware models are produced by the company named "Nokia Corporation"?
SQL: SELECT count(*) FROM phone WHERE Company_name = "Nokia Corporation";
-- Language PostgreSQL
        -- Tables: 
             -- Table: chip model 
columns : [['model name', 'text'], ['launch year', 'number'], ['ram mib', 'number'], ['rom mib', 'number'], ['slots', 'text'], ['wifi', 'text'], ['bluetooth', 'text']]

 -- Table: screen mode 
columns : [['graphics mode', 'number'], ['char cells', 'text'], ['pixels', 'text'], ['hardware colours', 'number'], ['used kb', 'number'], ['map', 'text'], ['type', 'text']]

 -- Table: phone 
columns : [['company name', 'text'], ['hardware model name', 'text'], ['accreditation type', 'text'], ['accreditation level', 'text'], ['date', 'text'], ['chip model', 'text'], ['screen mode', '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 maximum and minimum RAM size of phone produced by company named "Nokia Corporation"?
SQL: SELECT max(T1.RAM_MiB) ,  min(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Company_name = "Nokia Corporation";