Skip to content

Instantly share code, notes, and snippets.

@lbdremy
Created June 19, 2013 10:51
Show Gist options
  • Save lbdremy/5813431 to your computer and use it in GitHub Desktop.
Save lbdremy/5813431 to your computer and use it in GitHub Desktop.
Rules to follow when creating a primary key

Rules to follow when creating a primary key

  • The primary key must uniquely identify each record.
  • A record’s primary-key value can’t be null.
  • The primary key-value must exist when the record is created.
  • The primary key must remain stable—you can’t change the primary-key field(s).
  • The primary key must be compact and contain the fewest possible attributes.
  • The primary-key value can’t be changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment