1
2
3
4
5
6
7
|
# Write your MySQL query statement below
select e2.employee_id, e2.name, count(e1.reports_to) reports_count, round(avg(e1.age), 0) average_age
from Employees e1
join Employees e2
on e1.reports_to =e2.employee_id
group by e2.employee_id
order by e2.employee_id
|
cs |
반응형
'SQL' 카테고리의 다른 글
leetcode 185 department-top-three-salaries/description (0) | 2023.11.16 |
---|---|
leetcode 1211. Queries Quality and Percentage (0) | 2023.06.13 |
leetcode 619. Biggest Single Number (0) | 2023.06.09 |
leetcode 1517. Find Users With Valid E-Mails (0) | 2023.06.07 |
leetcode 1633. Percentage of Users Attended a Contest (0) | 2023.06.01 |
댓글