sert121/SpiderSQL huggingface dataset:
-- 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.



Question: Return the song in the volume that has spent the most weeks on top?
SQL: SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
-- 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.



Question: Find the famous titles of artists that do not have any volume.
SQL: SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
-- 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.



Question: What are the famous titles of artists who do not have any volumes?
SQL: SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
-- 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.



Question: Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.
SQL: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  <  2
-- 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.



Question: What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top?
SQL: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  <  2
-- 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.



Question: What are the date of ceremony of music festivals with category "Best Song" and result "Awarded"?
SQL: SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded"
-- 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.



Question: Return the dates of ceremony corresponding to music festivals that had the category "Best Song" and result "Awarded".
SQL: SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded"
-- 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.



Question: What is the issue date of the volume with the minimum weeks on top?
SQL: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
-- 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.



Question: Return the issue date of the volume that has spent the fewest weeks on top.
SQL: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
-- 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.



Question: How many distinct artists have volumes?
SQL: SELECT COUNT(DISTINCT Artist_ID) FROM volume
-- 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.



Question: Count the number of artists who have had volumes.
SQL: SELECT COUNT(DISTINCT Artist_ID) FROM volume
-- 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.



Question: Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.
SQL: SELECT RESULT ,  COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC
-- 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.



Question: How many music festivals have had each kind of result, ordered descending by count?
SQL: SELECT RESULT ,  COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC
-- 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.



Question: What are the issue dates of volumes associated with the artist aged 23 or younger?
SQL: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  23
-- 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.



Question: Return the issue dates of volumes by artists who are at most 23 years old?
SQL: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  23
-- 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.



Question: How many roller coasters are there?
SQL: SELECT count(*) FROM 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.



Question: List the names of roller coasters by ascending order of length.
SQL: SELECT Name FROM roller_coaster ORDER BY LENGTH ASC
-- 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.



Question: What are the lengths and heights of roller coasters?
SQL: SELECT LENGTH ,  Height FROM 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.



Question: List the names of countries whose language is not "German".
SQL: SELECT Name FROM country WHERE Languages != "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.



Question: Show the statuses of roller coasters longer than 3300 or higher than 100.
SQL: SELECT Status FROM roller_coaster WHERE LENGTH  >  3300 OR Height  >  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.



Question: What are the speeds of the longest roller coaster?
SQL: SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
-- 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.



Question: What is the average speed of roller coasters?
SQL: SELECT avg(Speed) FROM 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.



Question: Show the different statuses and the numbers of roller coasters for each status.
SQL: SELECT Status ,  COUNT(*) FROM roller_coaster GROUP BY 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.



Question: Please show the most common status of roller coasters.
SQL: SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
-- 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.



Question: List the status shared by more than two roller coaster.
SQL: SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*)  >  2
-- 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.



Question: Show the park of the roller coaster with the highest speed.
SQL: SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
-- 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.



Question: Show the names of roller coasters and names of country they are in.
SQL: SELECT T2.Name ,  T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID
-- 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.



Question: Show the names of countries that have more than one roller coaster.
SQL: 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
-- 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.



Question: Show the name and population of the country that has the highest roller coaster.
SQL: 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
-- 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.



Question: Show the names of countries and the average speed of roller coasters from each country.
SQL: 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
-- 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.



Question: How many countries do not have an roller coaster longer than 3000?
SQL: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  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.



Question: What are the country names, area and population which has both roller coasters with speed higher
SQL: 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
-- 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.



Question: How many different captain ranks are there?
SQL: SELECT count(DISTINCT rank) FROM 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.



Question: Count the number of different ranks of captain.
SQL: SELECT count(DISTINCT rank) FROM 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.



Question: How many captains are in each rank?
SQL: SELECT count(*) ,  rank FROM captain GROUP BY 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.



Question: Count the number of captains that have each rank.
SQL: SELECT count(*) ,  rank FROM captain GROUP BY 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.



Question: How many captains with younger than 50 are in each rank?
SQL: SELECT count(*) ,  rank FROM captain WHERE age  <  50 GROUP BY 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.



Question: Count the number of captains younger than 50 of each rank.
SQL: SELECT count(*) ,  rank FROM captain WHERE age  <  50 GROUP BY 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.



Question: Sort all captain names by their ages from old to young.
SQL: SELECT name FROM captain ORDER BY age DESC
-- 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.



Question: What are the names of captains, sorted by age descending?
SQL: SELECT name FROM captain ORDER BY age DESC
-- 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.



Question: Find the name, class and rank of all captains.
SQL: SELECT name ,  CLASS ,  rank FROM 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.



Question: What are the names, classes, and ranks of all captains?
SQL: SELECT name ,  CLASS ,  rank FROM 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.



Question: Which rank is the most common among captains?
SQL: SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
-- 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.



Question: Return the rank for which there are the fewest captains.
SQL: SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
-- 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.



Question: Which classes have more than two captains?
SQL: SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*)  >  2
-- 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.



Question: Give the classes that have more than two captains.
SQL: SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*)  >  2
-- 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.



Question: Find the name of captains whose rank are either Midshipman or Lieutenant.
SQL: SELECT name FROM captain WHERE rank  =  'Midshipman' OR rank  =  '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.



Question: What are the names of captains that have either the rank Midshipman or Lieutenant?
SQL: SELECT name FROM captain WHERE rank  =  'Midshipman' OR rank  =  '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.



Question: What are the average and minimum age of captains in different class?
SQL: SELECT avg(age) ,  min(age) ,  CLASS FROM captain GROUP BY 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.



Question: Return the average and minimum age of captains in each class.
SQL: SELECT avg(age) ,  min(age) ,  CLASS FROM captain GROUP BY 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.



Question: Find the captain rank that has some captains in both Cutter and Armed schooner classes.
SQL: SELECT rank FROM captain WHERE CLASS  =  'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS  =  'Armed schooner'
-- 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.



Question: What are the ranks of captains that are both in the Cutter and Armed schooner classes?
SQL: SELECT rank FROM captain WHERE CLASS  =  'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS  =  'Armed schooner'