728x90
๐ป ๋ฌธ์ ์ฃผ์ : Managers with at Least 5 Direct Reports - LeetCode
Students and Examinations - LeetCode
Can you solve this real interview question? Students and Examinations - Table: Students +---------------+---------+ | Column Name | Type | +---------------+---------+ | student_id | int | | student_name | varchar | +---------------+---------+ student_id is
leetcode.com
๐ป ๋ฌธ์
Write a solution to find managers with at least five direct reports. Return the result table in any order.
- ์ ์ด๋ ์ง์ ๋ณด๊ณ ๋ฅผ ์ต์ 5๋ฒ ๋ฐ์ ๋งค๋์ ๋ฅผ ์ถ๋ ฅํ์์ค. ์ถ๋ ฅ ์์๋ ์๊ด ์์ต๋๋ค.
๐ป ์ฝ๋ ๋ฐ ํ์ด
select name -- ์ฌ๊ธฐ์ name์ column name
from Employee
where id in (select managerID from Employee group by managerID having count(managerID) >= 5)
728x90
๋ฐ์ํ
'SQL > LeetCode' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[LeetCode][SQL50] #15. Not Boring Movies (2) | 2023.11.13 |
---|---|
[LeetCode][SQL50] #14. Confirmation Rate (0) | 2023.11.13 |
[LeetCode][SQL50] #12. Students and Examinations (0) | 2023.11.09 |
[LeetCode][SQL50] #11. Employee Bonus (0) | 2023.11.08 |
[LeetCode][SQL50] #10. Average Time of Process per Machine (0) | 2023.11.08 |