Candidate key
A candidate key is a minimal set of attributes whose values uniquely identify each row in a relational relation.
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
- superkeykind of · A superkey is a set of one or more attributes whose values uniquely identify each row in a relation, whether or not the set is minimal.
- primary keyincludes · A primary key is a designated column or attribute, or combination of them, that uniquely identifies each row or item in a table or data store.
- natural keyincludes · A natural key is an identifier formed from meaningful domain attributes whose values uniquely identify an entity or record.
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.

