liveBook · Manning

Natural key

A natural key is an identifier formed from meaningful domain attributes whose values uniquely identify an entity or record.

How 3 Manning books explain it

100 SQL Server Mistakes and How to Avoid Them

A natural key is a key formed from attributes that have inherent business meaning and identify an entity.

How it is used
Uses natural keys to identify entities and connect normalized relations through primary and foreign keys.
How deep it goes
Defines natural, artificial, and composite keys, then relates composite keys to functional dependency in 2NF.
Examples
Uses SocialSecurityNumber and EmployeeID, then models email, company, area, and product attributes in sales relations.
What you can do after
Evaluate/understand whether a business attribute can identify an entity or whether an artificial key is needed.

Read how 100 SQL Server Mistakes and How to Avoid Them explains natural key →

Java Persistence with Spring Data and Hibernate epub

A natural key is a primary key derived from meaningful attributes of the represented entity or domain data.

How it is used
Guides primary-key selection by testing whether business attributes provide stable identity for persistent entities.
How deep it goes
Explains business meaning, stability requirements, candidate keys, and foreign-key consequences, but does not develop composite-key implementation details.
Examples
Uses Social Security Number, Australian Tax File Number, item numbers, and USERNAME as business-meaningful key examples.
What you can do after
Evaluate/understand when a natural key threatens schema stability and when a surrogate key better separates database identity from business data.

Read how Java Persistence with Spring Data and Hibernate epub explains natural key →

Functional Design and Architecture: Examples in Haskell

A natural key is a database key formed from one or more attributes that have inherent meaning in the represented domain.

How it is used
Guides relational key design by exposing when meaningful domain fields should yield to a surrogate identifier.
How deep it goes
Explains composite natural-key drawbacks and contrasts surrogate keys, stopping short of a general key-selection procedure.
Examples
Uses meteor records, a FLOAT/FLOAT/TIMESTAMP composite key, floating-point comparisons, and integer or UUID identifiers.
What you can do after
Evaluate database key designs by testing precision, query cost, relationship overhead, and expected field changes.

Read how Functional Design and Architecture: Examples in Haskell explains natural key →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.