Given a table of user login timestamps, write a query to calculate the average session duration, defining a session break as 30 minutes of inactivity at Twilio.
Use user_logins. A new session begins only when the gap is greater than 30 minutes. Exclude rows with null timestamps, calculate each session from its first to last login, and return the average duration in minutes.
average_session_duration_minutes.| Column | Type | Description |
|---|---|---|
| login_idPK | INT | Unique identifier for the login event |
| user_id | INT | Identifier of the user who logged in |
| login_at | TIMESTAMP | Timestamp when the user logged in |