Use LEFT JOIN with IS NULL to find orphaned dimension records
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?
Each hint you reveal reduces the XP you can earn. Try the query first.
An INNER JOIN silently drops rows with no match. You need the join variant that keeps every department regardless
After the outer join, filter for rows where no encounter was matched — the right-side key will be missing
`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 ___`