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
Find out number of employees having "Manager" as Job.
List the count of employees grouped by deptno. (table EMPL)
List the maximum salary of employee grouped by their department number.
Below are the customer and order tables :
Customers
customer id (PK) first_name last_name email address city state zip Orders
order id (PK) order_date amount customer_id (FK) List the total of customers' orders grouped by customer (id).