What SQL query would you write to identify the top 10 patients by treatment adherence score?
Assume each patient can have multiple adherence observations. Calculate each patient's average non-null adherence score and exclude patients without a valid score.
patient_id, patient_name, and treatment_adherence_scorepatient_id ascending for ties| Column | Type | Description |
|---|---|---|
| patient_idPK | INT | Unique patient identifier |
| patient_name | VARCHAR(100) | Patient display name |
| Column | Type | Description |
|---|---|---|
| adherence_idPK | INT | Unique adherence observation identifier |
| patient_id | INT | Patient associated with the observation |
| observation_date | DATE | Date of the adherence observation |
| adherence_score | NUMERIC(5,2) | Adherence score for the observation, on a 0 to 1 scale |