5. Normalization - 6marks Flashcards
A function dependency (FD) is
a constraint denoted X Y between two sets of attributes X and Y from a relational schema R.
The FD specifies a restriction on
the possible tuples that can form a relation instance r of R
The inference rules for normalization are:
Acronym to remember: RATDUP
- Reflexive Rule: A set of attributes or a subset always determines itself and its superset.
- Augmentation Rule: Adding an additional attribute to both sides of a relation means it holds.
- Transitive Rule: eg X –> Y , Y –> Z | = X –> Z
- Decomposition Rule: If there is more than one attribute on the RHS this can be split (eg: X –> YZ |= X –> Y and X –> Z
- Union Rule: The opposite of decomposition, combining.
- Pseudotransitive Rule: Variation on rule 3: Eg: X –> Y , WY –> Z | = WX –> Z
First Normal Form (1NF) is:
• Normal DB form, with no violations (only atomics values, no redundancy, few null)
Second Normal Form (2NF) is:
• 1NF with No Partial dependency - so every non-prime attribute is fully functionally dependent on every key
(ie: fails 2NF if only part of the minimal key determines an attribute in that table)
Third Normal Form (3NF) is:
• 2NF with No Transitive dependency (ie: fails 3NF if A –> B and B –> C )
Boyce-Codd NF (BCNF) is:
• 3NF but with the LHS of functional dependencies are super keys.
Note that 3NF can be better than BCNF
General steps to achieve the highest normal form (to 3NF) are:
- Identify candidate keys
- What is the highest normal form
- Decompose if it is not in the highest normal form