Your question is Top Meds Per Region SQL. 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.
Aetna wants a regional view of medication utilization from its claims data. Write a PostgreSQL query that identifies the three most prescribed medications in each region during the first quarter of 2025.
claim_status = 'Approved' and dates from January 1 through March 31, 2025.| Column | Type | Description |
|---|---|---|
| prescription_idPK | INT | Unique prescription claim identifier |
| region_id | INT | References the service region |
| medication_id | INT | References the prescribed medication |
| prescribed_date | DATE | Date on which the medication was prescribed |
| claim_status | VARCHAR(20) | Claim processing status |
| Column | Type | Description |
|---|---|---|
| medication_idPK | INT | Unique medication identifier |
| medication_name | VARCHAR(100) | Generic or brand medication name |
| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique service region identifier |
| region_name | VARCHAR(50) | Aetna service region name |