db_id
stringlengths 4
31
| text
stringlengths 370
4.84k
|
---|---|
manufacturer | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the id and number of shops for the company that produces the most expensive furniture. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id |
### Response:
select manufacturer.manufacturer_id , manufacturer.num_of_shops from manufacturer join furniture_manufacte on manufacturer.manufacturer_id = furniture_manufacte.manufacturer_id order by furniture_manufacte.price_in_dollar desc limit 1 |
manufacturer | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of funiture types produced by each manufacturer as well as the company names. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id |
### Response:
select count ( * ) , manufacturer.name from manufacturer join furniture_manufacte on manufacturer.manufacturer_id = furniture_manufacte.manufacturer_id group by manufacturer.manufacturer_id |
manufacturer | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Give me the names and prices of furnitures which some companies are manufacturing. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id |
### Response:
select furniture.name , furniture_manufacte.price_in_dollar from furniture join furniture_manufacte on furniture.furniture_id = furniture_manufacte.furniture_id |
manufacturer | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the market shares and names of furnitures which no any company is producing in our records. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id |
### Response:
select market_rate , name from furniture where furniture_id not in ( select furniture_id from furniture_manufacte ) |
manufacturer | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id |
### Response:
select manufacturer.name from furniture join furniture_manufacte on furniture.furniture_id = furniture_manufacte.furniture_id join manufacturer on furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id where furniture.num_of_component < 6 intersect select manufacturer.name from furniture join furniture_manufacte on furniture.furniture_id = furniture_manufacte.furniture_id join manufacturer on furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id where furniture.num_of_component > 10 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Display the first name and department name for each 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 employees.first_name , departments.department_name from employees join departments on employees.department_id = departments.department_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first name and department name of all 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 employees.first_name , departments.department_name from employees join departments on employees.department_id = departments.department_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the full name (first and last name), and salary for those employees who earn below 6000. | 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 , salary from employees where salary < 6000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the full names and salaries for any employees earning less than 6000? | 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 , salary from employees where salary < 6000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Display the first name, and department number for all employees whose last name is "McEwen". | 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 , department_id from employees where last_name = 'McEwen' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first names and department numbers for employees with last name McEwen? | 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 , department_id from employees where last_name = 'McEwen' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return all the information for all employees without any department number. | 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 employees where department_id = 'null' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are all the employees without a department number? | 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 employees where department_id = 'null' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: when is the hire date for those employees whose first name does not containing the letter M? | 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 hire_date from employees where first_name not like '%M%' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: On what dates were employees without the letter M in their first names hired? | 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 hire_date from employees where first_name not like '%M%' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M. | 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 , hire_date , salary , department_id from employees where first_name not like '%M%' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the full name, hire date, salary, and department id for employees without the letter M in their 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 first_name , last_name , hire_date , salary , department_id from employees where first_name not like '%M%' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number. | 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 , hire_date , salary , department_id from employees where first_name not like '%M%' order by department_id asc |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id? | 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 , hire_date , salary , department_id from employees where first_name not like '%M%' order by department_id asc |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: what is the phone number of employees whose salary is in the range of 8000 and 12000? | 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 phone_number from employees where salary between 8000 and 12000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the phone numbers of employees with salaries between 8000 and 12000. | 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 phone_number from employees where salary between 8000 and 12000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40. | 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 employees where salary between 8000 and 12000 and commission_pct != 'null' or department_id != 40 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return all information about employees with salaries between 8000 and 12000 for which commission is not null or where their department id is not 40. | 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 employees where salary between 8000 and 12000 and commission_pct != 'null' or department_id != 40 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the full name (first and last name) and salary for all employees who does not have any value for commission? | 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 , salary from employees where commission_pct = 'null' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the full names and salaries of employees with null commissions. | 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 , salary from employees where commission_pct = 'null' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Display the first and last name, and salary for those employees whose first name is ending with the letter m. | 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 , salary from employees where first_name like '%m' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the full names and salaries for employees with first names that end with the letter m. | 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 , salary from employees where first_name like '%m' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009. | 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 , hire_date from employees where hire_date between '2007-11-05' and '2009-07-05' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009? | 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 , hire_date from employees where hire_date between '2007-11-05' and '2009-07-05' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first and last name for those employees who works either in department 70 or 90? | 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 department_id = 70 or department_id = 90 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the full names of employees who with in department 70 or 90? | 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 department_id = 70 or department_id = 90 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the salary and manager number for those employees who is working under a manager. | 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 salary , manager_id from employees where manager_id != 'null' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the salaries and manager ids for employees who have 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 salary , manager_id from employees where manager_id != 'null' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display all the details from Employees table for those employees who was hired before 2002-06-21. | 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 employees where hire_date < '2002-06-21' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is all the information about employees hired before June 21, 2002? | 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 employees where hire_date < '2002-06-21' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by 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 * from employees where first_name like '%D%' or first_name like '%S%' order by salary desc |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is all the information about employees with D or S in their first name, ordered by salary descending? | 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 employees where first_name like '%D%' or first_name like '%S%' order by salary desc |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display those employees who joined after 7th September, 1987. | 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 employees where hire_date > '1987-09-07' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which employees were hired after September 7th, 1987? | 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 employees where hire_date > '1987-09-07' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the job title of jobs which minimum salary is greater than 9000. | 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_title from jobs where min_salary > 9000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which job titles correspond to jobs with salaries over 9000? | 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_title from jobs where min_salary > 9000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000. | 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_title , max_salary - min_salary from jobs where max_salary between 12000 and 18000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000? | 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_title , max_salary - min_salary from jobs where max_salary between 12000 and 18000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50. | 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 email from employees where commission_pct = 'null' and salary between 7000 and 12000 and department_id = 50 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the emails of employees with null commission, salary between 7000 and 12000, and who work in department 50? | 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 email from employees where commission_pct = 'null' and salary between 7000 and 12000 and department_id = 50 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the employee ID for each employee and the date on which he ended his previous job. | 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 , max ( end_date ) from job_history group by employee_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the employee ids for each employee and final dates of employment at their last job? | 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 , max ( end_date ) from job_history group by employee_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display those departments where more than ten employees work who got a commission percentage. | 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 department_id from employees group by department_id having count ( commission_pct ) > 10 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the department ids for which more than 10 employees had a commission? | 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 department_id from employees group by department_id having count ( commission_pct ) > 10 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the ids of the 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are department ids for departments with managers managing more than 3 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the average salary of employees for each department who gets a commission percentage. | 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 department_id , avg ( salary ) from employees where commission_pct != 'null' group by department_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average salary of employees who have a commission percentage that is not null? | 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 department_id , avg ( salary ) from employees where commission_pct != 'null' group by department_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the country ID and number of cities for each country. | 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 country_id , count ( * ) from locations group by country_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Give the country id and corresponding count of cities in each country. | 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 country_id , count ( * ) from locations group by country_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display job ID for those jobs that were done by two or more for more than 300 days. | 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 job_history where end_date - start_date > 300 group by job_id having count ( * ) >= 2 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the job ids for jobs done more than once for a period of more than 300 days? | 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 job_history where end_date - start_date > 300 group by job_id having count ( * ) >= 2 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the employee ids for employees who have held 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find employee with ID and name of the country presently where (s)he is working. | 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 , countries.country_name from employees join departments on employees.department_id = departments.department_id join locations on departments.location_id = locations.location_id join countries on locations.country_id = countries.country_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are all the employee ids and the names of the countries in which they work? | 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 , countries.country_name from employees join departments on employees.department_id = departments.department_id join locations on departments.location_id = locations.location_id join countries on locations.country_id = countries.country_id |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the department name and number of employees in each of the 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 departments.department_name , count ( * ) from employees join departments on employees.department_id = departments.department_id group by departments.department_name |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Give the name of each department and the number of employees in each. | 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 departments.department_name , count ( * ) from employees join departments on employees.department_id = departments.department_id group by departments.department_name |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000? | 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 job_history join employees on job_history.employee_id = employees.employee_id where employees.salary >= 12000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is all the job history info done by employees earning a salary greater than or equal to 12000? | 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 job_history join employees on job_history.employee_id = employees.employee_id where employees.salary >= 12000 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display job title and average salary of 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 job_title , avg ( salary ) from employees join jobs on employees.job_id = jobs.job_id group by jobs.job_title |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average salary for each job title? | 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_title , avg ( salary ) from employees join jobs on employees.job_id = jobs.job_id group by jobs.job_title |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 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 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: what are the employee ids and job titles for employees 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 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the first name and job id for all employees in the Finance 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 employees.first_name , employees.job_id from employees join departments on employees.department_id = departments.department_id where departments.department_name = 'Finance' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Give the first name and job id for all employees in the Finance 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 employees.first_name , employees.job_id from employees join departments on employees.department_id = departments.department_id where departments.department_name = 'Finance' |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display all the information of the employees whose salary if within the range of smallest salary and 2500. | 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 employees where salary between ( select min ( salary ) from employees ) and 2500 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is all the information regarding employees with salaries above the minimum and under 2500? | 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 employees where salary between ( select min ( salary ) from employees ) and 2500 |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200. | 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 employees where department_id not in ( select department_id from departments where manager_id between 100 and 200 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the ids for employees who do not work in departments with managers that have ids between 100 and 200? | 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 employees where department_id not in ( select department_id from departments where manager_id between 100 and 200 ) |
hr_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara. | 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 , hire_date from employees where department_id = ( select department_id from employees where first_name = 'Clara' ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.