sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Return the number of companies created by Andy.
SQL: SELECT count(*) FROM manufacturers WHERE founder  =  'Andy'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the total revenue created by the companies whose headquarter is located at Austin.
SQL: SELECT sum(revenue) FROM manufacturers WHERE headquarter  =  'Austin'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 sum of revenue from companies with headquarters in Austin?
SQL: SELECT sum(revenue) FROM manufacturers WHERE headquarter  =  'Austin'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What are the different cities listed?
SQL: SELECT DISTINCT headquarter FROM manufacturers
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 the distinct headquarters of manufacturers.
SQL: SELECT DISTINCT headquarter FROM manufacturers
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 manufactures that are based in Tokyo or Beijing.
SQL: SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 manufacturers have headquarters in either Tokyo or Beijing?
SQL: SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 founder of the company whose name begins with the letter 'S'.
SQL: SELECT founder FROM manufacturers WHERE name LIKE 'S%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Who is the founders of companies whose first letter is S?
SQL: SELECT founder FROM manufacturers WHERE name LIKE 'S%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name of companies whose revenue is between 100 and 150.
SQL: SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 companies with revenue between 100 and 150?
SQL: SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What is the total revenue of all companies whose main office is at Tokyo or Taiwan?
SQL: SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Return the total revenue of companies with headquarters in Tokyo or Taiwan.
SQL: SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name of product that is produced by both companies Creative Labs and Sony.
SQL: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 products produced by both Creative Labs and Sony?
SQL: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name, headquarter and founder of the manufacturer that has the highest revenue.
SQL: SELECT name ,  headquarter ,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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, headquarters and founders of the company with the highest revenue?
SQL: SELECT name ,  headquarter ,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.
SQL: SELECT name ,  headquarter ,  revenue FROM manufacturers ORDER BY revenue DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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, headquarters and revenues for manufacturers, sorted by revenue descending?
SQL: SELECT name ,  headquarter ,  revenue FROM manufacturers ORDER BY revenue DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name of companies whose revenue is greater than the average revenue of all companies.
SQL: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 manufacturers with revenue greater than the average of all revenues?
SQL: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.
SQL: SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 companies with revenue less than the lowest revenue of any manufacturer in Austin?
SQL: SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.
SQL: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin?
SQL: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the total revenue of companies of each founder.
SQL: SELECT sum(revenue) ,  founder FROM manufacturers GROUP BY founder
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What is the total revenue of companies started by founder?
SQL: SELECT sum(revenue) ,  founder FROM manufacturers GROUP BY founder
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name and revenue of the company that earns the highest revenue in each city.
SQL: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What are the names and revenues of the companies with the highest revenues in each headquarter city?
SQL: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the total revenue for each manufacturer.
SQL: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What is the total revenue of each manufacturer?
SQL: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 average prices of all products from each manufacture, and list each company's name.
SQL: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 prices of products for each manufacturer?
SQL: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 different products that are produced by companies at different headquarter cities.
SQL: SELECT count(DISTINCT T1.name) ,  T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.Headquarter
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 different products are produced in each headquarter city?
SQL: SELECT count(DISTINCT T1.name) ,  T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.Headquarter
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find number of products which Sony does not make.
SQL: SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony')
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 products are not made by Sony?
SQL: SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony')
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: Find the name of companies that do not make DVD drive.
SQL: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 companies that do not make DVD drives?
SQL: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive'
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 products for each manufacturer, showing the name of each company.
SQL: SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 products are there for each manufacturer?
SQL: SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Select the names of all the products in the store.
SQL: SELECT Name FROM Products
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What are the names of all products?
SQL: SELECT Name FROM Products
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Select the names and the prices of all the products in the store.
SQL: SELECT name ,  price FROM products
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What are the names and prices of all products in the store?
SQL: SELECT name ,  price FROM products
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Select the name of the products with a price less than or equal to $200.
SQL: SELECT name FROM products WHERE price  <=  200
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 products with price at most 200?
SQL: SELECT name FROM products WHERE price  <=  200
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 information of all the products with a price between $60 and $120.
SQL: SELECT * FROM products WHERE price BETWEEN 60 AND 120
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 information of all the products that have a price between 60 and 120?
SQL: SELECT * FROM products WHERE price BETWEEN 60 AND 120
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Compute the average price of all the products.
SQL: SELECT avg(price) FROM products
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What is the average price across all products?
SQL: SELECT avg(price) FROM products
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Compute the average price of all products with manufacturer code equal to 2.
SQL: SELECT avg(price) FROM products WHERE Manufacturer  =  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What is the average price of products with manufacturer codes equal to 2?
SQL: SELECT avg(price) FROM products WHERE Manufacturer  =  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Compute the number of products with a price larger than or equal to $180.
SQL: SELECT count(*) FROM products WHERE price >= 180
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 products have prices of at least 180?
SQL: SELECT count(*) FROM products WHERE price >= 180
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name  (in ascending order).
SQL: SELECT name ,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]

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



Question: What are the names and prices of products that cost at least 180, sorted by price decreasing and name ascending?
SQL: SELECT name ,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Select all the data from the products and each product's manufacturer.
SQL: SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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 product data, as well as  each product's manufacturer?
SQL: SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code
-- Language PostgreSQL
        -- Tables: 
             -- Table: manufacturers 
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]

 -- Table: products 
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', '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: Select the average price of each manufacturer's products, showing only the manufacturer's code.
SQL: SELECT AVG(Price) ,  Manufacturer FROM Products GROUP BY Manufacturer