SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Find All Managers in Reporting Chain (Path to CEO)

Build mastery in Self Joins Hierarchical with this scenario-based SQL challenge and live execution support.

Problem Statement

Write a recursive CTE query to find the complete reporting chain from employee_id 10 (Jack Engineer) up to the CEO. Return employee_id, employee_name, manager_id, and level (employee=1, CEO=highest).

Relevant Tables

employees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: