Show ids for all documents.
select document_id from documents
How about those with the letter 's' in the name?
select document_id from documents where document_name like '%s%'
Which of them have any expense budgets.
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%'