sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 teams had more than 3 eliminations?
SQL: SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*)  >  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 reign and days held of wrestlers.
SQL: SELECT Reign ,  Days_held FROM wrestler
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 reigns and days held of all wrestlers?
SQL: SELECT Reign ,  Days_held FROM wrestler
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 wrestlers days held less than 100?
SQL: SELECT Name FROM wrestler WHERE Days_held  <  100
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 names of wrestlers with fewer than 100 days held.
SQL: SELECT Name FROM wrestler WHERE Days_held  <  100
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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: Please show the most common reigns of wrestlers.
SQL: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 reign is the most common among wrestlers?
SQL: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 the locations that are shared by more than two wrestlers.
SQL: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*)  >  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 locations are shared by more than two wrestlers?
SQL: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*)  >  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 the names of wrestlers that have not been eliminated.
SQL: SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 wrestlers who have never been eliminated?
SQL: SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 teams that have both wrestlers eliminated by "Orton" and wrestlers eliminated by "Benjamin".
SQL: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin"
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 teams that have both wrestlers eliminated by Orton and wrestlers eliminated by Benjamin?
SQL: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin"
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 number of distinct teams that suffer elimination?
SQL: SELECT COUNT (DISTINCT team) FROM elimination
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 teams have had eliminated wrestlers?
SQL: SELECT COUNT (DISTINCT team) FROM elimination
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 times of elimination by "Punk" or "Orton".
SQL: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton"
-- Language PostgreSQL
        -- Tables: 
             -- Table: wrestler 
columns : [['wrestler id', 'number'], ['name', 'text'], ['reign', 'text'], ['days held', 'text'], ['location', 'text'], ['event', 'text']]

 -- Table: elimination 
columns : [['elimination id', 'text'], ['wrestler id', 'text'], ['team', 'text'], ['eliminated by', 'text'], ['elimination move', 'text'], ['time', '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 times of elimination for any instances in which the elimination was done by Punk or Orton?
SQL: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton"
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: How many schools are there?
SQL: SELECT count(*) FROM school
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Count the number of schools.
SQL: SELECT count(*) FROM school
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show all school names in alphabetical order.
SQL: SELECT school_name FROM school ORDER BY school_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: List the name, location, mascot for all schools.
SQL: SELECT school_name ,  LOCATION ,  mascot FROM school
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: What are the total and average enrollment of all schools?
SQL: SELECT sum(enrollment) ,  avg(enrollment) FROM school
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: What are the mascots for schools with enrollments above the average?
SQL: SELECT mascot FROM school WHERE enrollment  >  (SELECT avg(enrollment) FROM school)
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: List the name of the school with the smallest enrollment.
SQL: SELECT school_name FROM school ORDER BY enrollment LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show the average, maximum, minimum enrollment of all schools.
SQL: SELECT avg(enrollment) ,  max(enrollment) ,  min(enrollment) FROM school
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show each county along with the number of schools and total enrollment in each county.
SQL: SELECT county ,  count(*) ,  sum(enrollment) FROM school GROUP BY county
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: How many donors have endowment for school named "Glenn"?
SQL: SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  "Glenn"
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: List each donator name and the amount of endowment in descending order of the amount of endowment.
SQL: SELECT donator_name ,  sum(amount) FROM endowment GROUP BY donator_name ORDER BY sum(amount) DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: List the names of the schools without any endowment.
SQL: SELECT school_name FROM school WHERE school_id NOT IN (SELECT school_id FROM endowment)
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: List all the names of schools with an endowment amount smaller than or equal to 10.
SQL: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount)  <=  10
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show the names of donors who donated to both school "Glenn" and "Triton."
SQL: SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Triton'
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show the names of all the donors except those whose donation amount less than 9.
SQL: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount  <  9
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: List the amount and donor name for the largest amount of donation.
SQL: SELECT amount ,  donator_name FROM endowment ORDER BY amount DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: How many budgets are above 3000 in year 2001 or before?
SQL: SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000
SQL: SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show each school name, its budgeted amount, and invested amount in year 2002 or after.
SQL: SELECT T2.school_name ,  T1.budgeted ,  T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.year  >=  2002
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show all donor names.
SQL: SELECT DISTINCT donator_name FROM endowment
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: How many budget record has a budget amount smaller than the invested amount?
SQL: SELECT count(*) FROM budget WHERE budgeted  <  invested
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: What is the total budget amount for school "Glenn" in all years?
SQL: SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn'
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.
SQL: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id JOIN endowment AS T3 ON T2.school_id  =  T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted)  >  100 OR sum(T3.amount)  >  10
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Find the names of schools that have more than one donator with donation amount above 8.5.
SQL: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.amount  >  8.5 GROUP BY T1.school_id HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: Find the number of schools that have more than one donator whose donation amount is less than 8.5.
SQL: SELECT count(*) FROM (SELECT * FROM endowment WHERE amount  >  8.5 GROUP BY school_id HAVING count(*)  >  1)
-- Language PostgreSQL
        -- Tables: 
             -- Table: school 
columns : [['school id', 'text'], ['school name', 'text'], ['location', 'text'], ['mascot', 'text'], ['enrollment', 'number'], ['ihsaa class', 'text'], ['ihsaa football class', 'text'], ['county', 'text']]

 -- Table: budget 
columns : [['school id', 'number'], ['year', 'number'], ['budgeted', 'number'], ['total budget percent budgeted', 'number'], ['invested', 'number'], ['total budget percent invested', 'number'], ['budget invested percent', 'text']]

 -- Table: endowment 
columns : [['endowment id', 'number'], ['school id', 'number'], ['donator name', 'text'], ['amount', 'number']]

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



Question: List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.
SQL: SELECT T1.School_name ,  T1.Mascot ,  T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id  =  T2.school_id WHERE Budgeted  >  6000 OR YEAR  <  2003 ORDER BY T2.total_budget_percent_invested ,  T2.total_budget_percent_budgeted
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', '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 buildings are there?
SQL: SELECT count(*) FROM building
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', '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 name, street address, and number of floors for all buildings ordered by the number of floors.
SQL: SELECT name ,  street_address ,  floors FROM building ORDER BY floors
-- Language PostgreSQL
        -- Tables: 
             -- Table: building 
columns : [['building id', 'text'], ['name', 'text'], ['street address', 'text'], ['years as tallest', 'text'], ['height feet', 'number'], ['floors', 'number']]

 -- Table: institution 
columns : [['institution id', 'text'], ['institution', 'text'], ['location', 'text'], ['founded', 'number'], ['type', 'text'], ['enrollment', 'number'], ['team', 'text'], ['primary conference', 'text'], ['building id', 'text']]

 -- Table: protein 
columns : [['common name', 'text'], ['protein name', 'text'], ['divergence from human lineage', 'number'], ['accession number', 'text'], ['sequence length', 'number'], ['sequence identity to human protein', 'text'], ['institution id', '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 tallest building?
SQL: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1