Fourth and Fifth Normal Form
Fourth and Fifth Normal Form
For a dependency A à B, multivalued dependency exist when for a single value of A1 more than one
value of B1, B2 exist in a table. For a table to have multivalued dependency, the table must have at least
three columns. If we only have two columns in a table, we can simply distribute the multivalued data
into multiple rows in the table.
A B A B
B1 A1 B1
A1
B2 A1 B2
If all these are true, then, multivalued dependency exist. Such as A - - >> B and A - - >> C.
To further understand this, consider the ‘Enrollment’ table below.
Enrollment
Here, we have a student having two courses and two hobbies. This situation leads to a database
anomalies, that is, when we remove one hobby of the student then we lost one course of the student.
Similarly, if we remove a course of the student, we also lost one hobby of the students. To avoid that
situation there is a need to insert two rows for every course or hobby added to the table.
Enrollment
Now, does it make sense? The is NO! To correct it, we split the table as show below.
Solution.
Student_Course Student_Hobby
S_id Course
1 Math
Hobby
1 Science
S_id
1 Cricket
1 Hockey
Conditions
1. It is in 4NF.
2. If we can decompose table further to eliminate redundancy and anomaly, and when we re-join
the decomposed tables by means of candidate keys, we should not be losing the original data or
any new record set should not arise. In simple words, joining two or more decomposed table
should not lose records nor create new records.
The assumption being that ABC makes both Nuts and Bolts and that CDE makes Bolts only. This table can
be decomposed into its three projections without loss of information as demonstrated below:
All redundancy has been removed, if the natural join of PI and P2 IS taken, the result is:
The spurious row as asterisked. Now, if this result is joined with P3 over the column 'company
'product_name' the following table is obtained:
This is a correct recomposition of the original table and no loss decomposition into the three projections
was achieved.