From the following tables, write a SQL query to find those departments where maximum salary is 7000 and above
- برمجة سي كيو ال sql
- 2021-09-02
- mhanasmh00489829403
الأجوبة
SELECT *
FROM departments
WHERE DEPARTMENT_ID IN
(SELECT DEPARTMENT_ID
FROM employees
WHERE EMPLOYEE_ID IN
(SELECT EMPLOYEE_ID
FROM job_history
GROUP BY EMPLOYEE_ID
HAVING COUNT(EMPLOYEE_ID) > 1)
GROUP BY DEPARTMENT_ID
HAVING MAX(SALARY) > 7000);
Sample Output:
department_id department_name manager_id location_id 80 Sales 145 2500 90 Executive 100 1700
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال