SQL · Capital One · Medium
You are given two tables: users and events. The events table stores raw clickstream records and may contain multiple rows with the same event_id. For each user_id and UTC calendar day on which at least one deduplicated event exists, return exactly one row of user-day features. A day is defined by the UTC date part of ts. For a user on a single UTC day, order the deduplicated events ascending by ts. A session is a maximal sequence in that order where the gap between…
Checking your access…