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: Find the top 3 artists who have the largest number of songs works whose language is Bangla.
SQL: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "bangla" 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 top 3 artists with the largest number of songs in the language Bangla?
SQL: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "bangla" 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: List the id, genre and artist name of English songs ordered by rating.
SQL: SELECT f_id ,  genre_is ,  artist_name FROM song WHERE languages  =   "english" ORDER BY rating
-- 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, genre, and name of the artist for every English song ordered by ascending rating?
SQL: SELECT f_id ,  genre_is ,  artist_name FROM song WHERE languages  =   "english" ORDER BY rating
-- 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 duration, file size and format of songs whose genre is pop, ordered by title?
SQL: SELECT T1.duration ,  T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.genre_is  =  "pop" ORDER BY T2.song_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 is the duration, file size, and song format for every pop song, ordered by title alphabetically?
SQL: SELECT T1.duration ,  T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.genre_is  =  "pop" ORDER BY T2.song_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: Find the names of the artists who have produced English songs but have never received rating higher than 8.
SQL: SELECT DISTINCT artist_name FROM song WHERE languages  =  "english" EXCEPT SELECT DISTINCT artist_name 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 are the names of the different artists that have produced a song in English but have never receieved a rating higher than 8?
SQL: SELECT DISTINCT artist_name FROM song WHERE languages  =  "english" EXCEPT SELECT DISTINCT artist_name 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: Find the names of the artists who are from Bangladesh and have never received rating higher than 7.
SQL: SELECT DISTINCT artist_name FROM artist WHERE country  =  "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  7
-- 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 different artists from Bangladesh who never received a rating higher than a 7?
SQL: SELECT DISTINCT artist_name FROM artist WHERE country  =  "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  7
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: How many camera lenses have a focal length longer than 15 mm?
SQL: SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: Find the brand and name for each camera lens, and sort in descending order of maximum aperture.
SQL: SELECT brand ,  name FROM camera_lens ORDER BY max_aperture DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: List the id, color scheme, and name for all the photos.
SQL: SELECT id ,  color ,  name FROM photos
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What are the maximum and average height of the mountains?
SQL: SELECT max(height) ,  avg(height) FROM mountain
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What are the average prominence of the mountains in country 'Morocco'?
SQL: SELECT avg(prominence) FROM mountain WHERE country  =  'Morocco'
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?
SQL: SELECT name ,  height ,  prominence FROM mountain WHERE range != 'Aberdare Range'
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What are the id and name of the photos for mountains?
SQL: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.height  >  4000
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What are the id and name of the mountains that have at least 2 photos?
SQL: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What are the names of the cameras that have taken picture of the most mountains?
SQL: SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?
SQL: SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id  =  T1.id WHERE T1.brand  =  'Sigma' OR T1.brand  =  'Olympus'
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: How many different kinds of lens brands are there?
SQL: SELECT count(DISTINCT brand) FROM camera_lens
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: How many camera lenses are not used in taking any photos?
SQL: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?
SQL: SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif'
SQL: SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Lasta Massif'
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.
SQL: SELECT name ,  prominence FROM mountain EXCEPT SELECT T1.name ,  T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T3.brand  =  'Sigma'
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: List the camera lens names containing substring "Digital".
SQL: SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: mountain 
columns : [['id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]

 -- Table: camera lens 
columns : [['id', 'number'], ['brand', 'text'], ['name', 'text'], ['focal length mm', 'number'], ['max aperture', 'number']]

 -- Table: photos 
columns : [['id', 'number'], ['camera lens id', 'number'], ['mountain id', 'number'], ['color', 'text'], ['name', 'text']]

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



Question: What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.
SQL: SELECT T1.name ,  count(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id  =  T2.camera_lens_id GROUP BY T1.id ORDER BY count(*)
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 channels that are not owned by CCTV.
SQL: SELECT name FROM channel WHERE OWNER != 'CCTV'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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: Which channels are not owned by CCTV? Give me the channel names.
SQL: SELECT name FROM channel WHERE OWNER != 'CCTV'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 all channel names ordered by their rating in percent from big to small.
SQL: SELECT name FROM channel ORDER BY rating_in_percent DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 all the channel names sorted by the channel rating in descending order.
SQL: SELECT name FROM channel ORDER BY rating_in_percent DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 owner of the channel that has the highest rating ratio?
SQL: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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: Show me the owner of the channel with the highest rating.
SQL: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 programs are there?
SQL: SELECT count(*) FROM program
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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: Count the number of programs.
SQL: SELECT count(*) FROM program
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 all the names of programs, ordering by launch time.
SQL: SELECT name FROM program ORDER BY launch
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 list of program names, sorted by the order of launch date?
SQL: SELECT name FROM program ORDER BY launch
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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, origin and owner of each program.
SQL: SELECT name ,  origin ,  OWNER FROM program
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 name, origin and owner of each program?
SQL: SELECT name ,  origin ,  OWNER FROM program
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 of the program that was launched most recently.
SQL: SELECT name FROM program ORDER BY launch DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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: Which program was launched most recently? Return the program name.
SQL: SELECT name FROM program ORDER BY launch DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 total percentage share of all channels owned by CCTV.
SQL: SELECT sum(Share_in_percent) FROM channel WHERE OWNER  =  'CCTV'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 total share (in percent) of all the channels owned by CCTV?
SQL: SELECT sum(Share_in_percent) FROM channel WHERE OWNER  =  'CCTV'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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 channels that are broadcast in the morning.
SQL: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', '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: Which channels are broadcast in the morning? Give me the channel names.
SQL: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning'