Elements of a Primary Key

  • It cannot be a multipart field.

  • It must contain unique values.

  • It cannot contain null values.

  • Its value cannot cause a breach of the organization's security or privacy rules.

  • Its value is not optional in whole or in part.

  • It comprises a minimum number of fields necessary to define uniqueness.

  • Its values must uniquely and exclusively identify each record in the table.

  • Its value must exclusively identify the value of each field within a given record.

  • Its value can be modified only in rare or extreme cases.

Rules for Establishing a Primary Key

  • Each table must have one—and only one—primary key.

  • Each primary key within the database must be unique—no two tables should have the same primary key unless ...

Get Database Design for Mere Mortals™: A Hands-On Guide to Relational Database Design, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.