Sessions of user 1215: pause over 105 minutes
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 105 minutes; a pause strictly longer than 105 minutes starts a new session (a pause of exactly 105 minutes does not break a session). Do not use the session_id column. Split all events of the user with user_id = 1215 into sessions. For each session, output session_no (its number: 1, 2, … in time order), session_start and session_end (the times of the first and last event), events_cnt (the number of events) and duration_min (the time from the first to the last event in minutes, rounded to 1 decimal place). Sort by session_no.
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.