Managers with at Least 5 Direct Reports
<p>Table: <code>Employee</code></p>

<pre>
+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| id          | int     |
| name        | varchar |
| department  | varchar |
| managerId   | int     |
+-------------+---------+
id is the primary key (column with unique values) for this table.
Each row of this table indicates the name of an employee, their department, and the id of their manager.
If managerId is null, then the employee does not have a manager.
No employee will be the manager of themself.
</pre>

<p>&nbsp;</p>

<p>Write a solution to find managers with at least <strong>five direct reports</strong>.</p>

<p>Return the result table in <strong>any order</strong>.</p>

<p>The result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> 
Employee table:
+-----+-------+------------+-----------+
| id  | name  | department | managerId |
+-----+-------+------------+-----------+
| 101 | John  | A          | null      |
| 102 | Dan   | A          | 101       |
| 103 | James | A          | 101       |
| 104 | Amy   | A          | 101       |
| 105 | Anne  | A          | 101       |
| 106 | Ron   | B          | 101       |
+-----+-------+------------+-----------+
<strong>Output:</strong> 
+------+
| name |
+------+
| John |
+------+
</pre>

[]
['Create table If Not Exists Employee (id int, name varchar(255), department varchar(255), managerId int)', 'Truncate table Employee', "insert into Employee (id, name, department, managerId) values ('101', 'John', 'A', NULL)", "insert into Employee (id, name, department, managerId) values ('102', 'Dan', 'A', '101')", "insert into Employee (id, name, department, managerId) values ('103', 'James', 'A', '101')", "insert into Employee (id, name, department, managerId) values ('104', 'Amy', 'A', '101')", "insert into Employee (id, name, department, managerId) values ('105', 'Anne', 'A', '101')", "insert into Employee (id, name, department, managerId) values ('106', 'Ron', 'B', '101')"]
[{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"value": "pythondata", "text": "Pandas", "defaultCode": "import pandas as pd\n\ndef find_managers(employee: pd.DataFrame) -> pd.DataFrame:\n    "}, {"value": "postgresql", "text": "PostgreSQL", "defaultCode": "-- Write your PostgreSQL query statement below\n"}]
{"mysql": ["Create table If Not Exists Employee (id int, name varchar(255), department varchar(255), managerId int)"], "mssql": ["Create table Employee (id int, name varchar(255), department varchar(255), managerId int)"], "oraclesql": ["Create table Employee (id int, name varchar(255), department varchar(255), managerId int)"], "database": true, "name": "find_managers", "pythondata": ["Employee = pd.DataFrame([], columns=['id', 'name', 'department', 'managerId']).astype({'id':'Int64', 'name':'object', 'department':'object', 'managerId':'Int64'})"], "manual": false, "postgresql": ["\nCreate table If Not Exists Employee (id int, name varchar(255), department varchar(255), managerId int)"], "database_schema": {"Employee": {"id": "INT", "name": "VARCHAR(255)", "department": "VARCHAR(255)", "managerId": "INT"}}}
{"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16</p>"]}
['Database']