Last Updated: May 12, 2026
For this exercise, we will work with below data:
Write a query that returns the distinct streaming dates for each user, ordered by user_id then stream_date. Show user_id and stream_date. Cast started_at to a date.
Using LEAD, write a query that returns each user's stream dates alongside their next stream date. Show user_id, stream_date, and next_stream_date. Order by user_id then stream_date.
Write a query that lists all dates between 2024-01-10 and 2024-01-22 (inclusive) on which no user streamed anything. Show missing_date ordered ascending.