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

Convert text to sql: What is the total amount of grant money for research? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select sum ( grant_amount ) from grants join organisations on grants.organisation_id = organisations.organisation_id join organisation_types on organisations.organisation_type = organisation_types.organisation_type where organisation_types.organisation_type_description = 'Research'
### Instruction:

Convert text to sql: List from which date and to which date these staff work: project staff of the project which hires the most staffs | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select date_from , date_to from project_staff where project_id in ( select project_id from project_staff group by project_id order by count ( * ) desc limit 1 ) union select date_from , date_to from project_staff where role_code = 'leader'
### Instruction:

Convert text to sql: From what date and to what date do the staff work on a project that has the most staff and has staff in a leader role? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select date_from , date_to from project_staff where project_id in ( select project_id from project_staff group by project_id order by count ( * ) desc limit 1 ) union select date_from , date_to from project_staff where role_code = 'leader'
### Instruction:

Convert text to sql: Find the organisation ids and details of the organisations which are involved in | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select organisations.organisation_id , organisations.organisation_details from grants join organisations on grants.organisation_id = organisations.organisation_id group by organisations.organisation_id having sum ( grants.grant_amount ) > 6000
### Instruction:

Convert text to sql: What are the ids and details for all organizations that have grants of more than 6000 dollars? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select organisations.organisation_id , organisations.organisation_details from grants join organisations on grants.organisation_id = organisations.organisation_id group by organisations.organisation_id having sum ( grants.grant_amount ) > 6000
### Instruction:

Convert text to sql: What is the organisation type and id of the organisation which has the most number of research staff? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select organisations.organisation_type , organisations.organisation_id from organisations join research_staff on organisations.organisation_id = research_staff.employer_organisation_id group by organisations.organisation_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What is the type and id of the organization that has the most research staff? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select organisations.organisation_type , organisations.organisation_id from organisations join research_staff on organisations.organisation_id = research_staff.employer_organisation_id group by organisations.organisation_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Which organisation type hires most research staff? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select organisations.organisation_type from organisations join research_staff on organisations.organisation_id = research_staff.employer_organisation_id group by organisations.organisation_type order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What is the type of the organization with the most research staff? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select organisations.organisation_type from organisations join research_staff on organisations.organisation_id = research_staff.employer_organisation_id group by organisations.organisation_type order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select documents.sent_date from documents join grants on documents.grant_id = grants.grant_id join organisations on grants.organisation_id = organisations.organisation_id join organisation_types on organisations.organisation_type = organisation_types.organisation_type where grants.grant_amount > 5000 and organisation_types.organisation_type_description = 'Research'
### Instruction:

Convert text to sql: What are the send dates for all documents that have a grant amount of more than 5000 and are involved in research? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select documents.sent_date from documents join grants on documents.grant_id = grants.grant_id join organisations on grants.organisation_id = organisations.organisation_id join organisation_types on organisations.organisation_type = organisation_types.organisation_type where grants.grant_amount > 5000 and organisation_types.organisation_type_description = 'Research'
### Instruction:

Convert text to sql: What are the response received dates for the documents described as 'Regular' or granted with more than 100? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select documents.response_received_date from documents join document_types on documents.document_type_code = document_types.document_type_code join grants on documents.grant_id = grants.grant_id where document_types.document_description = 'Regular' or grants.grant_amount > 100