We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Select c.company_code, c.founder,count(distinct lm.lead_manager_code),count(distinct sm.senior_manager_code),count(distinct m.manager_code),count(distinct e.employee_code)
from Company c
join employee e ON e.company_code = c.company_code
join Manager m ON m.manager_code = e.manager_code
join senior_manager sm ON sm.senior_manager_code = m.senior_manager_code
join Lead_manager lm ON lm.lead_manager_code = e.lead_manager_code
GROUP BY c.company_code, c.founder
ORDER BY c.company_code\
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
New Companies
You are viewing a single comment's thread. Return to all comments →
Select c.company_code, c.founder,count(distinct lm.lead_manager_code),count(distinct sm.senior_manager_code),count(distinct m.manager_code),count(distinct e.employee_code) from Company c join employee e ON e.company_code = c.company_code join Manager m ON m.manager_code = e.manager_code join senior_manager sm ON sm.senior_manager_code = m.senior_manager_code join Lead_manager lm ON lm.lead_manager_code = e.lead_manager_code GROUP BY c.company_code, c.founder ORDER BY c.company_code\