Provider Analytics Path · Mission 6 of 30Easy

Who's currently admitted?

Use WHERE IS NULL to filter for active admissions and JOIN to get patient names

Back to Provider Analytics

The Brief

James HartwellVP of Operationsslack-dm

how many patients are currently admitted? discharge_date is null for anyone still here. need count and their names + admit dates. capacity meeting at 8.

You'll practice

WHERE IS NULLJOIN

Tables & columns available

fact_encountersfact10 columns
ColumnTypeKey
encounter_idINTPK
patient_idINTFK → dim_patients
provider_idINTFK → dim_providers
department_idINTFK → dim_departments
admit_dateTEXT
discharge_dateTEXT
diagnosis_codeTEXT
diagnosis_descriptionTEXT
encounter_typeTEXT
discharge_dispositionTEXT
dim_patientsdim9 columns
ColumnTypeKey
patient_idINTPK
first_nameTEXT
last_nameTEXT
date_of_birthTEXT
genderTEXT
insurance_typeTEXT
zip_codeTEXT
primary_languageTEXT
is_deceasedINT

Hints (3)

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

Hint 1

Two-table join from encounters to patients, with a NULL-filter on the discharge column to find still-admitted patients.

Hint 2

WHERE the discharge column IS NULL, then project the patient name fields and admit date.

Hint 3

NULL discharge here means 'not yet discharged' — valid data, not dirty data. The filter operator is IS NULL, not = NULL.