richardr1126/spider-context-instruct huggingface dataset:
### Instruction:

Convert text to sql: List all document ids and receipt dates of documents. | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select document_id , receipt_date from documents
### Instruction:

Convert text to sql: How many employees does each role have? List role description, id and number of employees. | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select roles.role_description , employees.role_code , count ( * ) from roles join employees on roles.role_code = employees.role_code group by employees.role_code
### Instruction:

Convert text to sql: List roles that have more than one employee. List the role description and number of employees. | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select roles.role_description , count ( employees.employee_id ) from roles join employees on employees.role_code = roles.role_code group by employees.role_code having count ( employees.employee_id ) > 1
### Instruction:

Convert text to sql: What is the document status description of the document with id 1? | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select ref_document_status.document_status_description from ref_document_status join documents on documents.document_status_code = ref_document_status.document_status_code where documents.document_id = 1
### Instruction:

Convert text to sql: How many documents have the status code done? | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select count ( * ) from documents where document_status_code = 'done'
### Instruction:

Convert text to sql: List the document type code for the document with the id 2. | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select document_type_code from documents where document_id = 2
### Instruction:

Convert text to sql: List the document ids for any documents with the status code done and the type code paper. | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select document_id from documents where document_status_code = 'done' and document_type_code = 'Paper'
### Instruction:

Convert text to sql: What is the name of the shipping agent of the document with id 2? | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select ref_shipping_agents.shipping_agent_name from ref_shipping_agents join documents on documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code where documents.document_id = 2
### Instruction:

Convert text to sql: How many documents were shipped by USPS? | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select count ( * ) from ref_shipping_agents join documents on documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code where ref_shipping_agents.shipping_agent_name = 'USPS'
### Instruction:

Convert text to sql: Which shipping agent shipped the most documents? List the shipping agent name and the number of documents. | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select ref_shipping_agents.shipping_agent_name , count ( documents.document_id ) from ref_shipping_agents join documents on documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code group by ref_shipping_agents.shipping_agent_code order by count ( documents.document_id ) desc limit 1
### Instruction:

Convert text to sql: What is the receipt date of the document with id 3? | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select receipt_date from documents where document_id = 3
### Instruction:

Convert text to sql: What address was the document with id 4 mailed to? | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select addresses.address_details from addresses join documents_mailed on documents_mailed.mailed_to_address_id = addresses.address_id where document_id = 4
### Instruction:

Convert text to sql: What is the mail date of the document with id 7? | ref_document_types : document_type_code , document_type_description | roles : role_code , role_description | addresses : address_id , address_details | ref_document_status : document_status_code , document_status_description | ref_shipping_agents : shipping_agent_code , shipping_agent_name , shipping_agent_description | documents : document_id , document_status_code , document_type_code , shipping_agent_code , receipt_date , receipt_number , other_details | employees : employee_id , role_code , employee_name , other_details | document_drafts : document_id , draft_number , draft_details | draft_copies : document_id , draft_number , copy_number | circulation_history : document_id , draft_number , copy_number , employee_id | documents_mailed : document_id , mailed_to_address_id , mailing_date | documents.shipping_agent_code = ref_shipping_agents.shipping_agent_code | documents.document_status_code = ref_document_status.document_status_code | documents.document_type_code = ref_document_types.document_type_code | employees.role_code = roles.role_code | document_drafts.document_id = documents.document_id | draft_copies.document_id = document_drafts.document_id | draft_copies.draft_number = document_drafts.draft_number | circulation_history.employee_id = employees.employee_id | circulation_history.document_id = draft_copies.document_id | circulation_history.draft_number = draft_copies.draft_number | circulation_history.copy_number = draft_copies.copy_number | documents_mailed.mailed_to_address_id = addresses.address_id | documents_mailed.document_id = documents.document_id | 

### Response:

select mailing_date from documents_mailed where document_id = 7