Computer Science

List the maximum salary of employee grouped by their department number.

SQL Joins & Grouping

1 Like

Answer

SELECT deptno, MAX(sal) AS max_salary
FROM EMPL
GROUP BY deptno;
Output
+--------+------------+
| deptno | max_salary |
+--------+------------+
|     20 |       3000 |
|     30 |       2850 |
|     10 |       5000 |
+--------+------------+

Answered By

1 Like


Related Questions