b_book1.gif (162 bytes)Data analysis | Database
Defined

Unique identifier - Key selection & design

KS-1

danorm2.gif (3831 bytes)

Selecting  primary key

  1. Will not change it's value for the life of the instance.
    Eg. Lastname a poor choice since in a persons life may change (eg. married).
  2. Value can never be null. (If you have a compound key - all key attributes cannot be null).
  3. Avoid intelligent keys, such as classifications or locations. Often change when conditions change.
  4. Consider creating a single-attribute key for large composite keys.
    Eg. Course:Module:Class (CBC:HF100:1) with a numeric key.

b_ref.gif (1385 bytes)(1992) Bruce

Key design

Identification keys need to be easy to write, easy to read, and easy to hear. There are several rules to follow when designing keys:

Acknowledgement: S. Corich EIT 1998: [Rev 11/10/98] 13/6/97  © 1997-98 V/2-Com (Verhaart), P O Box 8415, Havelock North, New Zealand.