The first step in normalization is to find all of the keys of a relation. Here are some facts that can help find the keys:
If an attribute is in none of the FDs, then it is in every key.
If an attribute occurs on the right-hand side of an FD, but never occurs on the left-hand side, then it is never in a key.
If an attribute occurs on the left-hand side of an FD, but never occurs on the right-hand side, then it is in every key.
- If an attribute occurs both on the right-hand side an FD and the left-hand side of an FD, then one cannot say anything about the attribute.
To find the keys, identify which attributes are in each of the cases above. The ones in the first and third cases must be in every key. Call this set of attributes the core. Compute the attributes that are determined by the core. This is called the closure of the core. If all of the attributes are in the closure of the core, then the core is not only a key, it is also the only key. If the closure of the core is not the entire set of attributes, then some will be missing. Write down this set of attributes, and remove any attribute that is in the second set above (i.e., it occurs on the right-hand side of an FD, but never occurs on the left-hand side). These are the exterior attributes. To get a key one must add one or more exterior attributes to the core. Accordingly, add them to the core, first one at a time, then two at a time, and so on, until every key has been found.