sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 tracks that Dean Peeters bought?
SQL: SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters";
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 much is the track Fast As a Shark?
SQL: SELECT unit_price FROM tracks WHERE name = "Fast As a Shark";
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 unit price of the tune "Fast As a Shark"?
SQL: SELECT unit_price FROM tracks WHERE name = "Fast As a Shark";
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 tracks which are in Movies playlist but not in music playlist.
SQL: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 tracks that are on the Movies playlist but not in the music playlist?
SQL: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 tracks which are in both Movies and music playlists.
SQL: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 the tracks that are in both the Movies and music playlists?
SQL: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 number of tracks in each genre?
SQL: SELECT count(*) ,  T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;
-- Language PostgreSQL
        -- Tables: 
             -- Table: sqlite sequence 
columns : [['name', 'number'], ['seq', 'text']]

 -- Table: artists 
columns : [['id', 'text'], ['name', 'text']]

 -- Table: albums 
columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']]

 -- Table: employees 
columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']]

 -- Table: customers 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']]

 -- Table: genres 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: invoices 
columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']]

 -- Table: media types 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: tracks 
columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']]

 -- Table: invoice lines 
columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

 -- Table: playlists 
columns : [['id', 'number'], ['name', 'text']]

 -- Table: playlist tracks 
columns : [['playlist id', 'number'], ['track id', '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 tracks are in each genre?
SQL: SELECT count(*) ,  T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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 editors are there?
SQL: SELECT count(*) FROM editor
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: List the names of editors in ascending order of age.
SQL: SELECT Name FROM editor ORDER BY Age ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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 and ages of editors?
SQL: SELECT Name ,  Age FROM editor
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: List the names of editors who are older than 25.
SQL: SELECT Name FROM editor WHERE Age  >  25
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: Show the names of editors of age either 24 or 25.
SQL: SELECT Name FROM editor WHERE Age  =  24 OR Age  =  25
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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 the youngest editor?
SQL: SELECT Name FROM editor ORDER BY Age ASC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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 different ages of editors? Show each age along with the number of editors of that age.
SQL: SELECT Age ,  COUNT(*) FROM editor GROUP BY Age
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: Please show the most common age of editors.
SQL: SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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 distinct themes of journals.
SQL: SELECT DISTINCT Theme FROM journal
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: Show the names of editors and the theme of journals for which they serve on committees.
SQL: SELECT T2.Name ,  T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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: For each journal_committee, find the editor name and the journal theme.
SQL: SELECT T2.Name ,  T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme.
SQL: SELECT T2.Name ,  T2.age ,  T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID ORDER BY T3.Theme ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: Show the names of editors that are on the committee of journals with sales bigger than 3000.
SQL: SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID  =  T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID  =  T3.Journal_ID WHERE T3.Sales  >  3000
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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 id, name of each editor and the number of journal committees they are on.
SQL: SELECT T1.editor_id ,  T1.Name ,  COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID  =  T2.Editor_ID GROUP BY T1.editor_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: Show the names of editors that are on at least two journal committees.
SQL: SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID  =  T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: List the names of editors that are not on any journal committee.
SQL: SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee)
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', '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 date, theme and sales of the journal which did not have any of the listed editors serving on committee.
SQL: SELECT date ,  theme ,  sales FROM journal EXCEPT SELECT T1.date ,  T1.theme ,  T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID  =  T2.journal_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: journal 
columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']]

 -- Table: editor 
columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: journal committee 
columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']]

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



Question: What is the average sales of the journals that have an editor whose work type is 'Photo'?
SQL: SELECT avg(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID  =  T2.journal_ID WHERE T2.work_type  =  'Photo'
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', '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 accounts do we have?
SQL: SELECT count(*) FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

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



Question: Count the number of accounts.
SQL: SELECT count(*) FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', '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 ids, customer ids, names for all accounts.
SQL: SELECT account_id ,  customer_id ,  account_name FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', '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 account ids, customer ids, and account names for all the accounts?
SQL: SELECT account_id ,  customer_id ,  account_name FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', '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 other account details for account with name 338.
SQL: SELECT other_account_details FROM Accounts WHERE account_name  =  "338"
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', '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 other account details for the account with the name 338?
SQL: SELECT other_account_details FROM Accounts WHERE account_name  =  "338"
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', '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 first name, last name, and phone of the customer with account name 162?
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "162"