Online periods for RU on February 13, 2025, pause 60 min
Instructions
A user's session is a run of the user's events (by event_time) in which the pause between consecutive events is at most 60 minutes; a pause strictly longer than 60 minutes starts a new session (a pause of exactly 60 minutes does not break a session). Do not use the session_id column. Sessions are built from all events of a user; a session interval runs from its first to its last event. Take the sessions of users from the country 'RU' that started on February 13, 2025 (by the first event) and merge overlapping intervals of different users into periods during which at least one of them was in the app (intervals where the start of one equals the end of another also merge). For each period, output period_start, period_end, sessions_cnt (the number of sessions in it) and minutes (the length of the period in minutes, rounded to 1 decimal place). Sort by period_start.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Table relationships
- N:1Many-to-one
events.→user_id users.id - N:1Many-to-one
purchases.→user_id users.id
Table data
Select a table in the diagram or list to view its rows.