Your question is Finding Missing Numbers in SQL. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Ernst & Young U.S. LLP uses employee-number sequences to identify gaps in HR data loads. A missing number may indicate an incomplete extract or a record that requires investigation.
Write a PostgreSQL query that identifies every missing empnum in the expected inclusive sequence from 1001 through 1015.
emp.NULL values in the source table.missing_empnum, sorted in ascending order.| Column | Type | Description |
|---|---|---|
| emp_idPK | INTEGER | Unique row identifier |
| empnum | INTEGER | Employee number, which may contain duplicates or NULL |
| employee_name | VARCHAR(100) | Employee name when available |