Write a query in SQL to list the department ID and their average salaries for those department where the average salary is less than the averages for all departments
- برمجة سي كيو ال sql
- 2021-09-07
- mhanasmh00489829403
الأجوبة
SELECT dep_id,
avg(salary)
FROM employees
GROUP BY dep_id
HAVING avg(salary) <
(SELECT avg(salary)
FROM employees);
Sample Output:
dep_id | avg --------+----------------------- 3001 | 1633.3333333333333333 (1 row)
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال