brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
What are the average score and average staff number of all shops?
-- 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. Translate `What are the average score and average staff number of all shops?` to a syntactically-correct PostgreSQL query.
SELECT avg(num_of_staff) , avg(score) FROM shop
Find the id and address of the shops whose score is below the average score.
-- 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. Translate `Find the id and address of the shops whose score is below the average score.` to a syntactically-correct PostgreSQL query.
SELECT shop_id , address FROM shop WHERE score < (SELECT avg(score) FROM shop)
Find the address and staff number of the shops that do not have any 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. Translate `Find the address and staff number of the shops that do not have any happy hour.` to a syntactically-correct PostgreSQL query.
SELECT address , num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)
What are the id and address of the shops which have a happy hour in 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. Translate `What are the id and address of the shops which have a happy hour in May?` to a syntactically-correct PostgreSQL query.
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'
which shop has happy hour most frequently? List its id and number of happy hours.
-- 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. Translate `which shop has happy hour most frequently? List its id and number of happy hours.` to a syntactically-correct PostgreSQL query.
SELECT shop_id , count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1
Which month has the most happy hours?
-- 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. Translate `Which month has the most happy hours?` to a syntactically-correct PostgreSQL query.
SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1
Which months have more than 2 happy hours?
-- 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. Translate `Which months have more than 2 happy hours?` to a syntactically-correct PostgreSQL query.
SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*) > 2
How many albums are there?
-- 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. Translate `How many albums are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM ALBUM
Find the number of albums.
-- 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. Translate `Find the number of albums.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM ALBUM
List the names of all music genres.
-- 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. Translate `List the names of all music genres.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM GENRE
What are the names of different music genres?
-- 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. Translate `What are the names of different music genres?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM GENRE
Find all the customer information in 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. Translate `Find all the customer information in state NY.` to a syntactically-correct PostgreSQL query.
SELECT * FROM CUSTOMER WHERE State = "NY"
What is all the customer information for customers in NY state?
-- 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. Translate `What is all the customer information for customers in NY state?` to a syntactically-correct PostgreSQL query.
SELECT * FROM CUSTOMER WHERE State = "NY"
What are the first names and last names of the employees who live in Calgary city.
-- 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. Translate `What are the first names and last names of the employees who live in Calgary city.` to a syntactically-correct PostgreSQL query.
SELECT FirstName , LastName FROM EMPLOYEE WHERE City = "Calgary"
Find the full names of employees living in the city of 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. Translate `Find the full names of employees living in the city of Calgary.` to a syntactically-correct PostgreSQL query.
SELECT FirstName , LastName FROM EMPLOYEE WHERE City = "Calgary"
What are the distinct billing countries of the invoices?
-- 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. Translate `What are the distinct billing countries of the invoices?` to a syntactically-correct PostgreSQL query.
SELECT distinct(BillingCountry) FROM INVOICE
Find the different billing countries for all invoices.
-- 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. Translate `Find the different billing countries for all invoices.` to a syntactically-correct PostgreSQL query.
SELECT distinct(BillingCountry) FROM INVOICE
Find the names of all artists that have "a" in their names.
-- 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. Translate `Find the names of all artists that have "a" in their names.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
What are the names of artist who have the letter 'a' in their names?
-- 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. Translate `What are the names of artist who have the letter 'a' in their names?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
Find the title of all the albums of the artist "AC/DC".
-- 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. Translate `Find the title of all the albums of the artist "AC/DC".` to a syntactically-correct PostgreSQL query.
SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC"
What are the titles of albums by the artist "AC/DC"?
-- 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. Translate `What are the titles of albums by the artist "AC/DC"?` to a syntactically-correct PostgreSQL query.
SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC"
Hom many albums does the artist "Metallica" have?
-- 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. Translate `Hom many albums does the artist "Metallica" have?` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica"
Find the number of albums by the artist "Metallica".
-- 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. Translate `Find the number of albums by the artist "Metallica".` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica"
Which artist does the album "Balls to the Wall" belong to?
-- 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. Translate `Which artist does the album "Balls to the Wall" belong to?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = "Balls to the Wall"
Find the name of the artist who made the album "Balls to the Wall".
-- 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. Translate `Find the name of the artist who made the album "Balls to the Wall".` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = "Balls to the Wall"
Which artist has the most albums?
-- 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. Translate `Which artist has the most albums?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the artist with the greatest number of albums?
-- 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. Translate `What is the name of the artist with the greatest number of albums?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1
Find the names of all the tracks that contain the word "you".
-- 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. Translate `Find the names of all the tracks that contain the word "you".` to a syntactically-correct PostgreSQL query.
SELECT Name FROM TRACK WHERE Name LIKE '%you%'
What are the names of tracks that contain the the word you in them?
-- 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. Translate `What are the names of tracks that contain the the word you in them?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM TRACK WHERE Name LIKE '%you%'
What is the average unit price of all the tracks?
-- 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. Translate `What is the average unit price of all the tracks?` to a syntactically-correct PostgreSQL query.
SELECT AVG(UnitPrice) FROM TRACK
Find the average unit price for a track.
-- 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. Translate `Find the average unit price for a track.` to a syntactically-correct PostgreSQL query.
SELECT AVG(UnitPrice) FROM TRACK
What are the durations of the longest and the shortest tracks in milliseconds?
-- 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. Translate `What are the durations of the longest and the shortest tracks in milliseconds?` to a syntactically-correct PostgreSQL query.
SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK
Find the maximum and minimum durations of tracks in milliseconds.
-- 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. Translate `Find the maximum and minimum durations of tracks in milliseconds.` to a syntactically-correct PostgreSQL query.
SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK
Show the album names, ids and the number of tracks for each 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. Translate `Show the album names, ids and the number of tracks for each album.` to a syntactically-correct PostgreSQL query.
SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID
What are the names and ids of the different albums, and how many tracks are on each?
-- 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. Translate `What are the names and ids of the different albums, and how many tracks are on each?` to a syntactically-correct PostgreSQL query.
SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID
What is the name of the most common genre in all tracks?
-- 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. Translate `What is the name of the most common genre in all tracks?` to a syntactically-correct PostgreSQL query.
SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
Find the name of the genre that is most frequent across all tracks.
-- 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. Translate `Find the name of the genre that is most frequent across all tracks.` to a syntactically-correct PostgreSQL query.
SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
What is the least common media type in all tracks?
-- 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. Translate `What is the least common media type in all tracks?` to a syntactically-correct PostgreSQL query.
SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1
What is the name of the media type that is least common across all tracks?
-- 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. Translate `What is the name of the media type that is least common across all tracks?` to a syntactically-correct PostgreSQL query.
SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1
Show the album names and ids for albums that contain tracks with unit price bigger than 1.
-- 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. Translate `Show the album names and ids for albums that contain tracks with unit price bigger than 1.` to a syntactically-correct PostgreSQL query.
SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID
What are the titles and ids for albums containing tracks with unit price greater than 1?
-- 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. Translate `What are the titles and ids for albums containing tracks with unit price greater than 1?` to a syntactically-correct PostgreSQL query.
SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID
How many tracks belong to rock 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. Translate `How many tracks belong to rock genre?` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock"
Count the number of tracks that are part of the rock 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. Translate `Count the number of tracks that are part of the rock genre.` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock"
What is the average unit price of tracks that belong to Jazz 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. Translate `What is the average unit price of tracks that belong to Jazz genre?` to a syntactically-correct PostgreSQL query.
SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Jazz"
Find the average unit price of jazz tracks.
-- 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. Translate `Find the average unit price of jazz tracks.` to a syntactically-correct PostgreSQL query.
SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Jazz"
What is the first name and last name of the customer that has email "luisg@embraer.com.br"?
-- 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. Translate `What is the first name and last name of the customer that has email "luisg@embraer.com.br"?` to a syntactically-correct PostgreSQL query.
SELECT FirstName , LastName FROM CUSTOMER WHERE Email = "luisg@embraer.com.br"
Find the full name of the customer with the email "luisg@embraer.com.br".
-- 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. Translate `Find the full name of the customer with the email "luisg@embraer.com.br".` to a syntactically-correct PostgreSQL query.
SELECT FirstName , LastName FROM CUSTOMER WHERE Email = "luisg@embraer.com.br"
How many customers have email that contains "gmail.com"?
-- 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. Translate `How many customers have email that contains "gmail.com"?` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%"
Count the number of customers that have an email containing "gmail.com".
-- 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. Translate `Count the number of customers that have an email containing "gmail.com".` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%"
What is the first name and last name employee helps the customer with first name Leonie?
-- 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. Translate `What is the first name and last name employee helps the customer with first name Leonie?` to a syntactically-correct PostgreSQL query.
SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = "Leonie"
Find the full names of employees who help customers with the first name Leonie.
-- 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. Translate `Find the full names of employees who help customers with the first name Leonie.` to a syntactically-correct PostgreSQL query.
SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = "Leonie"
What city does the employee who helps the customer with postal code 70174 live in?
-- 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. Translate `What city does the employee who helps the customer with postal code 70174 live in?` to a syntactically-correct PostgreSQL query.
SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = "70174"
Find the cities corresponding to employees who help customers with the postal code 70174.
-- 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. Translate `Find the cities corresponding to employees who help customers with the postal code 70174.` to a syntactically-correct PostgreSQL query.
SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = "70174"
How many distinct cities does the employees live in?
-- 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. Translate `How many distinct cities does the employees live in?` to a syntactically-correct PostgreSQL query.
SELECT COUNT(DISTINCT city) FROM EMPLOYEE
Find the number of different cities that employees live in.
-- 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. Translate `Find the number of different cities that employees live in.` to a syntactically-correct PostgreSQL query.
SELECT COUNT(DISTINCT city) FROM EMPLOYEE
Find all invoice dates corresponding to customers with first name Astrid and last name Gruber.
-- 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. Translate `Find all invoice dates corresponding to customers with first name Astrid and last name Gruber.` to a syntactically-correct PostgreSQL query.
SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber"
What are the invoice dates for customers with the first name Astrid and the last name Gruber?
-- 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. Translate `What are the invoice dates for customers with the first name Astrid and the last name Gruber?` to a syntactically-correct PostgreSQL query.
SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber"
Find all the customer last names that do not have invoice totals larger than 20.
-- 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. Translate `Find all the customer last names that do not have invoice totals larger than 20.` to a syntactically-correct PostgreSQL query.
SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20
What are the last names of customers without invoice totals exceeding 20?
-- 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. Translate `What are the last names of customers without invoice totals exceeding 20?` to a syntactically-correct PostgreSQL query.
SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20
Find the first names of all customers that live in Brazil and have an 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. Translate `Find the first names of all customers that live in Brazil and have an invoice.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil"
What are the different first names for customers from Brazil who have also had an 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. Translate `What are the different first names for customers from Brazil who have also had an invoice?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil"
Find the address of all customers that live in Germany and have 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. Translate `Find the address of all customers that live in Germany and have invoice.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Germany"
What are the addresses of customers living in Germany who have had an 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. Translate `What are the addresses of customers living in Germany who have had an invoice?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Germany"
List the phone numbers of all employees.
-- 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. Translate `List the phone numbers of all employees.` to a syntactically-correct PostgreSQL query.
SELECT Phone FROM EMPLOYEE
What are the phone numbers for each employee?
-- 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. Translate `What are the phone numbers for each employee?` to a syntactically-correct PostgreSQL query.
SELECT Phone FROM EMPLOYEE
How many tracks are in the AAC audio file media type?
-- 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. Translate `How many tracks are in the AAC audio file media type?` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = "AAC audio file"
Count the number of tracks that are of the media type "AAC audio file".
-- 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. Translate `Count the number of tracks that are of the media type "AAC audio file".` to a syntactically-correct PostgreSQL query.
SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = "AAC audio file"
What is the average duration in milliseconds of tracks that belong to Latin or Pop 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. Translate `What is the average duration in milliseconds of tracks that belong to Latin or Pop genre?` to a syntactically-correct PostgreSQL query.
SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Latin" OR T1.Name = "Pop"
Find the average millisecond length of Latin and Pop tracks.
-- 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. Translate `Find the average millisecond length of Latin and Pop tracks.` to a syntactically-correct PostgreSQL query.
SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Latin" OR T1.Name = "Pop"
Please show the employee first names and ids of employees who serve at least 10 customers.
-- 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. Translate `Please show the employee first names and ids of employees who serve at least 10 customers.` to a syntactically-correct PostgreSQL query.
SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10
What are the first names and support rep ids for employees serving 10 or more customers?
-- 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. Translate `What are the first names and support rep ids for employees serving 10 or more customers?` to a syntactically-correct PostgreSQL query.
SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10
Please show the employee last names that serves no more than 20 customers.
-- 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. Translate `Please show the employee last names that serves no more than 20 customers.` to a syntactically-correct PostgreSQL query.
SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20
What are the last names of employees who serve at most 20 customers?
-- 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. Translate `What are the last names of employees who serve at most 20 customers?` to a syntactically-correct PostgreSQL query.
SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20
Please list all album titles in alphabetical order.
-- 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. Translate `Please list all album titles in alphabetical order.` to a syntactically-correct PostgreSQL query.
SELECT Title FROM ALBUM ORDER BY Title
What are all the album titles, in alphabetical order?
-- 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. Translate `What are all the album titles, in alphabetical order?` to a syntactically-correct PostgreSQL query.
SELECT Title FROM ALBUM ORDER BY Title
Please list the name and id of all artists that have at least 3 albums in alphabetical order.
-- 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. Translate `Please list the name and id of all artists that have at least 3 albums in alphabetical order.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name
What are the names and ids of artists with 3 or more albums, listed in alphabetical order?
-- 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. Translate `What are the names and ids of artists with 3 or more albums, listed in alphabetical order?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name
Find the names of artists that do not have any albums.
-- 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. Translate `Find the names of artists that do not have any albums.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId
What are the names of artists who have not released any albums?
-- 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. Translate `What are the names of artists who have not released any albums?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId
What is the average unit price of rock tracks?
-- 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. Translate `What is the average unit price of rock tracks?` to a syntactically-correct PostgreSQL query.
SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock"
Find the average unit price of tracks from the Rock 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. Translate `Find the average unit price of tracks from the Rock genre.` to a syntactically-correct PostgreSQL query.
SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock"
What are the duration of the longest and shortest pop tracks in milliseconds?
-- 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. Translate `What are the duration of the longest and shortest pop tracks in milliseconds?` to a syntactically-correct PostgreSQL query.
SELECT max(Milliseconds) , min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop"
Find the maximum and minimum millisecond lengths of pop tracks.
-- 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. Translate `Find the maximum and minimum millisecond lengths of pop tracks.` to a syntactically-correct PostgreSQL query.
SELECT max(Milliseconds) , min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop"
What are the birth dates of employees living in Edmonton?
-- 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. Translate `What are the birth dates of employees living in Edmonton?` to a syntactically-correct PostgreSQL query.
SELECT BirthDate FROM EMPLOYEE WHERE City = "Edmonton"
Find the birth dates corresponding to employees who live in the city of Edmonton.
-- 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. Translate `Find the birth dates corresponding to employees who live in the city of Edmonton.` to a syntactically-correct PostgreSQL query.
SELECT BirthDate FROM EMPLOYEE WHERE City = "Edmonton"
What are the distinct unit prices of all tracks?
-- 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. Translate `What are the distinct unit prices of all tracks?` to a syntactically-correct PostgreSQL query.
SELECT distinct(UnitPrice) FROM TRACK
Find the distinct unit prices for tracks.
-- 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. Translate `Find the distinct unit prices for tracks.` to a syntactically-correct PostgreSQL query.
SELECT distinct(UnitPrice) FROM TRACK
How many artists do not have any 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. Translate `How many artists do not have any album?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM)
Cound the number of artists who have not released an 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. Translate `Cound the number of artists who have not released an album.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM)
What are the album titles for albums containing both 'Reggae' and 'Rock' genre tracks?
-- 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. Translate `What are the album titles for albums containing both 'Reggae' and 'Rock' genre tracks?` to a syntactically-correct PostgreSQL query.
SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Reggae' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Rock'
Find the titles of albums that contain tracks of both the Reggae and Rock genres.
-- 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. Translate `Find the titles of albums that contain tracks of both the Reggae and Rock genres.` to a syntactically-correct PostgreSQL query.
SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Reggae' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Rock'
Find all the phone numbers.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `Find all the phone numbers.` to a syntactically-correct PostgreSQL query.
SELECT customer_phone FROM available_policies
What are all the phone numbers?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `What are all the phone numbers?` to a syntactically-correct PostgreSQL query.
SELECT customer_phone FROM available_policies
What are the customer phone numbers under the policy "Life Insurance"?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `What are the customer phone numbers under the policy "Life Insurance"?` to a syntactically-correct PostgreSQL query.
SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance"
What are the phone numbers of customers using the policy with the code "Life Insurance"?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `What are the phone numbers of customers using the policy with the code "Life Insurance"?` to a syntactically-correct PostgreSQL query.
SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance"
Which policy type has the most records in the database?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `Which policy type has the most records in the database?` to a syntactically-correct PostgreSQL query.
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1
Which policy type appears most frequently in the available policies?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `Which policy type appears most frequently in the available policies?` to a syntactically-correct PostgreSQL query.
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1
What are all the customer phone numbers under the most popular policy type?
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `What are all the customer phone numbers under the most popular policy type?` to a syntactically-correct PostgreSQL query.
SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)
Find the phone numbers of customers using the most common policy type among the available policies.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `Find the phone numbers of customers using the most common policy type among the available policies.` to a syntactically-correct PostgreSQL query.
SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)
Find the policy type used by more than 4 customers.
-- Language PostgreSQL -- Tables: -- Table: customers columns : [['customer id', 'number'], ['customer name', 'text']] -- Table: services columns : [['service id', 'number'], ['service name', 'text']] -- Table: available policies columns : [['policy id', 'number'], ['policy type code', 'text'], ['customer phone', 'text']] -- Table: customers policies columns : [['customer id', 'number'], ['policy id', 'number'], ['date opened', 'time'], ['date closed', 'time']] -- Table: first notification of loss columns : [['fnol id', 'number'], ['customer id', 'number'], ['policy id', 'number'], ['service id', 'number']] -- Table: claims columns : [['claim id', 'number'], ['fnol id', 'number'], ['effective date', 'time']] -- Table: settlements columns : [['settlement id', 'number'], ['claim id', 'number'], ['effective date', 'time'], ['settlement 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. Translate `Find the policy type used by more than 4 customers.` to a syntactically-correct PostgreSQL query.
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4