Standards to create the constraints

Rule

  1. Each table must have one or more unique identifiers. At least one must be implemented as a primary key.
  2. The unique identifier must have true business meaning where possible, and not simply be a generated sequence number. A surrogate key may be used where performance considerations would warrant it.
  3. If relationships exist between tables then they should be enforced using a foreign key constraint (unless triggers are being used to enforce advanced RI)
  4. Check constraints must be used to restrict the allowable values of columns for appropriate business rules where the list of values is relatively small.

Guidlines

  1. Primary keys constraints should be named PK_<table name>
  2. Alternate/unique constraint should be named AK_<table name>_<seq>
  3. Foreign keys constraints should be named FK_<table name>_<seq>
  4. Default constraints should be named DF_<constraint name>
  5. Check constraints must be named CC_<constraint name>