sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: What are the names and types of the companies that have ever operated a flight?
SQL: SELECT T1.name ,  T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: What are the names of the airports which are not in the country 'Iceland'?
SQL: SELECT name FROM airport WHERE country != 'Iceland'
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: What are the distinct types of the companies that have operated any flights with velocity less than 200?
SQL: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T2.velocity  <  200
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: What are the ids and names of the companies that operated more than one flight?
SQL: SELECT T1.id ,  T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id GROUP BY T1.id HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: What is the id, name and IATA code of the airport that had most number of flights?
SQL: SELECT T1.id ,  T1.name ,  T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id  =  T2.airport_id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?
SQL: SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id  =  T2.airport_id WHERE T1.country  =  'United States' OR T1.name  =  'Billund Airport'
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: What is the most common company type, and how many are there?
SQL: SELECT TYPE ,  count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: How many airports haven't the pilot 'Thompson' driven an aircraft?
SQL: SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot  =  'Thompson' );
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.
SQL: SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Catering services'
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: Which of the airport names contains the word 'international'?
SQL: SELECT name FROM airport WHERE name LIKE '%international%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: How many companies operates airlines in each airport?
SQL: SELECT T3.id ,  count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id JOIN airport AS T3 ON T2.airport_id  =  T3.id GROUP BY T3.id
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: how many airports are there in each country?
SQL: SELECT count(*) ,  country FROM airport GROUP BY country
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: which countries have more than 2 airports?
SQL: SELECT country FROM airport GROUP BY country HAVING count(*)  >  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: airport 
columns : [['id', 'number'], ['city', 'text'], ['country', 'text'], ['iata', 'text'], ['icao', 'text'], ['name', 'text']]

 -- Table: operate company 
columns : [['id', 'number'], ['name', 'text'], ['type', 'text'], ['principal activities', 'text'], ['incorporated in', 'text'], ['group equity shareholding', 'number']]

 -- Table: flight 
columns : [['id', 'number'], ['vehicle flight number', 'text'], ['date', 'text'], ['pilot', 'text'], ['velocity', 'number'], ['altitude', 'number'], ['airport id', 'number'], ['company 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.



Question: which pilot is in charge of the most number of flights?
SQL: SELECT pilot FROM flight GROUP BY pilot ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: How many accounts do we have?
SQL: SELECT count(*) FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Count the number of accounts.
SQL: SELECT count(*) FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Show all account ids and account details.
SQL: SELECT account_id ,  account_details FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the ids and details of all accounts?
SQL: SELECT account_id ,  account_details FROM Accounts
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: How many statements do we have?
SQL: SELECT count(*) FROM Statements
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Count the number of statements.
SQL: SELECT count(*) FROM Statements
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: List all statement ids and statement details.
SQL: SELECT STATEMENT_ID ,  statement_details FROM Statements
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the ids and details of all statements?
SQL: SELECT STATEMENT_ID ,  statement_details FROM Statements
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Show statement id, statement detail, account detail for accounts.
SQL: SELECT T1.statement_id ,  T2.statement_details ,  T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id  =  T2.statement_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the statement ids, statement details, and account details, for all accounts?
SQL: SELECT T1.statement_id ,  T2.statement_details ,  T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id  =  T2.statement_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Show all statement id and the number of accounts for each statement.
SQL: SELECT STATEMENT_ID ,  count(*) FROM Accounts GROUP BY STATEMENT_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the different statement ids on accounts, and the number of accounts for each?
SQL: SELECT STATEMENT_ID ,  count(*) FROM Accounts GROUP BY STATEMENT_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Show the statement id and the statement detail for the statement with most number of accounts.
SQL: SELECT T1.statement_id ,  T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id  =  T2.statement_id GROUP BY T1.statement_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the statement id and statement detail for the statement that has the most corresponding accounts?
SQL: SELECT T1.statement_id ,  T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id  =  T2.statement_id GROUP BY T1.statement_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Show the number of documents.
SQL: SELECT count(*) FROM Documents
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Count the number of documents.
SQL: SELECT count(*) FROM Documents
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
SQL: SELECT document_type_code ,  document_name ,  document_description FROM Documents WHERE document_name  =  'Noel CV' OR document_name  =  'King Book'
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the type come, name, and description of the document that has either the name 'Noel CV' or 'King Book'?
SQL: SELECT document_type_code ,  document_name ,  document_description FROM Documents WHERE document_name  =  'Noel CV' OR document_name  =  'King Book'
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Show the ids and names of all documents.
SQL: SELECT document_id ,  document_name FROM Documents
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the ids and names for each of the documents?
SQL: SELECT document_id ,  document_name FROM Documents
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: Find names and ids of all documents with document type code BK.
SQL: SELECT document_name ,  document_id FROM Documents WHERE document_type_code  =  "BK"
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference document types 
columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']]

 -- Table: reference budget codes 
columns : [['budget type code', 'text'], ['budget type description', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['project details', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['project id', 'number'], ['document date', 'time'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']]

 -- Table: statements 
columns : [['statement id', 'number'], ['statement details', 'text']]

 -- Table: documents with expenses 
columns : [['document id', 'number'], ['budget type code', 'text'], ['document details', 'text']]

 -- Table: accounts 
columns : [['account id', 'number'], ['statement id', 'number'], ['account 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.



Question: What are the names and ids of documents that have the type code BK?
SQL: SELECT document_name ,  document_id FROM Documents WHERE document_type_code  =  "BK"