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: What are the different names and countries of origins for all artists whose song ratings are above 9?
SQL: SELECT DISTINCT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.rating  >  9
-- 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 file size and format for all songs that have resolution lower than 800.
SQL: SELECT DISTINCT T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.resolution  <  800
-- 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 file sizes and formats for all songs with a resolution lower than 800?
SQL: SELECT DISTINCT T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.resolution  <  800
-- 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 who produced the shortest song?
SQL: SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id  =  T2.f_id ORDER BY T2.duration 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 artists who sang the shortest song?
SQL: SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id  =  T2.f_id ORDER BY T2.duration 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 and countries of origin for the artists who produced the top three highly rated songs.
SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.rating 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 singers who sang the top 3 most highly rated songs and what countries do they hail from?
SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.rating 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: How many songs have 4 minute duration?
SQL: SELECT count(*) FROM files WHERE duration LIKE "4:%"
-- 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 count of the songs that last approximately 4 minutes?
SQL: SELECT count(*) FROM files WHERE duration LIKE "4:%"
-- 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: How many artists are from Bangladesh?
SQL: SELECT count(*) FROM artist WHERE country  =  "Bangladesh"
-- 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: How many Bangladeshi artists are listed?
SQL: SELECT count(*) FROM artist WHERE country  =  "Bangladesh"
-- 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 of songs produced by female artists?
SQL: SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female"
-- 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: How many songs, on average, are sung by a female artist?
SQL: SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female"
-- 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 most popular file format?
SQL: SELECT formats FROM files GROUP BY formats 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: Find the file format that is used by the most files.
SQL: SELECT formats FROM files GROUP BY formats 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: Find the names of the artists who are from UK and have produced English songs.
SQL: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT artist_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 the artists that are from the UK and sang songs in English?
SQL: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT artist_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: Find the id of songs that are available in mp4 format and have resolution lower than 1000.
SQL: SELECT f_id FROM files WHERE formats  =  "mp4" INTERSECT SELECT f_id 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 is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?
SQL: SELECT f_id FROM files WHERE formats  =  "mp4" INTERSECT SELECT f_id 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 is the country of origin of the artist who is female and produced a song in Bangla?
SQL: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female" AND T2.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 countries are the female artists who sung in the language Bangla from?
SQL: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female" AND T2.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 duration of songs that have mp3 format and resolution below 800?
SQL: SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" AND T2.resolution   <  800
-- 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 song duration for the songs that are in mp3 format and whose resolution below 800?
SQL: SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" AND T2.resolution   <  800
-- 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 number of artists for each gender?
SQL: SELECT count(*) ,  gender FROM artist GROUP BY gender
-- 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: How many artists are male and how many are female?
SQL: SELECT count(*) ,  gender FROM artist GROUP BY gender
-- 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 of songs for each language?
SQL: SELECT avg(rating) ,  languages FROM song GROUP BY 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 is the average song rating for each language?
SQL: SELECT avg(rating) ,  languages FROM song GROUP BY 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: Return the gender and name of artist who produced the song with the lowest resolution.
SQL: SELECT T1.gender ,  T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.resolution 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 gender and name of the artist who sang the song with the smallest resolution?
SQL: SELECT T1.gender ,  T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.resolution 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: For each file format, return the number of artists who released songs in that format.
SQL: SELECT count(*) ,  formats FROM files GROUP BY formats
-- 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: How many songs were released for each format?
SQL: SELECT count(*) ,  formats FROM files GROUP BY formats
-- 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 distinct names of all songs that have a higher resolution than some songs in English.
SQL: SELECT DISTINCT song_name FROM song WHERE resolution  >  (SELECT min(resolution) 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 different names for all songs that have a higher resolution than English songs?
SQL: SELECT DISTINCT song_name FROM song WHERE resolution  >  (SELECT min(resolution) 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 have a lower rating than some song of blues genre?
SQL: SELECT song_name FROM song WHERE rating  <  (SELECT max(rating) FROM song WHERE genre_is  =  "blues")
-- 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 have a lower rating than at least one blues song?
SQL: SELECT song_name FROM song WHERE rating  <  (SELECT max(rating) FROM song WHERE genre_is  =  "blues")
-- 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 of the artist who released a song that has "love" in its title?
SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.song_name LIKE "%love%"
-- 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 artists who released a song that has the word love in its title, and where are the artists from?
SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.song_name LIKE "%love%"
-- 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 name and gender for all artists who released songs in March.
SQL: SELECT T1.artist_name ,  T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.releasedate LIKE "%Mar%"
-- 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 genders of all artists who released songs in the month of March?
SQL: SELECT T1.artist_name ,  T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.releasedate LIKE "%Mar%"
-- 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 genres in alphabetical oder, together with its ratings.
SQL: SELECT g_name ,  rating FROM genre ORDER BY g_name
-- 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 genres in alphabetical order, combined with its ratings?
SQL: SELECT g_name ,  rating FROM genre ORDER BY g_name