Turn clickstream events into user sessions
A hands-on DEA-C01 lab. You produce the real artefact and 9 automated checks verify it behaves the way the exam expects.
Try this labAll DEA-C01 practice
- Certification
- DEA-C01
- Format
- SQL query
- Difficulty
- hard
- Estimated time
- 20 min
- Automated checks
- 9
The brief
Write one read-only query in session-audit.sql against web_events. Return exactly user_id, session_number, session_start, session_end, and event_count, with one row per session. event_time contains UTC epoch seconds. Order each user's events by event_time and use event_id to break ties. Number sessions from 1 separately for each user. Start a new session only when the gap from that user's previous event exceeds 30 minutes; exactly 30 minutes remains in the same session. Retain every event and order the result by user_id, then session_number.
Part of DEA-C01 preparation
Labs are written by ExamNova to teach the decisions the exam tests. They are not reproductions of vendor lab content.