Product Analytics level task. **Condition:** Find users who had periods of inactivity longer than 30 days in their listening history. **Table:** listening_history (user_id, track_id, played_at, ...) **Requirements:** 1. For each user, find gaps > 30 days between listens 2. Output user_id, gap_start, gap_end, gap_days 3. Sort by gap length DESC **Hint:** LAG for previous date + calculate difference.
Sign in to solve
Start Solving