Problem Description

In LoginLogs(user_id, logged_at), start a new session if gap > 30 minutes. Assign session_number per user.

Input Format

SQL query

Output Format

Result set

Sample Test Case

Input:
LoginLogs(user_id, logged_at)
Output:
Rows with session_number

Constraints

Use LAG + SUM over gaps

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next