Informatics Practices
Count the total salary deptno wise where more than 2 employees exist.
SQL Queries
2 Likes
Answer
SELECT deptno, SUM(sal) AS TOTALSAL
FROM emp
GROUP BY deptno
HAVING COUNT(empno) > 2;
Answered By
2 Likes
Related Questions
How can we fetch only common records from two tables emp and emp1?
How can we retrieve all records of emp that are not present in emp1?
Suppose there is annual salary information provided by emp table. How can we fetch monthly salary of each and every employee?
Select all records from emp table where deptno = 10 or 40.