Database Reference
In-Depth Information
• 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.
Before you finalize your selection of a primary key, it is imperative that you make abso-
lutely certain that the primary key fully complies with this particular element:
Itsvaluemustexclusively identifythevalueofeachfieldwithina
given record.
Each field value in a given record should be unique throughout the entire database (unless
it is participating in establishing a relationship between a pair of tables) and should have
only one exclusive means of identification—the specific primary key value for that record.
You can determine whether a primary key fully complies with this element by following
these steps.
1. Load the table with sample data.
2. Select a record for test purposes and note the current primary key value.
3. Examine the value of the first field (the one immediately after the primary key)
and ask yourself this question:
Does this primary key value exclusively identify the current value of <field-
name>?
a. If the answer is yes, move to the next field and repeat the question.
b. If the answer is no, remove the field from the table, move to the next field, and
repeat the question.
4. Continue this procedure until you've examined every field value in the record.
Afieldvaluethattheprimarykey does not exclusivelyidentifyindicatesthatthefielditself
is unnecessary to the table's structure; therefore, you should remove the field and recon-
firmthatthetablecomplieswiththeElementsoftheIdealTable.Youcanthenaddthefield
youjustremovedtoanothertablestructure, ifappropriate, oryoucandiscarditcompletely
because it is truly unnecessary.
Here's an example of how you might apply this technique to the partial table structure in
Figure 8.6 . (Note that I NVOICE N UMBER is the primary key of the table.)
Search WWH ::




Custom Search