SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Department Hierarchy with Managers

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

Problem Statement

For every employee, show their department, job title, and manager. INNER JOIN the dimension tables (departments, jobs) but LEFT JOIN to find the manager so top-level employees still appear. For top-level employees, label the manager 'Top Level'. Return employee_id, first_name, last_name, department_name, job_title, manager_label — ordered by department_id, employee_id.

Relevant Tables

employeesdepartmentsjobs

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: