Write a query in SQL to list the managers who are not working under the PRESIDENT
- برمجة سي كيو ال sql
- 2021-09-07
- mhanasmh00489829403
الأجوبة
SELECT *
FROM employees
WHERE emp_id IN
(SELECT manager_id
FROM employees)
AND manager_id NOT IN
(SELECT emp_id
FROM employees
WHERE job_name = 'PRESIDENT');
Sample Output:
emp_id | emp_name | job_name | manager_id | hire_date | salary | commission | dep_id --------+----------+----------+------------+------------+---------+------------+-------- 67858 | SCARLET | ANALYST | 65646 | 1997-04-19 | 3100.00 | | 2001 69062 | FRANK | ANALYST | 65646 | 1991-12-03 | 3100.00 | | 2001 (2 rows)
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال