What is a surrogate key?
Short answer: How is it different from a natural key? A surrogate key is an artificial, system-generated key used to uniquely identify a record in a table. It has no business meaning and is typically a number (e.g., auto-incremented ID). Surrogate Key: No business meaning. Commonly used in data warehousing and large-scale systems. Example: A column UserID that is generated automatically. Natural Key: A key that has real-world…
Explain a bit more
business meaning and is used to uniquely identify records. Example: SocialSecurityNumber or EmailAddress could serve as natural keys.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png