liveBook · Manning

Candidate key

A candidate key is a minimal set of attributes whose values uniquely identify each row in a relational relation.

How 2 Manning books explain it

100 SQL Server Mistakes and How to Avoid Them

A candidate key is a minimal set of attributes that uniquely identifies every row in a relation.

How it is used
Uses candidate keys to ensure unique rows while preparing relations for first normal form.
How deep it goes
Defines super keys, minimality, single-attribute keys, and composite keys through relation examples.
Examples
Contrasts Sales Order Number, Purchase Order Number, and the Product Name plus Product Type Name pair.
What you can do after
Evaluate/understand whether one attribute or a minimal attribute combination uniquely identifies relation rows.

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

Grokking Relational Database Design

A minimal combination of table attributes whose values uniquely identify a row, with no removable attribute retaining that property.

How it is used
Guides selection of a primary key while designing entities and preparing tables for normalization.
How deep it goes
Defines minimal superkeys, contrasts them with superkeys and primary keys, and demonstrates minimality with a user-table combination.
Examples
Uses unique username, email, and phone_number values, plus the nonminimal username and first_name combination.
What you can do after
Evaluate/understand whether attributes uniquely identify rows without unnecessary columns and choose a primary-key candidate.

Read how Grokking Relational Database Design explains candidate 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.