diff --git a/leetCode/sql/managers-with-at-least-5-direct-reports.sql b/leetCode/sql/managers-with-at-least-5-direct-reports.sql new file mode 100644 index 0000000..9fbe2a1 --- /dev/null +++ b/leetCode/sql/managers-with-at-least-5-direct-reports.sql @@ -0,0 +1,8 @@ +# https://leetcode.com/problems/managers-with-at-least-5-direct-reports +select + name +from + Employee e +where + 5 <= (select count(*) from Employee e2 where e2.managerId = e.id) +;