Your question is Missing IDs SQL Query. Start with the requirements and the two tables 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.
Coupang's Rocket Delivery monitoring pipeline compares expected shipment IDs with shipment scan records. table_2 is the authoritative list of expected IDs, while table_1 contains observed scan events and may include duplicates, unmatched IDs, or NULLs.
Write a PostgreSQL query to identify every expected shipment ID that does not appear in the observed scan data.
table_2 as the expected population.table_1.table_2.table_1.shipment_id in ascending order.| Column | Type | Description |
|---|---|---|
| scan_idPK | BIGINT | Unique scan event identifier |
| shipment_id | BIGINT | Shipment ID detected by the scan |
| scan_status | VARCHAR(20) | Status recorded by the scan |
| Column | Type | Description |
|---|---|---|
| expected_record_idPK | BIGINT | Unique expected-shipment record identifier |
| shipment_id | BIGINT | Authoritative expected shipment ID |
| fulfillment_center | VARCHAR(20) | Coupang fulfillment center |