sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Give me a list of the names of all songs ordered by their resolution.
SQL: SELECT song_name FROM song ORDER BY resolution
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of all songs that are ordered by their resolution numbers?
SQL: SELECT song_name FROM song ORDER BY resolution
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the ids of songs that are available in either mp4 format or have resolution above 720?
SQL: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the ids of all songs that are available on mp4 or have a higher resolution than 720?
SQL: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: List the names of all songs that have 4 minute duration or are in English.
SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages  =  "english"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of all songs that are approximately 4 minutes long or are in English?
SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages  =  "english"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the language used most often in the songs?
SQL: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the languages that are used most often in songs?
SQL: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the language that was used most often in songs with resolution above 500?
SQL: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the name of the artist, for each language, that has the most songs with a higher resolution than 500?
SQL: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of artists who are Male and are from UK?
SQL: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of all male British artists?
SQL: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Find the names of songs whose genre is modern or language is English.
SQL: SELECT song_name FROM song WHERE genre_is  =  "modern" OR languages  =  "english"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of the songs that are modern or sung in English?
SQL: SELECT song_name FROM song WHERE genre_is  =  "modern" OR languages  =  "english"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Return the names of songs for which format is mp3 and resolution is below 1000.
SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of all songs that are in mp3 format and have a resolution lower than 1000?
SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Return the names of singers who are from UK and released an English song.
SQL: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of all singers that are from the UK and released a song in English?
SQL: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the average rating and resolution of songs that are in Bangla?
SQL: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the average rating and resolution of all bangla songs?
SQL: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the maximum and minimum resolution of songs whose duration is 3 minutes?
SQL: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the maximum and minimum resolution of all songs that are approximately 3 minutes long?
SQL: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the maximum duration and resolution of songs grouped and ordered by languages?
SQL: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the maximum duration and resolution of all songs, for each language, ordered alphabetically by language?
SQL: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre?
SQL: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the shortest and most poorly rated song for each genre, ordered alphabetically by genre?
SQL: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Find the names and number of works of all artists who have at least one English songs.
SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names and number of works for all artists who have sung at least one song in English?
SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Find the name and country of origin for all artists who have release at least one song of resolution above 900.
SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the name and country of origin for each artist who has released a song with a resolution higher than 900?
SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Find the names and number of works of the three artists who have produced the most songs.
SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of the three artists who have produced the most songs, and how many works did they produce?
SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: Find the country of origin for the artist who made the least number of songs?
SQL: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What country is the artist who made the fewest songs from?
SQL: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the names of the songs whose rating is below the rating of all songs in English?
SQL: SELECT song_name FROM song WHERE rating  <   (SELECT min(rating) FROM song WHERE languages  =  'english')
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the song names for every song whose rating is less than the minimum rating for English songs?
SQL: SELECT song_name FROM song WHERE rating  <   (SELECT min(rating) FROM song WHERE languages  =  'english')
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?
SQL: SELECT f_id FROM song WHERE resolution  >  (SELECT max(resolution) FROM song WHERE rating  <  8)
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is the id of every song that has a resolution higher than that of a song with a rating below 8?
SQL: SELECT f_id FROM song WHERE resolution  >  (SELECT max(resolution) FROM song WHERE rating  <  8)
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?
SQL: SELECT f_id FROM song WHERE resolution  >  (SELECT avg(resolution) FROM song WHERE genre_is  =  "modern")
-- Language PostgreSQL
        -- Tables: 
             -- Table: genre 
columns : [['genre name', 'text'], ['rating', 'text'], ['most popular in', 'text']]

 -- Table: artist 
columns : [['artist name', 'text'], ['country', 'text'], ['gender', 'text'], ['preferred genre', 'text']]

 -- Table: files 
columns : [['song id', 'number'], ['artist name', 'text'], ['file size', 'text'], ['duration', 'text'], ['formats', 'text']]

 -- Table: song 
columns : [['song name', 'text'], ['artist name', 'text'], ['country', 'text'], ['song id', 'number'], ['genre is', 'text'], ['rating', 'number'], ['languages', 'text'], ['releasedate', 'time'], ['resolution', 'number']]

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



Question: What are the ids of all songs that have higher resolution of the average resolution in the modern genre?
SQL: SELECT f_id FROM song WHERE resolution  >  (SELECT avg(resolution) FROM song WHERE genre_is  =  "modern")