Active Customer Analysis
Beginner Mode
Objective
Write a SQL query to find the number of policy holders who made three or more calls to customer support.
Table Schema:
callers
| Column | Type | Description |
|---|---|---|
| policy_holder_id | INTEGER | Unique identifier for the policy holder |
| case_id | VARCHAR | Unique identifier for each support call |
| call_category | VARCHAR | Category of the call (e.g., billing, claims, general inquiry) |
| call_date | DATE | Date when the call was made |
| call_duration_secs | INTEGER | Duration of the call in seconds |
Task Requirements:
- Count the number of calls per policy holder using case_id
- Filter for policy holders with 3 or more calls
- Return the total count of such policy holders
Output columns: policy_holder_count
Examples
Example 1:
Output:
Input:
| callers | ||||
|---|---|---|---|---|
| call_category | call_date | call_duration_secs | case_id | policy_holder_id |
| billing | 2024-01-10 | 300 | C001 | 101 |
| claims | 2024-02-15 | 450 | C002 | 101 |
| general | 2024-03-20 | 200 | C003 | 101 |
| billing | 2024-01-25 | 350 | C004 | 102 |
| claims | 2024-02-28 | 400 | C005 | 102 |
| general | 2024-03-05 | 250 | C006 | 103 |
| policy_holder_count |
|---|
| 1 |
Code Environment
Sign in or try as guest to run your code.
Track
| Question | Difficulty | Company | Access |
|---|
Need more practice in this area? Explore more questions →
Amazon