SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Find All Subordinates Under a Manager

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 all employees (direct and indirect reports) who work under employee_id 5 (Emma Sales Mgr). Return employee_id, employee_name, level_under_manager, and manager_id.

Relevant Tables

employees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: