Skip to content

Commit 20f5c90

Browse files
JOIN,ROUND,AVG,GROUP BY,ORDER BY
1 parent f0638ae commit 20f5c90

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SELECT e1.employee_id,e1.name,COUNT(e2.reports_to)AS reports_count,ROUND(AVG(e2.age)) AS average_age
2+
FROM employees e1
3+
JOIN employees e2
4+
ON e2.reports_to=e1.employee_id
5+
GROUP BY e1.employee_id,e1.name
6+
ORDER BY e1.employee_id;

0 commit comments

Comments
 (0)