brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
What si the youngest employee's first and last name?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What si the youngest employee's first and last name?` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;
List top 10 employee work longest in the company. List employee's first and last name.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List top 10 employee work longest in the company. List employee's first and last name.` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;
What are the first and last names of the top 10 longest-serving employees?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the first and last names of the top 10 longest-serving employees?` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;
Find the number of employees whose title is IT Staff from each city?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Find the number of employees whose title is IT Staff from each city?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city
How many employees who are IT staff are from each city?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many employees who are IT staff are from each city?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city
Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee.` to a syntactically-correct PostgreSQL query.
SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;
What are the first and last names of all the employees and how many people report to them?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the first and last names of all the employees and how many people report to them?` to a syntactically-correct PostgreSQL query.
SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;
How many orders does Lucas Mancini has?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many orders does Lucas Mancini has?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini";
How many orders does Luca Mancini have in his invoices?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many orders does Luca Mancini have in his invoices?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini";
What is the total amount of money spent by Lucas Mancini?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the total amount of money spent by Lucas Mancini?` to a syntactically-correct PostgreSQL query.
SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini";
How much money did Lucas Mancini spend?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How much money did Lucas Mancini spend?` to a syntactically-correct PostgreSQL query.
SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini";
List all media types.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List all media types.` to a syntactically-correct PostgreSQL query.
SELECT name FROM media_types;
What are the names of all the media types?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all the media types?` to a syntactically-correct PostgreSQL query.
SELECT name FROM media_types;
List all different genre types.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List all different genre types.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT name FROM genres;
What are the different names of the genres?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the different names of the genres?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT name FROM genres;
List the name of all playlist.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the name of all playlist.` to a syntactically-correct PostgreSQL query.
SELECT name FROM playlists;
What are the names of all the playlists?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all the playlists?` to a syntactically-correct PostgreSQL query.
SELECT name FROM playlists;
Who is the composer of track Fast As a Shark?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Who is the composer of track Fast As a Shark?` to a syntactically-correct PostgreSQL query.
SELECT composer FROM tracks WHERE name = "Fast As a Shark";
What is the composer who created the track "Fast As a Shark"?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the composer who created the track "Fast As a Shark"?` to a syntactically-correct PostgreSQL query.
SELECT composer FROM tracks WHERE name = "Fast As a Shark";
How long does track Fast As a Shark has?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How long does track Fast As a Shark has?` to a syntactically-correct PostgreSQL query.
SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark";
How many milliseconds long is Fast As a Shark?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many milliseconds long is Fast As a Shark?` to a syntactically-correct PostgreSQL query.
SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark";
What is the name of tracks whose genre is Rock?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the name of tracks whose genre is Rock?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock";
What is the name of all tracks in the Rock genre?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the name of all tracks in the Rock genre?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock";
What is title of album which track Balls to the Wall belongs to?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is title of album which track Balls to the Wall belongs to?` to a syntactically-correct PostgreSQL query.
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall";
What is the name of the album that has the track Ball to the Wall?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the name of the album that has the track Ball to the Wall?` to a syntactically-correct PostgreSQL query.
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall";
List name of all tracks in Balls to the Wall.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List name of all tracks in Balls to the Wall.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall";
What is the name of all tracks in the album named Balls to the Wall?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the name of all tracks in the album named Balls to the Wall?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall";
List title of albums have the number of tracks greater than 10.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List title of albums have the number of tracks greater than 10.` to a syntactically-correct PostgreSQL query.
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10;
What are the names of the albums that have more than 10 tracks?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of the albums that have more than 10 tracks?` to a syntactically-correct PostgreSQL query.
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10;
List the name of tracks belongs to genre Rock and whose media type is MPEG audio file.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the name of tracks belongs to genre Rock and whose media type is MPEG audio file.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file";
What are the names of all Rock tracks that are stored on MPEG audio files?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all Rock tracks that are stored on MPEG audio files?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file";
List the name of tracks belongs to genre Rock or media type is MPEG audio file.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the name of tracks belongs to genre Rock or media type is MPEG audio file.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file";
What are the names of all tracks that belong to the Rock genre and whose media type is MPEG?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all tracks that belong to the Rock genre and whose media type is MPEG?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file";
List the name of tracks belongs to genre Rock or genre Jazz.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the name of tracks belongs to genre Rock or genre Jazz.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz"
What are the names of the tracks that are Rock or Jazz songs?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of the tracks that are Rock or Jazz songs?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz"
List the name of all tracks in the playlists of Movies.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the name of all tracks in the playlists of Movies.` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies";
What are the names of all tracks that are on playlists titled Movies?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all tracks that are on playlists titled Movies?` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies";
List the name of playlist which has number of tracks greater than 100.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the name of playlist which has number of tracks greater than 100.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100;
What are the names of all playlists that have more than 100 tracks?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all playlists that have more than 100 tracks?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100;
List all tracks bought by customer Daan Peeters.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List all tracks bought by customer Daan Peeters.` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters";
What are the tracks that Dean Peeters bought?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the tracks that Dean Peeters bought?` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters";
How much is the track Fast As a Shark?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How much is the track Fast As a Shark?` to a syntactically-correct PostgreSQL query.
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark";
What is the unit price of the tune "Fast As a Shark"?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the unit price of the tune "Fast As a Shark"?` to a syntactically-correct PostgreSQL query.
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark";
Find the name of tracks which are in Movies playlist but not in music playlist.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Find the name of tracks which are in Movies playlist but not in music playlist.` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'
What are the names of all tracks that are on the Movies playlist but not in the music playlist?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all tracks that are on the Movies playlist but not in the music playlist?` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'
Find the name of tracks which are in both Movies and music playlists.
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Find the name of tracks which are in both Movies and music playlists.` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'
What are the names of all the tracks that are in both the Movies and music playlists?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of all the tracks that are in both the Movies and music playlists?` to a syntactically-correct PostgreSQL query.
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'
Find number of tracks in each genre?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Find number of tracks in each genre?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;
How many tracks are in each genre?
-- Language PostgreSQL -- Tables: -- Table: sqlite sequence columns : [['name', 'number'], ['seq', 'text']] -- Table: artists columns : [['id', 'text'], ['name', 'text']] -- Table: albums columns : [['id', 'number'], ['title', 'text'], ['artist id', 'number']] -- Table: employees columns : [['id', 'number'], ['last name', 'text'], ['first name', 'text'], ['title', 'text'], ['reports to', 'number'], ['birth date', 'time'], ['hire date', 'time'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text']] -- Table: customers columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text'], ['company', 'text'], ['address', 'text'], ['city', 'text'], ['state', 'text'], ['country', 'text'], ['postal code', 'text'], ['phone', 'text'], ['fax', 'text'], ['email', 'text'], ['support rep id', 'number']] -- Table: genres columns : [['id', 'number'], ['name', 'text']] -- Table: invoices columns : [['id', 'number'], ['customer id', 'number'], ['invoice date', 'time'], ['billing address', 'text'], ['billing city', 'text'], ['billing state', 'text'], ['billing country', 'text'], ['billing postal code', 'text'], ['total', 'number']] -- Table: media types columns : [['id', 'number'], ['name', 'text']] -- Table: tracks columns : [['id', 'number'], ['name', 'text'], ['album id', 'number'], ['media type id', 'number'], ['genre id', 'number'], ['composer', 'text'], ['milliseconds', 'number'], ['bytes', 'number'], ['unit price', 'number']] -- Table: invoice lines columns : [['id', 'number'], ['invoice id', 'number'], ['track id', 'number'], ['unit price', 'number'], ['quantity', 'number']] -- Table: playlists columns : [['id', 'number'], ['name', 'text']] -- Table: playlist tracks columns : [['playlist id', 'number'], ['track id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many tracks are in each genre?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;
How many editors are there?
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many editors are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM editor
List the names of editors in ascending order of age.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the names of editors in ascending order of age.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM editor ORDER BY Age ASC
What are the names and ages of editors?
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names and ages of editors?` to a syntactically-correct PostgreSQL query.
SELECT Name , Age FROM editor
List the names of editors who are older than 25.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the names of editors who are older than 25.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM editor WHERE Age > 25
Show the names of editors of age either 24 or 25.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the names of editors of age either 24 or 25.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM editor WHERE Age = 24 OR Age = 25
What is the name of the youngest editor?
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the name of the youngest editor?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM editor ORDER BY Age ASC LIMIT 1
What are the different ages of editors? Show each age along with the number of editors of that age.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the different ages of editors? Show each age along with the number of editors of that age.` to a syntactically-correct PostgreSQL query.
SELECT Age , COUNT(*) FROM editor GROUP BY Age
Please show the most common age of editors.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Please show the most common age of editors.` to a syntactically-correct PostgreSQL query.
SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1
Show the distinct themes of journals.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the distinct themes of journals.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Theme FROM journal
Show the names of editors and the theme of journals for which they serve on committees.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the names of editors and the theme of journals for which they serve on committees.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID
For each journal_committee, find the editor name and the journal theme.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `For each journal_committee, find the editor name and the journal theme.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID
Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T2.age , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme ASC
Show the names of editors that are on the committee of journals with sales bigger than 3000.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the names of editors that are on the committee of journals with sales bigger than 3000.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000
Show the id, name of each editor and the number of journal committees they are on.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the id, name of each editor and the number of journal committees they are on.` to a syntactically-correct PostgreSQL query.
SELECT T1.editor_id , T1.Name , COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.editor_id
Show the names of editors that are on at least two journal committees.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the names of editors that are on at least two journal committees.` to a syntactically-correct PostgreSQL query.
SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2
List the names of editors that are not on any journal committee.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the names of editors that are not on any journal committee.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee)
List the date, theme and sales of the journal which did not have any of the listed editors serving on committee.
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the date, theme and sales of the journal which did not have any of the listed editors serving on committee.` to a syntactically-correct PostgreSQL query.
SELECT date , theme , sales FROM journal EXCEPT SELECT T1.date , T1.theme , T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID
What is the average sales of the journals that have an editor whose work type is 'Photo'?
-- Language PostgreSQL -- Tables: -- Table: journal columns : [['journal id', 'number'], ['date', 'text'], ['theme', 'text'], ['sales', 'number']] -- Table: editor columns : [['editor id', 'number'], ['name', 'text'], ['age', 'number']] -- Table: journal committee columns : [['editor id', 'number'], ['journal id', 'number'], ['work type', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the average sales of the journals that have an editor whose work type is 'Photo'?` to a syntactically-correct PostgreSQL query.
SELECT avg(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo'
How many accounts do we have?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many accounts do we have?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Accounts
Count the number of accounts.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Count the number of accounts.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Accounts
Show ids, customer ids, names for all accounts.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show ids, customer ids, names for all accounts.` to a syntactically-correct PostgreSQL query.
SELECT account_id , customer_id , account_name FROM Accounts
What are the account ids, customer ids, and account names for all the accounts?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the account ids, customer ids, and account names for all the accounts?` to a syntactically-correct PostgreSQL query.
SELECT account_id , customer_id , account_name FROM Accounts
Show other account details for account with name 338.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show other account details for account with name 338.` to a syntactically-correct PostgreSQL query.
SELECT other_account_details FROM Accounts WHERE account_name = "338"
What are the other account details for the account with the name 338?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the other account details for the account with the name 338?` to a syntactically-correct PostgreSQL query.
SELECT other_account_details FROM Accounts WHERE account_name = "338"
What is the first name, last name, and phone of the customer with account name 162?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the first name, last name, and phone of the customer with account name 162?` to a syntactically-correct PostgreSQL query.
SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "162"
Give the full name and phone of the customer who has the account name 162.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Give the full name and phone of the customer who has the account name 162.` to a syntactically-correct PostgreSQL query.
SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "162"
How many accounts does the customer with first name Art and last name Turcotte have?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many accounts does the customer with first name Art and last name Turcotte have?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte"
Return the number of accounts that the customer with the first name Art and last name Turcotte has.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Return the number of accounts that the customer with the first name Art and last name Turcotte has.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte"
Show all customer ids and the number of accounts for each customer.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show all customer ids and the number of accounts for each customer.` to a syntactically-correct PostgreSQL query.
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id
How many accounts are there for each customer id?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many accounts are there for each customer id?` to a syntactically-correct PostgreSQL query.
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id
Show the customer id and number of accounts with most accounts.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the customer id and number of accounts with most accounts.` to a syntactically-correct PostgreSQL query.
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
What is the customer id of the customer with the most accounts, and how many accounts does this person have?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the customer id of the customer with the most accounts, and how many accounts does this person have?` to a syntactically-correct PostgreSQL query.
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
What is the customer first, last name and id with least number of accounts.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the customer first, last name and id with least number of accounts.` to a syntactically-correct PostgreSQL query.
SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
Give the full name and customer id of the customer with the fewest accounts.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Give the full name and customer id of the customer with the fewest accounts.` to a syntactically-correct PostgreSQL query.
SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
Show the number of all customers without an account.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the number of all customers without an account.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
How many customers do not have an account?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customers do not have an account?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
Show the first names and last names of customers without any account.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the first names and last names of customers without any account.` to a syntactically-correct PostgreSQL query.
SELECT customer_first_name , customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id
What are the full names of customers who do not have any accounts?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the full names of customers who do not have any accounts?` to a syntactically-correct PostgreSQL query.
SELECT customer_first_name , customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id
Show distinct first and last names for all customers with an account.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show distinct first and last names for all customers with an account.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id
What are the full names of customers who have accounts?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the full names of customers who have accounts?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id
How many customers have an account?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customers have an account?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT customer_id) FROM Accounts
Count the number of customers who hold an account.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Count the number of customers who hold an account.` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT customer_id) FROM Accounts
How many customers do we have?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customers do we have?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers
Count the number of customers.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Count the number of customers.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers
Show ids, first names, last names, and phones for all customers.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show ids, first names, last names, and phones for all customers.` to a syntactically-correct PostgreSQL query.
SELECT customer_id , customer_first_name , customer_last_name , customer_phone FROM Customers
What are the ids, full names, and phones of each customer?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the ids, full names, and phones of each customer?` to a syntactically-correct PostgreSQL query.
SELECT customer_id , customer_first_name , customer_last_name , customer_phone FROM Customers
What is the phone and email for customer with first name Aniyah and last name Feest?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the phone and email for customer with first name Aniyah and last name Feest?` to a syntactically-correct PostgreSQL query.
SELECT customer_phone , customer_email FROM Customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest"
Return the phone and email of the customer with the first name Aniyah and last name Feest.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Return the phone and email of the customer with the first name Aniyah and last name Feest.` to a syntactically-correct PostgreSQL query.
SELECT customer_phone , customer_email FROM Customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest"
Show the number of customer cards.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the number of customer cards.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers_cards
How many customer cards are there?
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customer cards are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers_cards
Show ids, customer ids, card type codes, card numbers for all cards.
-- Language PostgreSQL -- Tables: -- Table: accounts columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']] -- Table: customers cards columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']] -- Table: financial transactions columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show ids, customer ids, card type codes, card numbers for all cards.` to a syntactically-correct PostgreSQL query.
SELECT card_id , customer_id , card_type_code , card_number FROM Customers_cards