Sessionization and gap-based grouping
 

Assume a session is a series of events for the same user where consecutive events are no more than 30 minutes apart. Assign session numbers per user, show session start, end, duration (in minutes), and event count.

These are the tables to query for this question:
bootcamp.logs
    Your answer should include these columns:
    • user_id varchar
    • session_num bigint
    • session_start timestamp
    • session_end timestamp
    • duration_minutes bigint
    • event_count bigint

    Querying is only for logged in users!

    Sign In

    Query Results