Your question is SQL Top Entities by Negative Outcome. Start with the requirements and the three 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.
athenahealth uses encounter and outcome data to monitor operational performance across providers. Write a PostgreSQL query to identify the providers with the highest rate of negative encounter outcomes during the last completed calendar quarter.
Treat DENIED and DELAYED outcomes as negative. The rate is negative outcomes divided by all qualifying encounters, including encounters with no recorded outcome.
provider_id ascending.| Column | Type | Description |
|---|---|---|
| provider_idPK | INT | Unique provider identifier |
| provider_name | VARCHAR(100) | Provider display name |
| Column | Type | Description |
|---|---|---|
| encounter_idPK | INT | Unique encounter identifier |
| provider_id | INT | Provider associated with the encounter |
| encounter_date | DATE | Date the encounter occurred |
| Column | Type | Description |
|---|---|---|
| encounter_idPK | INT | Encounter associated with the outcome |
| outcome_status | VARCHAR(20) | Recorded encounter outcome status |