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: What are the ids of documents which don't have expense budgets?
SQL: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses

Question: Return the ids of documents that do not have expenses.
SQL: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses

Question: Show ids for all documents in type CV without expense budgets.
SQL: SELECT document_id FROM Documents WHERE document_type_code  =  "CV" EXCEPT SELECT document_id FROM Documents_with_expenses

Question: What are the ids of documents with the type code CV that do not have expenses.
SQL: SELECT document_id FROM Documents WHERE document_type_code  =  "CV" EXCEPT SELECT document_id FROM Documents_with_expenses

Question: What are the ids of documents with letter 's' in the name with any expense budgets.
SQL: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T1.document_name LIKE '%s%'

Question: Give the ids of documents that have expenses and contain the letter s in their names.
SQL: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T1.document_name LIKE '%s%'

Question: How many documents do not have any expense?
SQL: SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )

Question: Count the number of documents that do not have expenses.
SQL: SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )

Question: What are the dates for the documents with both 'GV' type and 'SF' type expenses?
SQL: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'SF'

Question: Give the dates of creation for documents that have both budget type codes 'GV' and 'SF'.
SQL: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'SF'

Question: What are the account details with the largest value or with value having char '5' in it?
SQL: SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"

Question: Return the account details with the greatest value, as well as those that include the character 5.
SQL: SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"