SQL Practice Logo

SQLPractice Online

Scenario SQL Question

All Departments with Employee Count

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

Problem Statement

Return every department — INCLUDING departments that have zero employees — alongside the number of employees in each. Return department_id, department_name, employee_count — ordered by employee_count DESC, department_id.

Relevant Tables

departmentsemployees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: