AlgoMaster Logo

Exercise: Gaps in Sequences

Last Updated: May 12, 2026

1 min read

For this exercise, we will work with below data:

SQL

Exercise 1

Medium

Write a query that lists every date between '2024-01-01' and '2024-01-14' on which the platform had zero stream rows. Show missing_date. Order by date ascending.

SQL

Expected Query

Expected Output

Exercise 2

Medium

Write a query that lists every missing track_number between 1 and the album's max track number. Show album_id and missing_track_number. Order by album_id, then missing track number.

SQL

Expected Query

Expected Output