Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the design criteria for primary keys?

Choosing good primary keys, candidate keys and the foreign keys that use them is a vitally important database design task -- as much art as science. The design task has very specific design criteria.

What are the criteria?

like image 591
bbadour Avatar asked Sep 03 '10 02:09

bbadour


1 Answers

The criteria for consideration of a primary key are:

  • Uniqueness
  • Irreducibility (no subset of the key uniquely identifies a row in the table)
  • Simplicity (so that relational representation & manipulation can be simpler)
  • Stability (should not be altered frequently)
  • Familiarity (meaningful to the user)
like image 181
BradC Avatar answered Oct 07 '22 01:10

BradC