Question: List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
Schema: create table ref_shipping_agents (document_id varchar, document_status_code varchar, document_type_code varchar, PRIMARY KEY (document_id)); create table documents (document_id varchar, document_status_code varchar, document_type_code varchar, PRIMARY KEY (document_id))
SQL: 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"