Write a SQL query to analyze claims processing delays by region and month, joining claims and operations tables and calculating average delay and delayed-claim rate.
Treat a claim as delayed when processing takes more than 7 days. Include claims without a matching operation, but exclude them from the average-delay and delayed-rate denominator.
region, claim_month, average_delay_days, and delayed_claim_rate.claim_month as YYYY-MM and the rate as a percentage.| Column | Type | Description |
|---|---|---|
| claim_idPK | INT | Unique claim identifier |
| region | VARCHAR(50) | Claims processing region |
| submitted_date | DATE | Date the claim was submitted |
| Column | Type | Description |
|---|---|---|
| operation_idPK | INT | Unique operations record identifier |
| claim_id | INT | Claim processed by the operation |
| processed_date | DATE | Date the claim was processed |