Table: Calls
+----------------+--------------+ | Column Name | Type | +----------------+--------------+ | call_id | INT | | caller_id | INT | | recipient_id | INT | | call_type | VARCHAR(255) | | call_timestamp | DATE | +----------------+--------------+Each row represents a call from a caller to a recipient.
Table: Users
+-------------+--------------+ | Column Name | Type | +-------------+--------------+ | user_id | INT | | country | VARCHAR(255) | +-------------+--------------+Each row contains a user's country.
Use the seven calendar dates ending on the maximum call date. The eligible population is every distinct caller or recipient in that window. Return the percentage of eligible users who initiated more than 10 calls. Round the 0 to 100 percentage to 2 decimals and return 0 for empty input.
Return the result table in any order.
The result format is shown below.
Example
Input:
Calls table: +---------+-----------+--------------+-----------+----------------+ | call_id | caller_id | recipient_id | call_type | call_timestamp | +---------+-----------+--------------+-----------+----------------+ | 1 | 1 | 2 | voice | 2026-08-30 | | 2 | 1 | 2 | voice | 2026-08-30 | | 3 | 1 | 2 | voice | 2026-08-30 | | 4 | 1 | 2 | voice | 2026-08-30 | | 5 | 1 | 2 | voice | 2026-08-30 | | 6 | 1 | 2 | voice | 2026-08-30 | | 7 | 1 | 2 | voice | 2026-08-30 | | 8 | 1 | 2 | voice | 2026-08-30 | | 9 | 1 | 2 | voice | 2026-08-30 | | 10 | 1 | 2 | voice | 2026-08-30 | | 11 | 1 | 2 | voice | 2026-08-30 | | 12 | 3 | 2 | video | 2026-08-30 | +---------+-----------+--------------+-----------+----------------+Output:
+----------+ | user_pct | +----------+ | 33.33 | +----------+Explanation:
User1initiated eleven calls and qualifies. Users2and3are also participants, so one of three eligible users qualifies.
Accepted
1/1
Acceptance Rate100.0%
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
-
Output
-
Expected
-