This question evaluates proficiency in time-based data manipulation and analytics, including handling repeated churn and resubscription, interval logic, deduplication, and per-user metric derivation using SQL and Python.
As part of analyzing the same promotion experiment, you need SQL that handles users who churn and later resubscribe.
Assume the following tables:
Key relationship: experiment_assignments.user_id = subscription_periods.user_id. All timestamps are in UTC.
For users assigned between 2025-01-01 00:00:00 UTC and 2025-01-31 23:59:59 UTC, write SQL that returns one row per assigned user with the following columns:
After producing the user-level result, explain how you would aggregate it to variant-level conversion and 30-day retention metrics.