"content":"<p>Table: <code>Employees</code></p>\n\n<pre>\n+-------------+----------+\n| Column Name | Type |\n+-------------+----------+\n| employee_id | int |\n| name | varchar |\n| reports_to | int |\n| age | int |\n+-------------+----------+\nemployee_id is the column with unique values for this table.\nThis table contains information about the employees and the id of the manager they report to. Some employees do not report to anyone (reports_to is null). \n</pre>\n\n<p> </p>\n\n<p>For this problem, we will consider a <strong>manager</strong> an employee who has at least 1 other employee reporting to them.</p>\n\n<p>Write a solution to report the ids and the names of all <strong>managers</strong>, the number of employees who report <strong>directly</strong> to them, and the average age of the reports rounded to the nearest integer.</p>\n\n<p>Return the result table ordered by <code>employee_id</code>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nEmployees table:\n+-------------+---------+------------+-----+\n| employee_id | name | reports_to | age |\n+-------------+---------+------------+-----+\n| 9 | Hercy | null | 43 |\n| 6 | Alice | 9 | 41 |\n| 4 | Bob | 9 | 36 |\n| 2 | Winston | null | 37 |\n+-------------+---------+------------+-----+\n<strong>Output:</strong> \n+-------------+-------+---------------+-------------+\n| employee_id | name | reports_count | average_age |\n+-------------+-------+---------------+-------------+\n| 9 | Hercy | 2 | 39 |\n+-------------+-------+---------------+-------------+\n<strong>Explanation:</strong> Hercy has 2 people report directly to him, Alice and Bob. Their average age is (41+36)/2 = 38.5, which is 39 after rounding it to the nearest integer.\n</pre>\n",