Given a schema with member enrollments and medical claims, write a query to calculate the average time elapsed between a member's enrollment date and their first clinical claim.
Treat claims dated on or after enrollment as eligible clinical claims, and exclude members without one. Use the provided tables and return the average elapsed time in days.
average_days_elapsed| Column | Type | Description |
|---|---|---|
| member_idPK | INT | Unique Oscar member identifier |
| enrollment_date | DATE | Date the member's coverage began |
| Column | Type | Description |
|---|---|---|
| claim_idPK | INT | Unique medical claim identifier |
| member_id | INT | Member associated with the claim |
| claim_date | DATE | Date the claim was submitted or incurred |
| claim_type | VARCHAR(30) | Claim category, such as clinical, dental, or pharmacy |