Find Gaps in a Sequence of IDs

medium
Unit 19 · Union0/2 to milestone

Order ids should run continuously from the smallest to the largest. Missing ids can mean deleted rows or failed inserts. Return every missing id between the minimum and maximum id in orders, as a column missing_id, in ascending order.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
query.sql · SQLite
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Find Gaps in a Sequence of IDs · TechGradify