Beginner

136. Natural Key

Learn what a natural key is and how it differs from an artificially generated identifier.

📘 Lesson 136 of 728 ⏱ 9 min 🎯 Intermediate

A natural key is a key based on real-world business information that already exists in the data, such as an official account number, email address, or government-issued business identifier.

Choosing an appropriate key is important for data modeling. Natural keys can have business meaning but may change or have complex formats.

A company's official registration number may serve as a natural key if it is guaranteed to be unique and stable.

SQL
CREATE TABLE Customers (
    CustomerCode VARCHAR(30) PRIMARY KEY,
    CustomerName VARCHAR(100)
);

Natural keys can be used in customer, product, account, employee, and reference-data systems when a reliable business identifier exists.

  • Natural keys come from real business information.
  • They have business meaning.
  • They should be unique if used as a key.
  • They may change over time.
  • They differ from generated surrogate keys.
What is a natural key?

A natural key is an identifier derived from real-world business information that uniquely identifies a record.

What is a disadvantage of natural keys?

They may change, be lengthy, or contain business-specific rules that make them less convenient for relationships.

Have you finished this lesson?

Introduction to SQL – All Lessons