SQL Practice Logo

SQLPractice Online

Scenario SQL Question

All Jobs with Employee Assignment Status (RIGHT JOIN)

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

Problem Statement

Show every department alongside the count of its employees and an assignment status: 'Has Employees' (count > 0) or 'No Employees'. Use RIGHT JOIN with employees on the LEFT and departments on the RIGHT. Return department_id, department_name, employees_assigned, assignment_status — ordered by employees_assigned DESC, department_id.

Relevant Tables

employeesdepartments

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: