Paths Subjects Questions Quizzes Pricing Search
Intermediate Open Pro

Sessions from an Event Log, Then a Funnel

Using the events table:

  1. Write a query that assigns a session_id to every event, where a new session starts when the gap from the user's previous event exceeds 30 minutes. Explain the two-window pattern.
  2. Extend it to return, per session, its start time, duration, and whether it contained a purchase.
  3. Write a per-session funnel: number of sessions with a view, with a view followed later by add_to_cart, and with viewadd_to_cartpurchase in that order. Explain why comparing timestamps matters.

Share this question

← Back to SQL for Data Analysis practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.