SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Find Employees and Their Direct Reports Count

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

Problem Statement

Write a query to find each manager and count how many employees report directly to them. Return manager_id, manager_name, and total_reports. Include all employees (even those with 0 reports).

Relevant Tables

employees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: