CREATE TABLE Ref_Document_Types (
    Document_Type_Code TEXT PRIMARY KEY,
    Document_Type_Name TEXT,
    Document_Type_Description TEXT
);
CREATE TABLE Ref_Budget_Codes (
    Budget_Type_Code TEXT PRIMARY KEY,
    Budget_Type_Description TEXT
);
CREATE TABLE Projects (
    Project_ID NUMBER PRIMARY KEY,
    Project_Details TEXT
);
CREATE TABLE Documents (
    Document_ID NUMBER PRIMARY KEY,
    Document_Type_Code TEXT,
    Project_ID NUMBER,
    Document_Date TIME,
    Document_Name TEXT,
    Document_Description TEXT,
    Other_Details TEXT,
    FOREIGN KEY ("Project_ID") REFERENCES Projects("Project_ID"),
    FOREIGN KEY ("Document_Type_Code") REFERENCES Ref_Document_Types("Document_Type_Code")
);
CREATE TABLE Statements (
    Statement_ID NUMBER PRIMARY KEY,
    Statement_Details TEXT,
    FOREIGN KEY ("Statement_ID") REFERENCES Documents("Document_ID")
);
CREATE TABLE Documents_with_Expenses (
    Document_ID NUMBER PRIMARY KEY,
    Budget_Type_Code TEXT,
    Document_Details TEXT,
    FOREIGN KEY ("Document_ID") REFERENCES Documents("Document_ID"),
    FOREIGN KEY ("Budget_Type_Code") REFERENCES Ref_Budget_Codes("Budget_Type_Code")
);
CREATE TABLE Accounts (
    Account_ID NUMBER PRIMARY KEY,
    Statement_ID NUMBER,
    Account_Details TEXT,
    FOREIGN KEY ("Statement_ID") REFERENCES Statements("Statement_ID")
);

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'

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'

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

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

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"

Question: Return the description of the document type name 'Film'.
SQL: SELECT document_type_description FROM Ref_document_types WHERE document_type_name  =  "Film"

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

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

Question: Show the number of projects.
SQL: SELECT count(*) FROM Projects

Question: How many projects are there?
SQL: SELECT count(*) FROM Projects

Question: List ids and details for all projects.
SQL: SELECT project_id ,  project_details FROM Projects

Question: What are the ids and details for each project?
SQL: SELECT project_id ,  project_details FROM Projects

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

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

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"

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"

Question: How many budget types do we have?
SQL: SELECT count(*) FROM Ref_budget_codes

Question: Count the number of budget codes.
SQL: SELECT count(*) FROM Ref_budget_codes

Question: List all budget type codes and descriptions.
SQL: SELECT budget_type_code ,  budget_type_description FROM Ref_budget_codes

Question: What are the type codes and descriptions of each budget type?
SQL: SELECT budget_type_code ,  budget_type_description FROM Ref_budget_codes

Question: What is the description for the budget type with code ORG?
SQL: SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code  =  "ORG"

Question: Return the description of the budget type that has the code ORG.
SQL: SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code  =  "ORG"

Question: How many documents have expenses?
SQL: SELECT count(*) FROM Documents_with_expenses

Question: Count the number of documents with expenses.
SQL: SELECT count(*) FROM Documents_with_expenses

Question: What are the document ids for the budget type code 'SF'?
SQL: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code  =  'SF'

Question: Give the ids of documents with expenses that have the budget code 'SF'.
SQL: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code  =  'SF'

Question: Show the budget type code and description and the corresponding document id.
SQL: SELECT T2.budget_type_code ,  T2.budget_type_description ,  T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code  =  T2.budget_type_code

Question: Return the budget type codes, budget type descriptions and document ids for documents with expenses.
SQL: SELECT T2.budget_type_code ,  T2.budget_type_description ,  T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code  =  T2.budget_type_code

Question: Show ids for all documents with budget types described as 'Government'.
SQL: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code  =  T2.Budget_Type_code WHERE T2.budget_type_Description  =  "Government"

Question: Give the ids for documents that have the budget description 'Government'.
SQL: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code  =  T2.Budget_Type_code WHERE T2.budget_type_Description  =  "Government"

Question: Show budget type codes and the number of documents in each budget type.
SQL: SELECT budget_type_code ,  count(*) FROM Documents_with_expenses GROUP BY budget_type_code

Question: What are the different budget type codes, and how many documents are there for each?
SQL: SELECT budget_type_code ,  count(*) FROM Documents_with_expenses GROUP BY budget_type_code

Question: What is the budget type code with most number of documents.
SQL: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1

Question: Give the budget type code that is most common among documents with expenses.
SQL: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1