How do primary keys and uniqueness constraints help you detect and prevent duplicate records?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Explain how primary keys and unique constraints stop duplicate rows at write time and how queries find duplicates that already exist. Tests the difference between surrogate and natural keys, composite uniqueness, NULL handling, and warehouses that do not enforce constraints.