Context: CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)
Question: List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
Answer: SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"