sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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: Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul OR T2.Mar  >  T2.Oct
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 cities' temperature in March is lower than that in July or higher than that in Oct?
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul OR T2.Mar  >  T2.Oct
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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: Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 cities have lower temperature in March than in July and have been once host cities?
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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: Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 cities have lower temperature in March than in Dec and have never served as host cities?
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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: Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Feb  >  T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 cities have higher temperature in Feb than in Jun or have once served as host cities?
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Feb  >  T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', 'text']]

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



Question: Please give me a list of cities whose regional population is over 10000000.
SQL: SELECT city FROM city WHERE regional_population  >  10000000
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 cities have regional population above 10000000?
SQL: SELECT city FROM city WHERE regional_population  >  10000000
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', 'text']]

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



Question: Please give me a list of cities whose regional population is over 8000000 or under 5000000.
SQL: SELECT city FROM city WHERE regional_population  >  10000000 UNION SELECT city FROM city WHERE regional_population  <  5000000
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 cities have regional population above 8000000 or below 5000000?
SQL: SELECT city FROM city WHERE regional_population  >  10000000 UNION SELECT city FROM city WHERE regional_population  <  5000000
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', 'text']]

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



Question: Find the number of matches in different competitions.
SQL: SELECT count(*) ,  Competition FROM MATCH GROUP BY Competition
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 competition, count the number of matches.
SQL: SELECT count(*) ,  Competition FROM MATCH GROUP BY Competition
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', 'text']]

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



Question: List venues of all matches in the order of their dates starting from the most recent one.
SQL: SELECT venue FROM MATCH ORDER BY date DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 venues of all the matches? Sort them in the descending order of match date.
SQL: SELECT venue FROM MATCH ORDER BY date DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', 'text']]

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



Question: what is the GDP of the city with the largest population.
SQL: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 GDP of the city with the largest regional population.
SQL: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 GDP and population of the city that already served as a host more than once?
SQL: SELECT t1.gdp ,  t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY t2.Host_City HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: city 
columns : [['city id', 'number'], ['city', 'text'], ['hanzi', 'text'], ['hanyu pinyin', 'text'], ['regional population', 'number'], ['gdp', 'number']]

 -- Table: match 
columns : [['match id', 'number'], ['date', 'text'], ['venue', 'text'], ['score', 'text'], ['result', 'text'], ['competition', 'text']]

 -- Table: temperature 
columns : [['city id', 'number'], ['jan', 'number'], ['feb', 'number'], ['mar', 'number'], ['apr', 'number'], ['jun', 'number'], ['jul', 'number'], ['aug', 'number'], ['sep', 'number'], ['oct', 'number'], ['nov', 'number'], ['dec', 'number']]

 -- Table: hosting city 
columns : [['year', 'number'], ['match id', 'number'], ['host city', '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 cities have served as host cities more than once? Return me their GDP and population.
SQL: SELECT t1.gdp ,  t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY t2.Host_City HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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 every individual's first name, middle name and last name in alphabetical order by last name.
SQL: SELECT individual_first_name ,  individual_middle_name ,  individual_last_name FROM individuals ORDER BY individual_last_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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



Question: What are the first, middle, and last names of all individuals, ordered by last name?
SQL: SELECT individual_first_name ,  individual_middle_name ,  individual_last_name FROM individuals ORDER BY individual_last_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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



Question: List all the types of forms.
SQL: SELECT DISTINCT form_type_code FROM forms
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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 types of forms?
SQL: SELECT DISTINCT form_type_code FROM forms
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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



Question: Find the name of the most popular party form.
SQL: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id  =  t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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 party form that is most common?
SQL: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id  =  t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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 payment method and phone of the party with email "enrico09@example.com".
SQL: SELECT payment_method_code ,  party_phone FROM parties WHERE party_email  =  "enrico09@example.com"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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 payment method code and party phone of the party with the email 'enrico09@example.com'?
SQL: SELECT payment_method_code ,  party_phone FROM parties WHERE party_email  =  "enrico09@example.com"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

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

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

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 emails of parties with the most popular party form.
SQL: SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id  =  t2.party_id WHERE t2.form_id  =  (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)