CBSE Class 12 Informatics Practices Question 78 of 90

Querying Using SQL — Question 18

Back to all questions
18
Question

Question 18

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

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