human
Schema:
Ref_Document_Types (Document_Type_Code, Document_Type_Name, Document_Type_Description)
Ref_Budget_Codes (Budget_Type_Code, Budget_Type_Description)
Projects (Project_ID, Project_Details)
Documents (Document_ID, Document_Type_Code, Project_ID, Document_Date, Document_Name, Document_Description, Other_Details)
Statements (Statement_ID, Statement_Details)
Documents_with_Expenses (Document_ID, Budget_Type_Code, Document_Details)
Accounts (Account_ID, Statement_ID, Account_Details)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the document type name and the document type description and creation date for all the documents?
assistant
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
human
Show the budget type code and description and the corresponding document id.
assistant
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
human
Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.
assistant
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'
human
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
assistant
SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
human
Show all document type codes, document type names, document type descriptions.
assistant
SELECT document_type_code , document_type_name , document_type_description FROM Ref_document_types
human
Return the description of the document type name 'Film'.
assistant
SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film" ;