69. Gap To Next Login
LEAD(col) OVER (ORDER BY ...) peeks at a later row from the current one, which lets you compare an event to the next event without a self-join.
The logins table records one row per time a user signed in.
Task: for each login, show the user's next login date and the number of days until it. The most recent login for each user has no next login, so its gap is NULL — exclude those rows entirely (only return logins that have a following login for the same user).
Return columns user_name, login_date, next_login_date, days_to_next, ordered by user_name ascending, then login_date ascending.
This is the result for the example data above. On Submit your query is graded against this example plus 4 hidden edge cases — 5test cases in all. A sloppy query that only fits the example won't pass.