sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 manager name for gas stations belonging to the ExxonMobil company.
SQL: SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id WHERE T2.company  =  'ExxonMobil'
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 names of the managers for gas stations that are operated by the ExxonMobil company?
SQL: SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id WHERE T2.company  =  'ExxonMobil'
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 locations where a gas station for company with market value greater than 100 is located.
SQL: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id WHERE T2.market_value  >  100
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 locations that have gas stations owned by a company with a market value greater than 100?
SQL: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id WHERE T2.market_value  >  100
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 manager name with most number of gas stations opened after 2000.
SQL: SELECT manager_name FROM gas_station WHERE open_year  >  2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 name of the manager with the most gas stations that opened after 2000?
SQL: SELECT manager_name FROM gas_station WHERE open_year  >  2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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: order all gas station locations by the opening year.
SQL: SELECT LOCATION FROM gas_station ORDER BY open_year
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 locations of all the gas stations ordered by opening year?
SQL: SELECT LOCATION FROM gas_station ORDER BY open_year
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.
SQL: SELECT rank ,  company ,  market_value FROM company WHERE main_industry  =  'Banking' ORDER BY sales_billion ,  profits_billion
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 rank, company, and market value of every comapny in the banking industry ordered by sales and profits?
SQL: SELECT rank ,  company ,  market_value FROM company WHERE main_industry  =  'Banking' ORDER BY sales_billion ,  profits_billion
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.
SQL: SELECT T3.location ,  T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: company 
columns : [['company id', 'number'], ['rank', 'number'], ['company', 'text'], ['headquarters', 'text'], ['main industry', 'text'], ['sales billion', 'number'], ['profits billion', 'number'], ['assets billion', 'number'], ['market value', 'number']]

 -- Table: gas station 
columns : [['station id', 'number'], ['open year', 'number'], ['location', 'text'], ['manager name', 'text'], ['vice manager name', 'text'], ['representative name', 'text']]

 -- Table: station company 
columns : [['station id', 'number'], ['company id', 'number'], ['rank of the year', '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 locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets?
SQL: SELECT T3.location ,  T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 regions do we have?
SQL: SELECT count(*) FROM region
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 regions.
SQL: SELECT count(*) FROM region
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 distinct region names ordered by their labels.
SQL: SELECT DISTINCT region_name FROM region ORDER BY Label
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 different region names, ordered by labels?
SQL: SELECT DISTINCT region_name FROM region ORDER BY Label
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 parties do we have?
SQL: SELECT count(DISTINCT party_name) FROM party
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 different parties.
SQL: SELECT count(DISTINCT party_name) FROM party
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 ministers and the time they took and left office, listed by the time they left office.
SQL: SELECT minister ,  took_office ,  left_office FROM party ORDER BY left_office
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Who are the ministers, when did they take office, and when did they leave office, ordered by when they left office?
SQL: SELECT minister ,  took_office ,  left_office FROM party ORDER BY left_office
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 minister who took office after 1961 or before 1959.
SQL: SELECT minister FROM party WHERE took_office  >  1961 OR took_office  <  1959
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Who are the ministers who took office after 1961 or before 1959?
SQL: SELECT minister FROM party WHERE took_office  >  1961 OR took_office  <  1959
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 ministers who do not belong to Progress Party.
SQL: SELECT minister FROM party WHERE party_name != 'Progress Party'
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Which ministers are not a part of the Progress Party?
SQL: SELECT minister FROM party WHERE party_name != 'Progress Party'
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 ministers and parties they belong to in descending order of the time they took office.
SQL: SELECT minister ,  party_name FROM party ORDER BY took_office DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Who are the ministers and what parties do they belong to, listed descending by the times they took office?
SQL: SELECT minister ,  party_name FROM party ORDER BY took_office DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Return the minister who left office at the latest time.
SQL: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Which minister left office the latest?
SQL: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 member names and their party names.
SQL: SELECT T1.member_name ,  T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 names of members and their corresponding parties?
SQL: SELECT T1.member_name ,  T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 party names and the number of members in each party.
SQL: SELECT T2.party_name ,  count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 members are in each party?
SQL: SELECT T2.party_name ,  count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 name of party with most number of members?
SQL: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Return the name of the party with the most members.
SQL: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 party names and their region names.
SQL: SELECT T1.party_name ,  T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 names of parties and their respective regions?
SQL: SELECT T1.party_name ,  T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 names of parties that does not have any members.
SQL: SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 names of parties that have no members?
SQL: SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 member names which are in both the party with id 3 and the party with id 1.
SQL: SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Which member names are shared among members in the party with the id 3 and the party with the id 1?
SQL: SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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 member names that are not in the Progress Party.
SQL: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"
-- Language PostgreSQL
        -- Tables: 
             -- Table: region 
columns : [['region id', 'number'], ['region name', 'text'], ['date', 'text'], ['label', 'text'], ['format', 'text'], ['catalogue', 'text']]

 -- Table: party 
columns : [['party id', 'number'], ['minister', 'text'], ['took office', 'text'], ['left office', 'text'], ['region id', 'number'], ['party name', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['member name', 'text'], ['party id', 'text'], ['in office', 'text']]

 -- Table: party events 
columns : [['event id', 'number'], ['event name', 'text'], ['party id', 'number'], ['member in charge id', '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: Which member names corresponding to members who are not in the Progress Party?
SQL: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"