Your question is SQL Rolling 30-Day Claims Average. 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.
Blue Cross and Blue Shield of Kansas needs a daily claims-volume trend for its active plan products. Write a PostgreSQL query that calculates the trailing 30-calendar-day average number of finalized claims for each active plan.
PAID or DENIED; exclude PENDED and VOID claims.| Column | Type | Description |
|---|---|---|
| plan_codePK | VARCHAR(20) | Unique plan product identifier |
| plan_name | VARCHAR(100) | Plan product display name |
| active_from | DATE | Product activation date |
| active_to | DATE | Product deactivation date |
| Column | Type | Description |
|---|---|---|
| claim_idPK | INT | Unique claim identifier |
| plan_code | VARCHAR(20) | Associated plan product code |
| service_date | DATE | Date of service |
| status | VARCHAR(20) | Claim adjudication status |