CBSE Class 12 Informatics Practices Question 14 of 79

Database Query using SQL — Question 6

Back to all questions
6
Question

Question 6

Count the total salary deptno wise where more than 2 employees exist.

Answer
SELECT deptno, SUM(sal) AS TOTALSAL
FROM emp
GROUP BY deptno
HAVING COUNT(empno) > 2;