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

Convert text to sql: Provide the full names of employees earning more than the employee with id 163. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select first_name , last_name from employees where salary > ( select salary from employees where employee_id = 163 )

### Instruction:

Convert text to sql: return the smallest salary for every departments. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select min ( salary ) , department_id from employees group by department_id

### Instruction:

Convert text to sql: What is the minimum salary in each department? | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select min ( salary ) , department_id from employees group by department_id
### Instruction:

Convert text to sql: Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select first_name , last_name , department_id from employees where salary in ( select min ( salary ) from employees group by department_id )

### Instruction:

Convert text to sql: What are the full names and department ids for the lowest paid employees across all departments. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select first_name , last_name , department_id from employees where salary in ( select min ( salary ) from employees group by department_id )
### Instruction:

Convert text to sql: Find the employee id for all employees who earn more than the average salary. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select employee_id from employees where salary > ( select avg ( salary ) from employees )

### Instruction:

Convert text to sql: What are the employee ids for employees who make more than the average? | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select employee_id from employees where salary > ( select avg ( salary ) from employees )
### Instruction:

Convert text to sql: display the employee id and salary of all employees who report to Payam (first name). | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select employee_id , salary from employees where manager_id = ( select employee_id from employees where first_name = 'Payam' )

### Instruction:

Convert text to sql: What are the employee ids of employees who report to Payam, and what are their salaries? | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select employee_id , salary from employees where manager_id = ( select employee_id from employees where first_name = 'Payam' )
### Instruction:

Convert text to sql: find the name of all departments that do actually have one or more employees assigned to them. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select distinct departments.department_name from employees join departments on employees.department_id = departments.department_id

### Instruction:

Convert text to sql: What are the names of departments that have at least one employee. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select distinct departments.department_name from employees join departments on employees.department_id = departments.department_id
### Instruction:

Convert text to sql: get the details of employees who manage a department. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select distinct * from employees join departments on employees.department_id = departments.department_id where employees.employee_id = departments.manager_id

### Instruction:

Convert text to sql: What is all the information regarding employees who are managers? | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select distinct * from employees join departments on employees.department_id = departments.department_id where employees.employee_id = departments.manager_id
### Instruction:

Convert text to sql: display all the information about the department Marketing. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select * from departments where department_name = 'Marketing'

### Instruction:

Convert text to sql: What is all the information about the Marketing department? | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select * from departments where department_name = 'Marketing'

### Instruction:

Convert text to sql: display the ID for those employees who did two or more jobs in the past. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select employee_id from job_history group by employee_id having count ( * ) >= 2
### Instruction:

Convert text to sql: What are the employee ids for those who had two or more jobs. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select employee_id from job_history group by employee_id having count ( * ) >= 2

### Instruction:

Convert text to sql: What are the unique ids of those departments where any manager is managing 4 or more employees. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select distinct department_id from employees group by department_id , manager_id having count ( employee_id ) >= 4
### Instruction:

Convert text to sql: Give the distinct department ids of departments in which a manager is in charge of 4 or more employees? | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select distinct department_id from employees group by department_id , manager_id having count ( employee_id ) >= 4

### Instruction:

Convert text to sql: Find the job ID for those jobs which average salary is above 8000. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select job_id from employees group by job_id having avg ( salary ) > 8000
### Instruction:

Convert text to sql: What are the job ids corresponding to jobs with average salary above 8000? | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select job_id from employees group by job_id having avg ( salary ) > 8000

### Instruction:

Convert text to sql: display the employee ID and job name for all those jobs in department 80. | regions : region_id , region_name | countries : country_id , country_name , region_id | departments : department_id , department_name , manager_id , location_id | jobs : job_id , job_title , min_salary , max_salary | employees : employee_id , first_name , last_name , email , phone_number , hire_date , job_id , salary , commission_pct , manager_id , department_id | job_history : employee_id , start_date , end_date , job_id , department_id | locations : location_id , street_address , postal_code , city , state_province , country_id | countries.region_id = regions.region_id | employees.job_id = jobs.job_id | employees.department_id = departments.department_id | job_history.job_id = jobs.job_id | job_history.department_id = departments.department_id | job_history.employee_id = employees.employee_id | locations.country_id = countries.country_id | 

### Response:

select employees.employee_id , jobs.job_title from employees join jobs on employees.job_id = jobs.job_id where employees.department_id = 80