Uncategorised Call Percentage
Beginner Mode
Objective
Write a SQL query to calculate the percentage of calls that cannot be categorised.
Table Schema:
- callers
| Column | Type | Description |
|---|---|---|
| policy_holder_id | INTEGER | ID of the caller |
| case_id | VARCHAR | Unique case identifier |
| call_category | VARCHAR | Category of the call (e.g., 'billing', 'claims', 'n/a', or NULL) |
| call_date | DATE | Date of the call |
| call_duration_secs | INTEGER | Duration of the call in seconds |
Task Requirements:
- A call is uncategorised if
call_categoryis'n/a'orNULL - Calculate the percentage of uncategorised calls out of all calls
- Round the result to 1 decimal place
Output columns: uncategorised_pct
Examples
Example 1:
Output:
Input:
| callers | ||||
|---|---|---|---|---|
| call_category | call_date | call_duration_secs | case_id | policy_holder_id |
| billing | 2023-01-05 | 300 | C001 | 1 |
| n/a | 2023-01-06 | 180 | C002 | 2 |
| claims | 2023-01-07 | 420 | C003 | 3 |
| null | 2023-01-08 | 250 | C004 | 4 |
| billing | 2023-01-09 | 350 | C005 | 5 |
| n/a | 2023-01-10 | 190 | C006 | 6 |
| enrollment | 2023-01-11 | 510 | C007 | 7 |
| uncategorised_pct |
|---|
| 42.9 |
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 →
Accenture