New Companies

Jimin·2022년 8월 26일
0

HackerRank

목록 보기
11/27

  • Company

  • Lead_Manager

  • Senior_Manager

  • Manager

  • Employee

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, Lead_Manager LM,
Senior_Manager SM, Manager M, Employee E
WHERE 
C.company_code = LM.company_code
AND
LM.lead_manager_code = SM.lead_manager_code
AND
SM.senior_manager_code = M.senior_manager_code
AND
M.manager_code = E.manager_code
GROUP BY C.company_code, C.founder
ORDER BY C.company_code;
profile
https://github.com/Dingadung

0개의 댓글