Solved programming problem

Count the total no of employees for each department. Don’t consider employees of job_id AS_PRESS and also consider only those departments where total no of employees is greater than 5

Source code

SELECT DEPARTMENT_ID, COUNT(*)

FROM employees

WHERE JOB_ID NOT LIKE "AS_PRESS"

GROUP BY DEPARTMENT_ID

HAVING COUNT(*) > 5;
Join the discussion

Add your comment