Solved programming problem

For each department, show the department_name and corresponding total no of ex-employees(job_history table) from that department

Source code

SELECT d.DEPARTMENT_NAME,COUNT(j.END_DATE)

FROM departments AS d 

    JOIN

     job_history AS j

    ON j.DEPARTMENT_ID = d.DEPARTMENT_ID

GROUP BY d.DEPARTMENT_NAME;
Join the discussion

Add your comment