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 the Employee table.)

Instructions:

  1. Use the Employee table for this challenge.
  2. Name the first column "EmployeeId" and the second column "ManagerId".
  3. Use the "ReportsTo" column from the Employee table as "ManagerId".
  4. Sort your result set by "EmployeeId" using the ORDER BY clause.