Solved programming problem

For each region, show the region_name and total no of employees in that region

Source code

SELECT r.REGION_NAME,count(*)

 FROM employees AS e 

    JOIN

    departments AS d

    ON d.DEPARTMENT_ID = e.DEPARTMENT_ID

 

    JOIN

    locations AS l  

    ON l.LOCATION_ID = d.LOCATION_ID

 

    JOIN

    countries AS c 

    ON l.COUNTRY_ID = c.COUNTRY_ID

 

    JOIN

    regions AS r 

    ON r.REGION_ID = c.REGION_ID;
Join the discussion

Add your comment