Solved programming problem

For each manager, show the manager_name and total no of employees under his supervision who receives higher salary than him

Source code

SELECT mng.EMPLOYEE_ID,COUNT(e.EMPLOYEE_ID) 

FROM employees AS e  

    JOIN 

    employees AS mng 

    ON e.MANAGER_ID = mng.EMPLOYEE_ID

WHERE e.SALARY > mng.SALARY         

GROUP BY mng.EMPLOYEE_ID;
Join the discussion

Add your comment