What do people watch second?

MediumNetflixrow_numberlagdate math· 20 XP

Netflix's onboarding team wants to know how soon new users come back for a second session, and what they watch.

For every user with at least two sessions, show the title_id of their second session and the number of days between the dates of their first and second sessions. Order each user's sessions by start_ts, then session_id.

Expected output

  • Any row order

Example of the shape (made-up values):

user_id title_id days_after_first
5 140 3

Hints, the later steps and the answer come with Pro.

Write your query here. Ctrl + Enter submits.