What are the ids of documents with letter 's' in the name with any expense budgets.
create table documents_with_expenses (document_id varchar, PRIMARY KEY (document_id)); create table documents (document_id varchar, document_name varchar, PRIMARY KEY (document_id))
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%'