You are given a dataset with missing values; how do you proceed?
Write a SQL query that profiles missing values in NHS activity records by site. Include sites with no activity records and treat missing site names as Unnamed site.
site_code, site_name, total_records, missing counts for each activity field, missing_value_count, and missing_value_rate_pct.site_code ascending.| Column | Type | Description |
|---|---|---|
| site_idPK | INTEGER | Unique NHS site identifier |
| site_code | VARCHAR(20) | Short NHS site code |
| site_name | VARCHAR(100) | Display name of the NHS site |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INTEGER | Unique activity record identifier |
| site_id | INTEGER | NHS site associated with the activity |
| activity_date | DATE | Date of the recorded activity |
| completed_attendances | INTEGER | Number of completed attendances |
| cancellations | INTEGER | Number of cancellations |
| postcode | VARCHAR(30) | Postcode associated with the activity |