Write a simple SQL query involving JOINs and subqueries.
Use the provided customer, policy, and claim tables. Return customers whose total approved claim amount is greater than the average approved claim amount across all approved claims.
customer_id, customer_name, total_approved_claimstotal_approved_claims descending, then customer_id ascending| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer name |
| Column | Type | Description |
|---|---|---|
| policy_idPK | INT | Unique policy identifier |
| customer_id | INT | Customer who owns the policy |
| policy_number | VARCHAR(30) | Business policy number |
| policy_status | VARCHAR(20) | Current policy status |
| Column | Type | Description |
|---|---|---|
| claim_idPK | INT | Unique claim identifier |
| policy_id | INT | Policy associated with the claim |
| claim_status | VARCHAR(20) | Current claim status |
| claim_amount | DECIMAL(12,2) | Claim amount |