Interview practice question
Applying CDC changes with SQL
Data Engineering · SQL · Experienced
Write the logic to apply a batch of CDC changes (insert, update, delete with sequence numbers) to a target table correctly.
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Deduplicate the batch to the latest change per key using the sequence number.
- MERGE on the key.
- Delete when matched and the latest op is delete.
- Update when matched, insert when not matched and not a delete.
- Ignore changes older than what's already applied, using the stored sequence.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.