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

Convert text to sql: What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'? | 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 _ from _ where _ intersect select _ from _ where _ | select grants.grant_amount from grants join documents on grants.grant_id = documents.grant_id where documents.sent_date < '1986-08-26 20:49:27' intersect select grant_amount from grants where grant_end_date > '1989-03-16 18:27:16'
### Instruction:

Convert text to sql: What are the different grant amounts for documents sent before '1986-08-26 20:49:27' and after the grant ended on '1989-03-16 18:27:16'? | 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 _ from _ where _ intersect select _ from _ where _ | select grants.grant_amount from grants join documents on grants.grant_id = documents.grant_id where documents.sent_date < '1986-08-26 20:49:27' intersect select grant_amount from grants where grant_end_date > '1989-03-16 18:27:16'
### Instruction:

Convert text to sql: List the project details of the project both producing patent and paper as outcomes. | 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 _ from _ where _ intersect select _ from _ where _ | select projects.project_details from projects join project_outcomes on projects.project_id = project_outcomes.project_id where project_outcomes.outcome_code = 'Paper' intersect select projects.project_details from projects join project_outcomes on projects.project_id = project_outcomes.project_id where project_outcomes.outcome_code = 'Patent'
### Instruction:

Convert text to sql: What are the details of the project that is producing both patents and papers as outcomes? | 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 _ from _ where _ intersect select _ from _ where _ | select projects.project_details from projects join project_outcomes on projects.project_id = project_outcomes.project_id where project_outcomes.outcome_code = 'Paper' intersect select projects.project_details from projects join project_outcomes on projects.project_id = project_outcomes.project_id where project_outcomes.outcome_code = 'Patent'
### Instruction:

Convert text to sql: What is the total grant amount of the organisations described as 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 ( _ ) from _ where _ | 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: 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 ( _ ) from _ where _ | 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 _ from _ where _ in ( select _ from _ group by _ order by count ( _ ) desc limit _ ) union select _ from _ where _ | 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 _ from _ where _ in ( select _ from _ group by _ order by count ( _ ) desc limit _ ) union select _ from _ where _ | 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 _ from _ group by _ having sum ( _ ) > _ | 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 _ from _ group by _ having sum ( _ ) > _ | 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 _ from _ group by _ order by count ( _ ) desc limit _ | 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 _ from _ group by _ order by count ( _ ) desc limit _ | 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