From 54a2838db902364ab723f2bb5a5dbaa76ad62490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Chac=C3=B3n=20Guti=C3=A9rrez?= <138903866+joseantoniochacon@users.noreply.github.com> Date: Sun, 2 Jun 2024 12:26:10 -0600 Subject: [PATCH] Time: 3863 ms (5.01%), Space: 0B (100.00%) - LeetHub --- .../0570-managers-with-at-least-5-direct-reports.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 0570-managers-with-at-least-5-direct-reports/0570-managers-with-at-least-5-direct-reports.sql diff --git a/0570-managers-with-at-least-5-direct-reports/0570-managers-with-at-least-5-direct-reports.sql b/0570-managers-with-at-least-5-direct-reports/0570-managers-with-at-least-5-direct-reports.sql new file mode 100644 index 0000000..ff2d4f1 --- /dev/null +++ b/0570-managers-with-at-least-5-direct-reports/0570-managers-with-at-least-5-direct-reports.sql @@ -0,0 +1,2 @@ +# Write your MySQL query statement below +SELECT name FROM (SELECT name, (SELECT COUNT(e2.managerId) FROM Employee e2 WHERE e1.id = e2.managerId) AS direct_reports FROM Employee e1) dr WHERE direct_reports > 4; \ No newline at end of file