input
stringlengths
191
7.13k
output
stringlengths
19
578
Tables: manufacturer, furniture, furniture_manufacte Columns: manufacturer.Manufacturer_ID, manufacturer.Open_Year, manufacturer.Name, manufacturer.Num_of_Factories, manufacturer.Num_of_Shops, furniture.Furniture_ID, furniture.Name, furniture.Num_of_Component, furniture.Market_Rate, furniture_manufacte.Manufacturer_ID,...
SELECT t1.manufacturer_id , t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1;
Tables: manufacturer, furniture, furniture_manufacte Columns: manufacturer.Manufacturer_ID, manufacturer.Open_Year, manufacturer.Name, manufacturer.Num_of_Factories, manufacturer.Num_of_Shops, furniture.Furniture_ID, furniture.Name, furniture.Num_of_Component, furniture.Market_Rate, furniture_manufacte.Manufacturer_ID,...
SELECT count(*) , t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id;
Tables: manufacturer, furniture, furniture_manufacte Columns: manufacturer.Manufacturer_ID, manufacturer.Open_Year, manufacturer.Name, manufacturer.Num_of_Factories, manufacturer.Num_of_Shops, furniture.Furniture_ID, furniture.Name, furniture.Num_of_Component, furniture.Market_Rate, furniture_manufacte.Manufacturer_ID,...
SELECT t1.name , t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID;
Tables: manufacturer, furniture, furniture_manufacte Columns: manufacturer.Manufacturer_ID, manufacturer.Open_Year, manufacturer.Name, manufacturer.Num_of_Factories, manufacturer.Num_of_Shops, furniture.Furniture_ID, furniture.Name, furniture.Num_of_Component, furniture.Market_Rate, furniture_manufacte.Manufacturer_ID,...
SELECT Market_Rate , name FROM furniture WHERE Furniture_ID NOT IN (SELECT Furniture_ID FROM furniture_manufacte);
Tables: manufacturer, furniture, furniture_manufacte Columns: manufacturer.Manufacturer_ID, manufacturer.Open_Year, manufacturer.Name, manufacturer.Num_of_Factories, manufacturer.Num_of_Shops, furniture.Furniture_ID, furniture.Name, furniture.Num_of_Component, furniture.Market_Rate, furniture_manufacte.Manufacturer_ID,...
SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_...
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , salary FROM employees WHERE salary < 6000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , salary FROM employees WHERE salary < 6000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , department_id FROM employees WHERE last_name = 'McEwen';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , department_id FROM employees WHERE last_name = 'McEwen';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE department_id = "null";
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE department_id = "null";
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM departments WHERE department_name = 'Marketing';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM departments WHERE department_name = 'Marketing';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR department_id != 40;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR department_id != 40;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , salary FROM employees WHERE commission_pct = "null";
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , salary FROM employees WHERE commission_pct = "null";
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_id , hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_id , hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT salary , manager_id FROM employees WHERE manager_id != "null";
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT salary , manager_id FROM employees WHERE manager_id != "null";
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE hire_date < '2002-06-21';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE hire_date < '2002-06-21';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE hire_date > '1987-09-07';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE hire_date > '1987-09-07';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_title FROM jobs WHERE min_salary > 9000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_title FROM jobs WHERE min_salary > 9000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_title , max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_title , max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id , MAX(end_date) FROM job_history GROUP BY employee_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id , MAX(end_date) FROM job_history GROUP BY employee_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != "null" GROUP BY department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != "null" GROUP BY department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT country_id , COUNT(*) FROM locations GROUP BY country_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT country_id , COUNT(*) FROM locations GROUP BY country_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T2.department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T2.department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 );
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 );
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT MIN(salary) , department_id FROM employees GROUP BY department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT MIN(salary) , department_id FROM employees GROUP BY department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id);
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id);
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam' );
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam' );
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM departments WHERE department_name = 'Marketing';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM departments WHERE department_name = 'Marketing';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.employee_id , T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.employee_id , T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance';
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500;
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200);
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200);
Tables: regions, countries, departments, jobs, employees, job_history, locations Columns: regions.REGION_ID, regions.REGION_NAME, countries.COUNTRY_ID, countries.COUNTRY_NAME, countries.REGION_ID, departments.DEPARTMENT_ID, departments.DEPARTMENT_NAME, departments.MANAGER_ID, departments.LOCATION_ID, jobs.JOB_ID, jobs....
SELECT first_name , last_name , hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara");