How many documents do not have any expense?
create table documents (document_id varchar, PRIMARY KEY (document_id)); create table documents_with_expenses (document_id varchar, PRIMARY KEY (document_id))
select count(*) from documents where not document_id in (select document_id from documents_with_expenses)