Book In the Deliveries
Medium · Upsert
INSERT ... ON CONFLICT (key) DO UPDATE SET ... is an "upsert": it inserts new rows and updates the rows whose key already exists. Inside DO UPDATE, EXCLUDED is the row you tried to insert.
Add every delivery to inventory: if the sku already exists, increase its quantity; otherwise insert a new row. The same sku can appear in several deliveries, and one INSERT ... ON CONFLICT cannot update the same row twice, so sum the deliveries per sku first. The check lists sku and quantity of the whole inventory.