sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 number of members living in each address.
SQL: SELECT count(*) ,  address FROM member GROUP BY address
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', 'number']]

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



Question: Give me the names of members whose address is in Harford or Waterbury.
SQL: SELECT name FROM member WHERE address  =  'Harford' OR address  =  'Waterbury'
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 ids and names of members who are under age 30 or with black membership card.
SQL: SELECT name ,  member_id FROM member WHERE Membership_card  =  'Black' OR age  <  30
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 purchase time, age and address of each member, and show the results in the order of purchase time.
SQL: SELECT Time_of_purchase ,  age ,  address FROM member ORDER BY Time_of_purchase
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 membership card has more than 5 members?
SQL: SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*)  >  5
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 address has both members younger than 30 and members older than 40?
SQL: SELECT address FROM member WHERE age  <  30 INTERSECT SELECT address FROM member WHERE age  >  40
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 membership card held by both members living in Hartford and ones living in Waterbury address?
SQL: SELECT membership_card FROM member WHERE address  =  'Hartford' INTERSECT SELECT membership_card FROM member WHERE address  =  'Waterbury'
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 members are not living in Hartford?
SQL: SELECT count(*) FROM member WHERE address != 'Hartford'
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 address do not have any member with the black membership card?
SQL: SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card  =  'Black'
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 shop addresses ordered by their opening year.
SQL: SELECT address FROM shop ORDER BY open_year
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', 'number']]

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



Question: What are the average score and average staff number of all shops?
SQL: SELECT avg(num_of_staff) ,  avg(score) FROM shop
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', 'number']]

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



Question: Find the id and address of the shops whose score is below the average score.
SQL: SELECT shop_id ,  address FROM shop WHERE score  <  (SELECT avg(score) FROM shop)
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 address and staff number of the shops that do not have any happy hour.
SQL: SELECT address ,  num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 id and address of the shops which have a happy hour in May?
SQL: SELECT t1.address ,  t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id  =  t2.shop_id WHERE MONTH  =  'May'
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 shop has happy hour most frequently? List its id and number of happy hours.
SQL: SELECT shop_id ,  count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 month has the most happy hours?
SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', '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 months have more than 2 happy hours?
SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*)  >  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 albums are there?
SQL: SELECT count(*) FROM ALBUM
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 number of albums.
SQL: SELECT count(*) FROM ALBUM
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

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

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



Question: List the names of all music genres.
SQL: SELECT Name FROM GENRE
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 different music genres?
SQL: SELECT Name FROM GENRE
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 all the customer information in state NY.
SQL: SELECT * FROM CUSTOMER WHERE State  =  "NY"
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 all the customer information for customers in NY state?
SQL: SELECT * FROM CUSTOMER WHERE State  =  "NY"
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 first names and last names of the employees who live in Calgary city.
SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "Calgary"
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 full names of employees living in the city of Calgary.
SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "Calgary"
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 distinct billing countries of the invoices?
SQL: SELECT distinct(BillingCountry) FROM INVOICE
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 different billing countries for all invoices.
SQL: SELECT distinct(BillingCountry) FROM INVOICE
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

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

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



Question: Find the names of all artists that have "a" in their names.
SQL: SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: album 
columns : [['album id', 'number'], ['title', 'text'], ['artist id', 'number']]

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

 -- Table: customer 
columns : [['customer 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 representative id', 'number']]

 -- Table: employee 
columns : [['employee 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: genre 
columns : [['genre id', 'number'], ['name', 'text']]

 -- Table: invoice 
columns : [['invoice 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: invoice line 
columns : [['invoice line id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']]

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

 -- Table: playlist 
columns : [['play list id', 'number'], ['name', 'text']]

 -- Table: playlist track 
columns : [['play list id', 'number'], ['track id', 'number']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', '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 artist who have the letter 'a' in their names?
SQL: SELECT Name FROM ARTIST WHERE Name LIKE "%a%"