Computer Science

List the sum of employees' salaries grouped by department. (table EMPL)

SQL Joins & Grouping

1 Like

Answer

SELECT deptno, SUM(sal) AS total_salary
FROM EMPL
GROUP BY deptno;
Output
+--------+--------------+
| deptno | total_salary |
+--------+--------------+
|     20 |        10885 |
|     30 |         9400 |
|     10 |         8750 |
+--------+--------------+

Answered By

2 Likes


Related Questions