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
Show all document ids with an expense budget.
assistant
SELECT document_id FROM Documents_with_expenses;
human
Show ids for all documents in type CV.
assistant
SELECT document_id FROM Documents WHERE document_type_code = 'CV';
human
Which of them don't have expense budgets?
assistant
SELECT document_id FROM Documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM Documents_with_expenses ;