Write a query in SQL to list the name, designation, and salary of the employees who does not work in the department 1001 but works in same designation and salary as the employees in department 3001
- برمجة سي كيو ال sql
- 2021-09-07
- mhanasmh00489829403
الأجوبة
SELECT emp_name,
job_name,
salary
FROM employees
WHERE dep_id != 1001
AND job_name IN
(SELECT job_name
FROM employees
WHERE dep_id = 3001)
AND salary IN
(SELECT salary
FROM employees
WHERE dep_id = 3001);
Sample Output:
emp_name | job_name | salary ----------+----------+--------- BLAZE | MANAGER | 2750.00 ADELYN | SALESMAN | 1700.00 WADE | SALESMAN | 1350.00 MADDEN | SALESMAN | 1350.00 TUCKER | SALESMAN | 1600.00 JULIUS | CLERK | 1050.00 (6 rows)
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال