Use COUNT to aggregate rows in a fact table
quick — how many total encounters do we have on record? just one number. board wants volume stats by noon.
| Column | Type | Key |
|---|---|---|
| encounter_id | INT | PK |
| patient_id | INT | FK → dim_patients |
| provider_id | INT | FK → dim_providers |
| department_id | INT | FK → dim_departments |
| admit_date | TEXT | |
| discharge_date | TEXT | |
| diagnosis_code | TEXT | |
| diagnosis_description | TEXT | |
| encounter_type | TEXT | |
| discharge_disposition | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
Whole-table aggregate — one summary row over the encounter fact table.
COUNT over every row. No GROUP BY, no WHERE.
COUNT(*) tallies every row including those with NULL columns; COUNT(column) would skip NULLs. Pick the one that answers 'how many encounters'.