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.
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.