Write a query in SQL to list the details of the employees within grade 3 to 5 and belongs to SYDNEY
- برمجة سي كيو ال sql
- 2021-09-07
- mhanasmh00489829403
الأجوبة
SELECT *
FROM employees
WHERE dep_id IN
(SELECT dep_id
FROM department
WHERE department.dep_location ='SYDNEY')
AND emp_id IN
(SELECT emp_id
FROM employees e,
salary_grade s
WHERE e.salary BETWEEN s.min_sal AND s.max_sal
AND s.grade IN (3,
4,
5) )
AND job_name != 'PRESIDENT'
AND salary >
(SELECT max(salary)
FROM employees
WHERE dep_id IN
(SELECT dep_id
FROM department
WHERE department.dep_location = 'PERTH')
AND job_name IN ('MANAGER',
'SALESMAN')
AND manager_id NOT IN
(SELECT emp_id
FROM employees
WHERE emp_name = 'KAYLING'));
Sample Output:
emp_id | emp_name | job_name | manager_id | hire_date | salary | commission | dep_id --------+----------+----------+------------+------------+---------+------------+-------- 67832 | CLARE | MANAGER | 68319 | 1991-06-09 | 2550.00 | | 1001 (1 row)
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال