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

Convert text to sql: What are the ids of documents with letter 's' in the name with any expense budgets. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select documents.document_id from documents join documents_with_expenses on documents.document_id = documents_with_expenses.document_id where documents.document_name like '%s%'

### Instruction:

Convert text to sql: Give the ids of documents that have expenses and contain the letter s in their names. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select documents.document_id from documents join documents_with_expenses on documents.document_id = documents_with_expenses.document_id where documents.document_name like '%s%'
### Instruction:

Convert text to sql: How many documents do not have any expense? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select count ( * ) from documents where document_id not in ( select document_id from documents_with_expenses )

### Instruction:

Convert text to sql: Count the number of documents that do not have expenses. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select count ( * ) from documents where document_id not in ( select document_id from documents_with_expenses )
### Instruction:

Convert text to sql: What are the dates for the documents with both 'GV' type and 'SF' type expenses? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select documents.document_date from documents join documents_with_expenses on documents.document_id = documents_with_expenses.document_id where documents_with_expenses.budget_type_code = 'GV' intersect select documents.document_date from documents join documents_with_expenses on documents.document_id = documents_with_expenses.document_id where documents_with_expenses.budget_type_code = 'SF'

### Instruction:

Convert text to sql: Give the dates of creation for documents that have both budget type codes 'GV' and 'SF'. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select documents.document_date from documents join documents_with_expenses on documents.document_id = documents_with_expenses.document_id where documents_with_expenses.budget_type_code = 'GV' intersect select documents.document_date from documents join documents_with_expenses on documents.document_id = documents_with_expenses.document_id where documents_with_expenses.budget_type_code = 'SF'
### Instruction:

Convert text to sql: What are the account details with the largest value or with value having char '5' in it? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select max ( account_details ) from accounts union select account_details from accounts where account_details like '%5%'

### Instruction:

Convert text to sql: Return the account details with the greatest value, as well as those that include the character 5. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select max ( account_details ) from accounts union select account_details from accounts where account_details like '%5%'
### Instruction:

Convert text to sql: Find the total number of scientists. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( * ) from scientists

### Instruction:

Convert text to sql: How many scientists are there? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( * ) from scientists

### Instruction:

Convert text to sql: Find the total hours of all projects. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select sum ( hours ) from projects

### Instruction:

Convert text to sql: What is the total number of hours for all projects? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select sum ( hours ) from projects

### Instruction:

Convert text to sql: How many different scientists are assigned to any project? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( distinct scientist ) from assignedto

### Instruction:

Convert text to sql: Count the number of different scientists assigned to any project. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( distinct scientist ) from assignedto

### Instruction:

Convert text to sql: Find the number of distinct projects. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( distinct name ) from projects

### Instruction:

Convert text to sql: How many different projects are there? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( distinct name ) from projects

### Instruction:

Convert text to sql: Find the average hours of all projects. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select avg ( hours ) from projects

### Instruction:

Convert text to sql: What is the average hours across all projects? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select avg ( hours ) from projects
### Instruction:

Convert text to sql: Find the name of project that continues for the longest time. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from projects order by hours desc limit 1

### Instruction:

Convert text to sql: What is the name of the project with the most hours? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from projects order by hours desc limit 1

### Instruction:

Convert text to sql: List the name of all projects that are operated longer than the average working hours of all projects. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from projects where hours > ( select avg ( hours ) from projects )

### Instruction:

Convert text to sql: What are the names of projects that have taken longer than the average number of hours for all projects? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from projects where hours > ( select avg ( hours ) from projects )

### Instruction:

Convert text to sql: Find the name and hours of project that has the most number of scientists. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select projects.name , projects.hours from projects join assignedto on projects.code = assignedto.project group by assignedto.project order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the name and hours for the project which has the most scientists assigned to it? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select projects.name , projects.hours from projects join assignedto on projects.code = assignedto.project group by assignedto.project order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Find the name of the project for which a scientist whose name contains 'Smith' is assigned to. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select projects.name from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where scientists.name like '%Smith%'
### Instruction:

Convert text to sql: What is the name of the project that has a scientist assigned to it whose name contains 'Smith'? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select projects.name from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where scientists.name like '%Smith%'

### Instruction:

Convert text to sql: Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select sum ( projects.hours ) from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where scientists.name = 'Michael Rogers' or scientists.name = 'Carol Smith'

### Instruction:

Convert text to sql: What is the sum of hours for projects that scientists with the name Michael Rogers or Carol Smith are assigned to? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select sum ( projects.hours ) from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where scientists.name = 'Michael Rogers' or scientists.name = 'Carol Smith'

### Instruction:

Convert text to sql: Find the name of projects that require between 100 and 300 hours of work. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from projects where hours between 100 and 300

### Instruction:

Convert text to sql: What are the names of projects that require between 100 and 300 hours? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from projects where hours between 100 and 300

### Instruction:

Convert text to sql: Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select scientists.name from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where projects.name = 'Matter of Time' intersect select scientists.name from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where projects.name = 'A Puzzling Parallax'
### Instruction:

Convert text to sql: What are the names of any scientists who worked on projects named 'Matter of Time' and 'A Puzzling Pattern'? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select scientists.name from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where projects.name = 'Matter of Time' intersect select scientists.name from assignedto join projects on assignedto.project = projects.code join scientists on assignedto.scientist = scientists.ssn where projects.name = 'A Puzzling Parallax'

### Instruction:

Convert text to sql: List the names of all scientists sorted in alphabetical order. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from scientists order by name asc

### Instruction:

Convert text to sql: What are the names of all the scientists in alphabetical order? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select name from scientists order by name asc

### Instruction:

Convert text to sql: Find the number of scientists involved for each project name. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( * ) , projects.name from projects join assignedto on projects.code = assignedto.project group by projects.name

### Instruction:

Convert text to sql: What are the naems of all the projects, and how many scientists were assigned to each of them? | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( * ) , projects.name from projects join assignedto on projects.code = assignedto.project group by projects.name

### Instruction:

Convert text to sql: Find the number of scientists involved for the projects that require more than 300 hours. | scientists : ssn , name | projects : code , name , hours | assignedto : scientist , project | assignedto.project = projects.code | assignedto.scientist = scientists.ssn | 

### Response:

select count ( * ) , projects.name from projects join assignedto on projects.code = assignedto.project where projects.hours > 300 group by projects.name