sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 software platform that is most common amongst all devices?
SQL: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', 'number']]

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



Question: List the names of shops that have no devices in stock.
SQL: SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops that do not have any devices in stock?
SQL: SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 the locations shared by shops with open year later than 2012 and shops with open year before 2008.
SQL: SELECT LOCATION FROM shop WHERE Open_Year  >  2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year  <  2008
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 locations contains both shops that opened after the year 2012 and shops that opened before 2008?
SQL: SELECT LOCATION FROM shop WHERE Open_Year  >  2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year  <  2008
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices that have no devices in stock.
SQL: SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices that are not in stock anywhere?
SQL: SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 the carriers of devices in stock at more than one shop.
SQL: SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID  =  T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: device 
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]

 -- Table: shop 
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]

 -- Table: stock 
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices that are in stock in more than a single shop?
SQL: SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID  =  T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 bands are there?
SQL: SELECT count(*) FROM Band
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Find the number of bands.
SQL: SELECT count(*) FROM Band
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 all the labels?
SQL: SELECT DISTINCT label FROM Albums
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 album labels listed?
SQL: SELECT DISTINCT label FROM Albums
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Find all the albums in 2012.
SQL: SELECT * FROM Albums WHERE YEAR  =  2012
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: return all columns of the albums created in the year of 2012.
SQL: SELECT * FROM Albums WHERE YEAR  =  2012
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Find all the stage positions of the musicians with first name "Solveig"
SQL: SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id WHERE Firstname  =  "Solveig"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 stage positions for all musicians whose first name is "Solveig"?
SQL: SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id WHERE Firstname  =  "Solveig"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 songs are there?
SQL: SELECT count(*) FROM Songs
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Count the number of songs.
SQL: SELECT count(*) FROM Songs
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Find all the songs performed by artist with last name "Heilo"
SQL: SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T2.Lastname  =  "Heilo"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 of the songs by the artist whose last name is "Heilo"?
SQL: SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T2.Lastname  =  "Heilo"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Hom many musicians performed in the song "Flash"?
SQL: SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate  =  T2.id JOIN songs AS T3 ON T3.songid  =  T1.songid WHERE T3.Title  =  "Flash"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 musicians play in the song "Flash"?
SQL: SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate  =  T2.id JOIN songs AS T3 ON T3.songid  =  T1.songid WHERE T3.Title  =  "Flash"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Find all the songs produced by artists with first name "Marianne".
SQL: SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T2.firstname  =  "Marianne"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 of all songs produced by the artist with the first name "Marianne"?
SQL: SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T2.firstname  =  "Marianne"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Who performed the song named "Badlands"? Show the first name and the last name.
SQL: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Badlands"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 first and last names of the artist who perfomed the song "Badlands"?
SQL: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Badlands"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name.
SQL: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Badlands" AND T1.StagePosition  =  "back"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 first and last names of the performer who was in the back stage position for the song "Badlands"?
SQL: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Badlands" AND T1.StagePosition  =  "back"
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 unique labels are there for albums?
SQL: SELECT count(DISTINCT label) FROM albums
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 unique labels for the albums?
SQL: SELECT count(DISTINCT label) FROM albums
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 label that has the most albums?
SQL: SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 label with the most albums?
SQL: SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 last name of the musician that have produced the most number of songs?
SQL: SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 last name of the musician who was in the most songs?
SQL: SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 last name of the musician that has been at the back position the most?
SQL: SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id WHERE stageposition  =  "back" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 last name of the musicians who has played back position the most?
SQL: SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id WHERE stageposition  =  "back" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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: Find all the songs whose name contains the word "the".
SQL: SELECT title FROM songs WHERE title LIKE '% the %'
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 of the songs whose title has the word "the"?
SQL: SELECT title FROM songs WHERE title LIKE '% the %'
-- Language PostgreSQL
        -- Tables: 
             -- Table: songs 
columns : [['song id', 'number'], ['title', 'text']]

 -- Table: albums 
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]

 -- Table: band 
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]

 -- Table: instruments 
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]

 -- Table: performance 
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]

 -- Table: track lists 
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]

 -- Table: vocals 
columns : [['song id', 'number'], ['bandmate', 'number'], ['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 all the instruments used?
SQL: SELECT DISTINCT instrument FROM Instruments