Sessions on ios by day, week of May 12, 2025, pause 120 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 120 minutes; a pause strictly longer than 120 minutes starts a new session (a pause of exactly 120 minutes does not break a session). Do not use the session_id column. Sessions are built from all events of a user. For users with platform 'ios', count by day from May 12, 2025 to May 18, 2025 inclusive the sessions that started on that day (by the time of the first event; a session that crosses midnight belongs to its start day): sessions (the number of sessions), avg_events (the average number of events per session, rounded to 2 decimal places) and avg_minutes (the average session duration from first to last event in minutes, rounded to 1 decimal place). Do not output days without sessions. Output day (type date), sessions, avg_events, avg_minutes. Sort by day.
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.