You are viewing a single comment's thread. Return to all comments →
This is the solution I came up with for MySQL:
SELECT c.company_code, c.founder, COUNT(DISTINCT e.lead_manager_code), COUNT(DISTINCT e.senior_manager_code), COUNT(DISTINCT e.manager_code), COUNT(DISTINCT e.employee_code) FROM Company AS c INNER JOIN Employee AS e ON c.company_code = e.company_code GROUP BY c.company_code, c.founder ORDER BY c.company_code;
This code only uses the two tables 'Company' and 'Employee', instead of using all the 5 tables provided.
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 →
Solution 1
This is the solution I came up with for MySQL:
This code only uses the two tables 'Company' and 'Employee', instead of using all the 5 tables provided.