It’s time to determine the candidate keys .
Recall that a CK is one or more attributes that with which you can determine all other attributes in the relation.
To find the candidate keys:
Begin by selecting a start box . If there is a box at which no arrow is pointing, this is usually a good place start.
Follow the outwards arrows to the next box, and from this box to the next and so forth.
The goal is to find find a way that covers all boxes.
If you can’t cover all boxes, try another starting box.
If no single attribute is able to cover all boxes by itself, the CK needs to include one or more additional attributes.
There can be many candidate keys, so repeat this until you are sure you haven’t missed anything.
If no arrow points at a box, the rule is that it must be part of all CK:s. This includes stand-alone boxes like F .
A candidate key is a minimal super key. Minimal means that you can’t remove any attribute from the key and still determine all other attributes.
Note that you can still have keys of different sizes.
0 Comments