You have two tables about 1:1 calls.
callsEach row is a call attempt.
sender_id
(BIGINT) — user who initiated the call
receiver_id
(BIGINT) — user who received the call
call_time
(TIMESTAMP) — when the call was initiated (assume UTC)
picked_up
(BOOLEAN) — whether the receiver picked up
call_type
(VARCHAR) —
'video'
or
'voice'
usersuser_id
(BIGINT, PRIMARY KEY)
country
(VARCHAR)
Assume calls.sender_id and calls.receiver_id both reference users.user_id.
Return daily call volume and pickup rate by call type.
call_date
,
call_type
,
call_attempts
,
picked_up_calls
,
pickup_rate
Compute the percentage of calls that are picked up for users in a given country (parameter :country).
:country
, the fraction with
picked_up = true
.
country
,
call_attempts
,
picked_up_calls
,
pickup_rate
Compute the percentage of distinct callers (sender_id) who made at least one video call and at least one voice call in a given time window [ :start_time, :end_time ).
total_callers
,
callers_both_types
,
pct_callers_both_types
Notes: