sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 distinct governors.
SQL: SELECT count(DISTINCT Governor) FROM party
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 lieutenant governor and comptroller from the democratic party.
SQL: SELECT Lieutenant_Governor ,  Comptroller FROM party WHERE Party  =  "Democratic"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: Who are the lieutenant governor and comptroller from the democratic party?
SQL: SELECT Lieutenant_Governor ,  Comptroller FROM party WHERE Party  =  "Democratic"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: In which distinct years was the governor "Eliot Spitzer"?
SQL: SELECT DISTINCT YEAR FROM party WHERE Governor  =  "Eliot Spitzer"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 distinct years when the governor was named "Eliot Spitzer".
SQL: SELECT DISTINCT YEAR FROM party WHERE Governor  =  "Eliot Spitzer"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', 'text']]

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



Question: Show all the information about election.
SQL: SELECT * FROM election
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 all the information for each election record.
SQL: SELECT * FROM election
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 delegates and the names of county they belong to.
SQL: SELECT T2.Delegate ,  T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 delegate and name of the county they belong to, for each county?
SQL: SELECT T2.Delegate ,  T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 delegates are from counties with population smaller than 100000?
SQL: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  <  100000
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 delegates who are from counties with population below 100000.
SQL: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  <  100000
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 distinct delegates are from counties with population larger than 50000?
SQL: SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  >  50000
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 distinct delegates who are from counties with population above 50000.
SQL: SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  >  50000
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 the county that the delegates on "Appropriations" committee belong to?
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T2.Committee  =  "Appropriations"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 county do the delegates on "Appropriations" committee belong to? Give me the county names.
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T2.Committee  =  "Appropriations"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 delegates and the names of the party they belong to.
SQL: SELECT T1.Delegate ,  T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: For each delegate, find the names of the party they are part of.
SQL: SELECT T1.Delegate ,  T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: Who were the governors of the parties associated with delegates from district 1?
SQL: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 parties associated with the delegates from district 1. Who served as governors of the parties?
SQL: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?
SQL: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1 OR T1.District  =  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 parties associated with the delegates from district 1 or 2. Who served as comptrollers of the parties?
SQL: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1 OR T1.District  =  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 all the committees that have delegates from Democratic party.
SQL: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T2.Party  =  "Democratic"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 committees have delegates from the Democratic party?
SQL: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T2.Party  =  "Democratic"
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 of each county along with the corresponding number of delegates from that county.
SQL: SELECT T1.County_name ,  COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: For each county, find the name of the county and the number of delegates from that county.
SQL: SELECT T1.County_name ,  COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 of each party and the corresponding number of delegates from that party.
SQL: SELECT T2.Party ,  COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: For each party, return the name of the party and the number of delegates from that party.
SQL: SELECT T2.Party ,  COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 all counties sorted by population in ascending order.
SQL: SELECT County_name FROM county ORDER BY Population ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: Sort the names of all counties in ascending order of population.
SQL: SELECT County_name FROM county ORDER BY Population ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 all counties sorted by county name in descending alphabetical order.
SQL: SELECT County_name FROM county ORDER BY County_name DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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: Sort the names of all counties in descending alphabetical order.
SQL: SELECT County_name FROM county ORDER BY County_name DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 of the county with the biggest population.
SQL: SELECT County_name FROM county ORDER BY Population DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 county has the largest population? Give me the name of the county.
SQL: SELECT County_name FROM county ORDER BY Population DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 3 counties with the smallest population.
SQL: SELECT County_name FROM county ORDER BY Population ASC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 3 counties that have the smallest population? Give me the county names.
SQL: SELECT County_name FROM county ORDER BY Population ASC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 names of counties that have at least two delegates.
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 counties have two or more delegates? Give me the county names.
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 of the party that has at least two records.
SQL: SELECT Party FROM party GROUP BY Party HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 party has two or more records?
SQL: SELECT Party FROM party GROUP BY Party HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 of the party that has the most delegates.
SQL: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 party has the largest number of delegates?
SQL: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 people that have been governor the most times.
SQL: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: county 
columns : [['county id', 'number'], ['county name', 'text'], ['population', 'number'], ['zip code', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['year', 'number'], ['party', 'text'], ['governor', 'text'], ['lieutenant governor', 'text'], ['comptroller', 'text'], ['attorney general', 'text'], ['us senate', 'text']]

 -- Table: election 
columns : [['election id', 'number'], ['counties represented', 'text'], ['district', 'number'], ['delegate', 'text'], ['party', 'number'], ['first elected', 'number'], ['committee', '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 people severed as governor most frequently?
SQL: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1