Show me all the claims that are documents.
select t1.claim_header_id from claim_headers as t1 join claims_documents as t2 on t1.claim_header_id = t2.claim_id where t2.document_type_code = "Document"
Which of these claims is most recently created?
select t1.claim_header_id from claim_headers as t1 join claims_documents as t2 on t1.claim_header_id = t2.claim_id where t2.document_type_code = "Document" order by created_date limit 1
What is the amount claimed for this claim?
select t1.amount_claimed from claim_headers as t1 join claims_documents as t2 on t1.claim_header_id = t2.claim_id where t2.created_date = ( select created_date from claims_documents order by created_date limit 1 )
Please give me the sum of these amounts.
select sum ( t1.amount_claimed ) from claim_headers as t1 join claims_documents as t2 on t1.claim_header_id = t2.claim_id where t2.created_date = ( select created_date from claims_documents order by created_date limit 1 )