Grokking the Data Engineering Interview
Vote

0% completed

​

CDC Into a Warehouse: Applying Changes and Failures

The statement below applies one batch of change events from a car rental company's reservations database to the warehouse table of current reservations. Batch 1 was applied first in the same way.

INSERT INTO reservations_current (reservation_id, branch, status, total_cents, is_deleted, last_seq) SELECT * FROM ( SELECT e.reservation_id, e.branch AS new_branch, e.status AS new_status, e.total_cents AS new_total, e.op = 'd' AS new_del, e.seq AS new_seq FROM reservation_events e WHERE e.batch_id = 2 AND e.seq = (SELECT MAX(x

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content