Your question is Percent Missing Values by Column. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Providence's encounter data quality process needs a column-level completeness report before patient-level analytics are published. Write a PostgreSQL query that calculates the percentage of missing values for every tracked column in providence_encounters.
providence_column_catalog to identify the columns that must be reported.NULL values as missing, and include columns with no missing values.| Column | Type | Description |
|---|---|---|
| encounter_idPK | INT | Unique encounter identifier |
| patient_id | INT | Providence patient identifier |
| facility | VARCHAR(80) | Care facility name |
| acuity | VARCHAR(20) | Encounter acuity level |
| discharge_disposition | VARCHAR(40) | Discharge outcome |
| follow_up_days | INT | Days until recommended follow-up |
| Column | Type | Description |
|---|---|---|
| column_namePK | VARCHAR(80) | Name of a tracked encounter column |
| is_tracked | BOOLEAN | Whether the column belongs in the completeness report |