Could you show me the IDs for all documents with budget types described as 'Government'?
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"
What are the document details of each of those?
select t1.document_details 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"
Could you show me the IDs for all documents with budget types described as 'Organisation'?
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 = "Organisation"
What are the budget type codes for those?
select t2.budget_type_code 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 = "Organisation"
Can you tell me the document details for the highest numbered document id please?
select document_details from documents_with_expenses order by document_id desc limit 1