brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
How many music festivals have had each kind of result, ordered descending by count?
-- Language PostgreSQL -- Tables: -- Table: artist columns : [['artist id', 'number'], ['artist', 'text'], ['age', 'number'], ['famous title', 'text'], ['famous release date', 'text']] -- Table: volume columns : [['volume id', 'number'], ['volume issue', 'text'], ['issue date', 'text'], ['weeks on top', 'number'], ['song', 'text'], ['artist id', 'number']] -- Table: music festival columns : [['id', 'number'], ['music festival', 'text'], ['date of ceremony', 'text'], ['category', 'text'], ['volume', 'number'], ['result', '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. Translate `How many music festivals have had each kind of result, ordered descending by count?` to a syntactically-correct PostgreSQL query.
SELECT RESULT , COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC
What are the issue dates of volumes associated with the artist aged 23 or younger?
-- Language PostgreSQL -- Tables: -- Table: artist columns : [['artist id', 'number'], ['artist', 'text'], ['age', 'number'], ['famous title', 'text'], ['famous release date', 'text']] -- Table: volume columns : [['volume id', 'number'], ['volume issue', 'text'], ['issue date', 'text'], ['weeks on top', 'number'], ['song', 'text'], ['artist id', 'number']] -- Table: music festival columns : [['id', 'number'], ['music festival', 'text'], ['date of ceremony', 'text'], ['category', 'text'], ['volume', 'number'], ['result', '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. Translate `What are the issue dates of volumes associated with the artist aged 23 or younger?` to a syntactically-correct PostgreSQL query.
SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23
Return the issue dates of volumes by artists who are at most 23 years old?
-- Language PostgreSQL -- Tables: -- Table: artist columns : [['artist id', 'number'], ['artist', 'text'], ['age', 'number'], ['famous title', 'text'], ['famous release date', 'text']] -- Table: volume columns : [['volume id', 'number'], ['volume issue', 'text'], ['issue date', 'text'], ['weeks on top', 'number'], ['song', 'text'], ['artist id', 'number']] -- Table: music festival columns : [['id', 'number'], ['music festival', 'text'], ['date of ceremony', 'text'], ['category', 'text'], ['volume', 'number'], ['result', '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. Translate `Return the issue dates of volumes by artists who are at most 23 years old?` to a syntactically-correct PostgreSQL query.
SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23
How many roller coasters are there?
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `How many roller coasters are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM roller_coaster
List the names of roller coasters by ascending order of length.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `List the names of roller coasters by ascending order of length.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM roller_coaster ORDER BY LENGTH ASC
What are the lengths and heights of roller coasters?
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `What are the lengths and heights of roller coasters?` to a syntactically-correct PostgreSQL query.
SELECT LENGTH , Height FROM roller_coaster
List the names of countries whose language is not "German".
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `List the names of countries whose language is not "German".` to a syntactically-correct PostgreSQL query.
SELECT Name FROM country WHERE Languages != "German"
Show the statuses of roller coasters longer than 3300 or higher than 100.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Show the statuses of roller coasters longer than 3300 or higher than 100.` to a syntactically-correct PostgreSQL query.
SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100
What are the speeds of the longest roller coaster?
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `What are the speeds of the longest roller coaster?` to a syntactically-correct PostgreSQL query.
SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
What is the average speed of roller coasters?
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `What is the average speed of roller coasters?` to a syntactically-correct PostgreSQL query.
SELECT avg(Speed) FROM roller_coaster
Show the different statuses and the numbers of roller coasters for each status.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Show the different statuses and the numbers of roller coasters for each status.` to a syntactically-correct PostgreSQL query.
SELECT Status , COUNT(*) FROM roller_coaster GROUP BY Status
Please show the most common status of roller coasters.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Please show the most common status of roller coasters.` to a syntactically-correct PostgreSQL query.
SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
List the status shared by more than two roller coaster.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `List the status shared by more than two roller coaster.` to a syntactically-correct PostgreSQL query.
SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2
Show the park of the roller coaster with the highest speed.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Show the park of the roller coaster with the highest speed.` to a syntactically-correct PostgreSQL query.
SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
Show the names of roller coasters and names of country they are in.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Show the names of roller coasters and names of country they are in.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID
Show the names of countries that have more than one roller coaster.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Show the names of countries that have more than one roller coaster.` to a syntactically-correct PostgreSQL query.
SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1
Show the name and population of the country that has the highest roller coaster.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Show the name and population of the country that has the highest roller coaster.` to a syntactically-correct PostgreSQL query.
SELECT T1.Name , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1
Show the names of countries and the average speed of roller coasters from each country.
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `Show the names of countries and the average speed of roller coasters from each country.` to a syntactically-correct PostgreSQL query.
SELECT T1.Name , avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name
How many countries do not have an roller coaster longer than 3000?
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `How many countries do not have an roller coaster longer than 3000?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000 )
What are the country names, area and population which has both roller coasters with speed higher
-- Language PostgreSQL -- Tables: -- Table: roller coaster columns : [['roller coaster id', 'number'], ['name', 'text'], ['park', 'text'], ['country id', 'number'], ['length', 'number'], ['height', 'number'], ['speed', 'text'], ['opened', 'text'], ['status', 'text']] -- Table: country columns : [['country id', 'number'], ['name', 'text'], ['population', 'number'], ['area', 'number'], ['languages', '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. Translate `What are the country names, area and population which has both roller coasters with speed higher` to a syntactically-correct PostgreSQL query.
SELECT T1.name , T1.area , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name , T1.area , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed < 55
How many different captain ranks are there?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `How many different captain ranks are there?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT rank) FROM captain
Count the number of different ranks of captain.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Count the number of different ranks of captain.` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT rank) FROM captain
How many captains are in each rank?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `How many captains are in each rank?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , rank FROM captain GROUP BY rank
Count the number of captains that have each rank.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Count the number of captains that have each rank.` to a syntactically-correct PostgreSQL query.
SELECT count(*) , rank FROM captain GROUP BY rank
How many captains with younger than 50 are in each rank?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `How many captains with younger than 50 are in each rank?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
Count the number of captains younger than 50 of each rank.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Count the number of captains younger than 50 of each rank.` to a syntactically-correct PostgreSQL query.
SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
Sort all captain names by their ages from old to young.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Sort all captain names by their ages from old to young.` to a syntactically-correct PostgreSQL query.
SELECT name FROM captain ORDER BY age DESC
What are the names of captains, sorted by age descending?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the names of captains, sorted by age descending?` to a syntactically-correct PostgreSQL query.
SELECT name FROM captain ORDER BY age DESC
Find the name, class and rank of all captains.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the name, class and rank of all captains.` to a syntactically-correct PostgreSQL query.
SELECT name , CLASS , rank FROM captain
What are the names, classes, and ranks of all captains?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the names, classes, and ranks of all captains?` to a syntactically-correct PostgreSQL query.
SELECT name , CLASS , rank FROM captain
Which rank is the most common among captains?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Which rank is the most common among captains?` to a syntactically-correct PostgreSQL query.
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
Return the rank for which there are the fewest captains.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Return the rank for which there are the fewest captains.` to a syntactically-correct PostgreSQL query.
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
Which classes have more than two captains?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Which classes have more than two captains?` to a syntactically-correct PostgreSQL query.
SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
Give the classes that have more than two captains.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Give the classes that have more than two captains.` to a syntactically-correct PostgreSQL query.
SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
Find the name of captains whose rank are either Midshipman or Lieutenant.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the name of captains whose rank are either Midshipman or Lieutenant.` to a syntactically-correct PostgreSQL query.
SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
What are the names of captains that have either the rank Midshipman or Lieutenant?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the names of captains that have either the rank Midshipman or Lieutenant?` to a syntactically-correct PostgreSQL query.
SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
What are the average and minimum age of captains in different class?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the average and minimum age of captains in different class?` to a syntactically-correct PostgreSQL query.
SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
Return the average and minimum age of captains in each class.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Return the average and minimum age of captains in each class.` to a syntactically-correct PostgreSQL query.
SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the captain rank that has some captains in both Cutter and Armed schooner classes.` to a syntactically-correct PostgreSQL query.
SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
What are the ranks of captains that are both in the Cutter and Armed schooner classes?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the ranks of captains that are both in the Cutter and Armed schooner classes?` to a syntactically-correct PostgreSQL query.
SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
Find the captain rank that has no captain in Third-rate ship of the line class.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the captain rank that has no captain in Third-rate ship of the line class.` to a syntactically-correct PostgreSQL query.
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?` to a syntactically-correct PostgreSQL query.
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
What is the name of the youngest captain?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What is the name of the youngest captain?` to a syntactically-correct PostgreSQL query.
SELECT name FROM captain ORDER BY age LIMIT 1
Return the name of the youngest captain.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Return the name of the youngest captain.` to a syntactically-correct PostgreSQL query.
SELECT name FROM captain ORDER BY age LIMIT 1
how many ships are there?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `how many ships are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM ship
Count the number of ships.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Count the number of ships.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM ship
Find the name, type, and flag of the ship that is built in the most recent year.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the name, type, and flag of the ship that is built in the most recent year.` to a syntactically-correct PostgreSQL query.
SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
What is the name, type, and flag of the ship that was built in the most recent year?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What is the name, type, and flag of the ship that was built in the most recent year?` to a syntactically-correct PostgreSQL query.
SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
Group by ships by flag, and return number of ships that have each flag.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Group by ships by flag, and return number of ships that have each flag.` to a syntactically-correct PostgreSQL query.
SELECT count(*) , flag FROM ship GROUP BY flag
What are the different ship flags, and how many ships have each?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the different ship flags, and how many ships have each?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , flag FROM ship GROUP BY flag
Which flag is most widely used among all ships?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Which flag is most widely used among all ships?` to a syntactically-correct PostgreSQL query.
SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
Return the flag that is most common among all ships.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Return the flag that is most common among all ships.` to a syntactically-correct PostgreSQL query.
SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
List all ship names in the order of built year and class.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `List all ship names in the order of built year and class.` to a syntactically-correct PostgreSQL query.
SELECT name FROM ship ORDER BY built_year , CLASS
What are the names of ships, ordered by year they were built and their class?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the names of ships, ordered by year they were built and their class?` to a syntactically-correct PostgreSQL query.
SELECT name FROM ship ORDER BY built_year , CLASS
Find the ship type that are used by both ships with Panama and Malta flags.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the ship type that are used by both ships with Panama and Malta flags.` to a syntactically-correct PostgreSQL query.
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
What types of ships have both ships that have Panama Flags and Malta flags?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What types of ships have both ships that have Panama Flags and Malta flags?` to a syntactically-correct PostgreSQL query.
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
In which year were most of ships built?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `In which year were most of ships built?` to a syntactically-correct PostgreSQL query.
SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
What is the year in which most ships were built?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What is the year in which most ships were built?` to a syntactically-correct PostgreSQL query.
SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
Find the name of the ships that have more than one captain.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the name of the ships that have more than one captain.` to a syntactically-correct PostgreSQL query.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1
What are the names of ships that have more than one captain?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the names of ships that have more than one captain?` to a syntactically-correct PostgreSQL query.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1
what are the names and classes of the ships that do not have any captain yet?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `what are the names and classes of the ships that do not have any captain yet?` to a syntactically-correct PostgreSQL query.
SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
Return the names and classes of ships that do not have a captain?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Return the names and classes of ships that do not have a captain?` to a syntactically-correct PostgreSQL query.
SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
Find the name of the ship that is steered by the youngest captain.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the name of the ship that is steered by the youngest captain.` to a syntactically-correct PostgreSQL query.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
What is the name of the ship that is commanded by the youngest captain?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What is the name of the ship that is commanded by the youngest captain?` to a syntactically-correct PostgreSQL query.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
Find the name and flag of ships that are not steered by any captain with Midshipman rank.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the name and flag of ships that are not steered by any captain with Midshipman rank.` to a syntactically-correct PostgreSQL query.
SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
What are the names and flags of ships that do not have a captain with the rank of Midshipman?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the names and flags of ships that do not have a captain with the rank of Midshipman?` to a syntactically-correct PostgreSQL query.
SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.` to a syntactically-correct PostgreSQL query.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?
-- Language PostgreSQL -- Tables: -- Table: captain columns : [['captain id', 'number'], ['name', 'text'], ['ship id', 'number'], ['age', 'text'], ['class', 'text'], ['rank', 'text']] -- Table: ship columns : [['ship id', 'number'], ['name', 'text'], ['type', 'text'], ['built year', 'number'], ['class', 'text'], ['flag', '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. Translate `What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?` to a syntactically-correct PostgreSQL query.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
What is id of the city that hosted events in the most recent year?
-- 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. Translate `What is id of the city that hosted events in the most recent year?` to a syntactically-correct PostgreSQL query.
SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
Find the city that hosted some events in the most recent year. What is the id of this 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. Translate `Find the city that hosted some events in the most recent year. What is the id of this city?` to a syntactically-correct PostgreSQL query.
SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"?
-- 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. Translate `Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"?` to a syntactically-correct PostgreSQL query.
SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
What is the match id of the competition called "1994 FIFA World Cup qualification"?
-- 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. Translate `What is the match id of the competition called "1994 FIFA World Cup qualification"?` to a syntactically-correct PostgreSQL query.
SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
Find the cities which were once a host city after 2010?
-- 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. Translate `Find the cities which were once a host city after 2010?` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
Which cities served as a host city after 2010?
-- 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. Translate `Which cities served as a host city after 2010?` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
Which city has hosted the most events?
-- 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. Translate `Which city has hosted the most events?` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1
Find the city that hosted the most events.
-- 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. Translate `Find the city that hosted the most events.` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1
What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"?
-- 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. Translate `What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"?` to a syntactically-correct PostgreSQL query.
SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )".
-- 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. Translate `Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )".` to a syntactically-correct PostgreSQL query.
SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
Give me the temperature of Shanghai in January.
-- 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. Translate `Give me the temperature of Shanghai in January.` to a syntactically-correct PostgreSQL query.
SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
What is the temperature of "Shanghai" city in January?
-- 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. Translate `What is the temperature of "Shanghai" city in January?` to a syntactically-correct PostgreSQL query.
SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
What is the host year of city "Taizhou ( Zhejiang )"?
-- 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. Translate `What is the host year of city "Taizhou ( Zhejiang )"?` to a syntactically-correct PostgreSQL query.
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
IN which year did city "Taizhou ( Zhejiang )" serve as a 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. Translate `IN which year did city "Taizhou ( Zhejiang )" serve as a host city?` to a syntactically-correct PostgreSQL query.
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
Which three cities have the largest regional population?
-- 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. Translate `Which three cities have the largest regional population?` to a syntactically-correct PostgreSQL query.
SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
What are the three largest cities in terms of regional population?
-- 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. Translate `What are the three largest cities in terms of regional population?` to a syntactically-correct PostgreSQL query.
SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
Which city has the lowest GDP? Please list the city name and its GDP.
-- 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. Translate `Which city has the lowest GDP? Please list the city name and its GDP.` to a syntactically-correct PostgreSQL query.
SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
What is the city with the smallest GDP? Return the city and its GDP.
-- 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. Translate `What is the city with the smallest GDP? Return the city and its GDP.` to a syntactically-correct PostgreSQL query.
SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
Which city has the highest temperature in February?
-- 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. Translate `Which city has the highest temperature in February?` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
In February, which city marks the highest temperature?
-- 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. Translate `In February, which city marks the highest temperature?` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
Give me a list of cities whose temperature in March is lower than that in July or higher than that in 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. Translate `Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?` to a syntactically-correct PostgreSQL query.
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
Which cities' temperature in March is lower than that in July or higher than that in 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. Translate `Which cities' temperature in March is lower than that in July or higher than that in Oct?` to a syntactically-correct PostgreSQL query.
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
Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
-- 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. Translate `Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?` to a syntactically-correct PostgreSQL query.
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
Which cities have lower temperature in March than in July and have been once host cities?
-- 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. Translate `Which cities have lower temperature in March than in July and have been once host cities?` to a syntactically-correct PostgreSQL query.
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
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
-- 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. Translate `Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.` to a syntactically-correct PostgreSQL query.
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
Which cities have lower temperature in March than in Dec and have never served as host cities?
-- 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. Translate `Which cities have lower temperature in March than in Dec and have never served as host cities?` to a syntactically-correct PostgreSQL query.
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
Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
-- 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. Translate `Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?` to a syntactically-correct PostgreSQL query.
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
Which cities have higher temperature in Feb than in Jun or have once served as host cities?
-- 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. Translate `Which cities have higher temperature in Feb than in Jun or have once served as host cities?` to a syntactically-correct PostgreSQL query.
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
Please give me a list of cities whose regional population is over 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. Translate `Please give me a list of cities whose regional population is over 10000000.` to a syntactically-correct PostgreSQL query.
SELECT city FROM city WHERE regional_population > 10000000
Which cities have regional population above 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. Translate `Which cities have regional population above 10000000?` to a syntactically-correct PostgreSQL query.
SELECT city FROM city WHERE regional_population > 10000000
Please give me a list of cities whose regional population is over 8000000 or under 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. Translate `Please give me a list of cities whose regional population is over 8000000 or under 5000000.` to a syntactically-correct PostgreSQL query.
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
Which cities have regional population above 8000000 or below 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. Translate `Which cities have regional population above 8000000 or below 5000000?` to a syntactically-correct PostgreSQL query.
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000