sert121/SpiderSQL huggingface dataset:
-- 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 documents are with document type code BK for each product id?
SQL: SELECT count(*) ,  project_id FROM Documents WHERE document_type_code  =  "BK" GROUP BY project_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: Count the number of documents with the type code BK that correspond to each product id.
SQL: SELECT count(*) ,  project_id FROM Documents WHERE document_type_code  =  "BK" GROUP BY project_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 document name and the document date for all documents on project with details 'Graph Database project'.
SQL: SELECT document_name ,  document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id  =  T2.project_id WHERE T2.project_details  =  'Graph Database project'
-- 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 dates for documents corresponding to project that has the details 'Graph Database project'?
SQL: SELECT document_name ,  document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id  =  T2.project_id WHERE T2.project_details  =  'Graph Database project'
-- 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 project ids and the number of documents in each project.
SQL: SELECT project_id ,  count(*) FROM Documents GROUP BY project_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: How many documents correspond with each project id?
SQL: SELECT project_id ,  count(*) FROM Documents GROUP BY project_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 is the id of the project with least number of documents?
SQL: SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC 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: Return the id of the project that has the fewest corresponding documents.
SQL: SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC 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 ids for projects with at least 2 documents.
SQL: SELECT project_id FROM Documents GROUP BY project_id HAVING count(*)  >=  2
-- 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 project ids of projects that have 2 or more corresponding documents?
SQL: SELECT project_id FROM Documents GROUP BY project_id HAVING count(*)  >=  2
-- 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 document type codes and the number of documents in each code.
SQL: SELECT document_type_code ,  count(*) FROM Documents GROUP BY document_type_code
-- 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 documents are there of each type?
SQL: SELECT document_type_code ,  count(*) FROM Documents GROUP BY document_type_code
-- 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 is the document type code with most number of documents?
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code 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: Return the code of the document type that is most common.
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code 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 document type code with fewer than 3 documents.
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*)  <  3
-- 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 codes corresponding to document types for which there are less than 3 documents?
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*)  <  3
-- 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 detail and the corresponding document name for the statement with detail 'Private Project'.
SQL: SELECT T1.statement_details ,  T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id  =  T2.document_id WHERE T1.statement_details  =  'Private Project'
-- 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 details for statements with the details 'Private Project', and what are the names of the corresponding documents?
SQL: SELECT T1.statement_details ,  T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id  =  T2.document_id WHERE T1.statement_details  =  'Private Project'
-- 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 document type codes, document type names, document type descriptions.
SQL: SELECT document_type_code ,  document_type_name ,  document_type_description FROM Ref_document_types
-- 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 codes, names, and descriptions of the different document types?
SQL: SELECT document_type_code ,  document_type_name ,  document_type_description FROM Ref_document_types
-- 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 is the document type description for document type named Film?
SQL: SELECT document_type_description FROM Ref_document_types WHERE document_type_name  =  "Film"
-- 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: Return the description of the document type name 'Film'.
SQL: SELECT document_type_description FROM Ref_document_types WHERE document_type_name  =  "Film"
-- 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 is the document type name and the document type description and creation date for all the documents?
SQL: SELECT T1.document_type_name ,  T1.document_type_description ,  T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code  =  T2.document_type_code
-- 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: Return the type name, type description, and date of creation for each document.
SQL: SELECT T1.document_type_name ,  T1.document_type_description ,  T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code  =  T2.document_type_code
-- 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 projects.
SQL: SELECT count(*) FROM Projects
-- 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 projects are there?
SQL: SELECT count(*) FROM Projects
-- 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 ids and details for all projects.
SQL: SELECT project_id ,  project_details FROM Projects
-- 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 for each project?
SQL: SELECT project_id ,  project_details FROM Projects
-- 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 is the project id and detail for the project with at least two documents?
SQL: SELECT T1.project_id ,  T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id HAVING count(*)  >  2
-- 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: Return the ids and details corresponding to projects for which there are more than two documents.
SQL: SELECT T1.project_id ,  T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id HAVING count(*)  >  2
-- 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 is the project detail for the project with document "King Book"?
SQL: SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id WHERE T2.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: Give the details of the project with the document name 'King Book'.
SQL: SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id WHERE T2.document_name  =  "King Book"