# A MERGE pipeline keys dim_customer on email

Canonical URL: <https://datadriven.io/problems/a-merge-pipeline-keys-dimcustomer-on-email-a-customer-upda-2b5cbed4>

Domain: Pipeline Design · Difficulty: medium

## Problem

A MERGE pipeline keys dim_customer on email. A customer updated their email, the MERGE missed the match, and a duplicate row was inserted; historical lineage broke because the natural key changed. The section frames the fix in two halves: a stable surrogate key and a uniqueness assertion at write time. Apply both halves on the canvas; warehouses do not enforce primary keys for you.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/a-merge-pipeline-keys-dimcustomer-on-email-a-customer-upda-2b5cbed4)
- [System Design Interview Questions](https://datadriven.io/data-engineering-system-design)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.