SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Departments with Managers (Semi-Join)

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

Problem Statement

Find every department that contains AT LEAST ONE employee who has direct reports (i.e. is a manager). Use EXISTS. Return department_id, department_name, location — ordered by department_id.

Relevant Tables

departmentsemployees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: