Count the total salary deptno wise where more than 2 employees exist.
SELECT deptno, SUM(sal) AS TOTALSAL FROM emp GROUP BY deptno HAVING COUNT(empno) > 2;