Employee Hierarchy
Easy
4
88.0% Acceptance
Your task is to construct an employee hierarchy by writing an SQL query.
Final Columns: Your query should return two columns:
"EmployeeId"
"ManagerId"
(This column is the"ReportsTo"
column in theEmployee
table.)
Instructions:
- Use the
Employee
table for this challenge. - Name the first column
"EmployeeId"
and the second column"ManagerId"
. - Use the
"ReportsTo"
column from theEmployee
table as"ManagerId"
. - Sort your result set by
"EmployeeId"
using theORDER BY
clause.