Healthcare Analytics Path · Mission 9 of 25Easy

Departments with no encounters

Use LEFT JOIN with IS NULL to find orphaned dimension records

Back to Healthcare Analytics

The Brief

Rita VasquezDirector of Patient Experiencequality-analytics

Dr. Okafor asked me to help audit the master data. Are there any departments in our system that have zero encounters? If so, we should either start using them or remove them from the system. Can you check?

You'll practice

LEFT JOINIS NULL

Tables available

dim_departmentsfact_encounters

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

An INNER JOIN silently drops rows with no match. You need the join variant that keeps every department regardless

Hint 2

After the outer join, filter for rows where no encounter was matched — the right-side key will be missing

Hint 3

`SELECT d.department_name, d.department_type FROM dim_departments d ___ JOIN fact_encounters e ON d.department_id = e.department_id WHERE e.encounter_id IS ___`