Home »
DBMS
Fourth Normal Form (4NF) | DBMS
DBMS Fourth Normal Form (4NF): In this tutorial, we will learn about the fourth normal form (4NF), its properties with the help of example in the database management system.
By Anushree Goswami Last updated : May 29, 2023
What is Fourth Normal Form (4NF) in DBMS?
Fourth normal form (4NF) is a normal form used in database normalization, in which there are no non-trivial multivalued dependencies except a candidate key. After Boyce–Codd normal form (BCNF), 4NF is the next level of normalization. Although the second, third, and Boyce–Codd normal forms operate with functional dependencies, 4NF is operated with a more universal type of dependency known as a multivalued dependency.
A table or relation is in 4NF if and only if, for each attribute of its non-trivial multivalued dependencies P→Q, P is a super key—that means, P is either a candidate key or a superset thence.
Fourth Normal Form (4NF) Properties
A relation R with attributes, its values and tuples is in 4NF if and only if the following conditions are satisfied.
- The relation or table should be in the Boyce-Codd Normal Form (BCNF).
- The relation or table should not have any Multivalued Dependency.
A table which consists of a multivalued dependency breaches the normalization attainment of Fourth Normal Form (4NF) because it generates unneeded redundancies and can contribute to incompatible data which will not be inconsistency. To take this forward and up towards 4NF, it is important to divide this data and information into two tables or relations.
What is Multivalued Dependency?
Multivalued dependency takes place when there are one or more rows in a table or relation which indicates the existence of one or more other rows in the same table or relation. In another way, if we observe, two attributes (or columns) in a table or relation are not dependent on each other, but both of them depend on a third attribute. A multivalued dependency always needs a minimum of three attributes because it contains at least two attributes that are dependent on a third.
For a Functional dependency in which P holds Q (P -> Q), if for a single value of P, multiple values of Q exists, then the table or relation may have a multi-valued dependency. The table or relation should contain minimally three attributes and Q and S should not be dependent for P ->> Q multivalued dependency.
If the following points are satisfied, then a table or relation has a multivalued dependency,
- In a table, for a Functional Dependency P which holds Q (P → Q), if for a single value of P, multiple value of Q exists, then the table may have multi-valued dependency.
- Also, the condition is that a table should have at-least three columns for it to have a multivalued dependency.
- And, for a relation R(P, Q, S), if there is a multi-valued dependency between P and Q, then Q and S should not be dependent on each other.
Fourth Normal Form (4NF) Example
Consider a database table which contain student Name, Hobby and subject,
Name |
Hobby |
Subject |
Arvind | Cricket | Maths |
Sameer | Football | Science |
Rajeev | Chess | Social science |
Simran | Badminton | English |
Rajat | Singing | Hindi |
In the above table, there is no connection between the columns of Hobby and Subject. They are both independent of each other.
So there is a multivalued dependency, which assists towards unneeded repetition and redundancy of data and other anomalies as well.
To make the above relation satisfy with the fourth normal form condition and its properties, we can divide the table into two tables, which contain Name and Subject in one table and Name and Hobby in another table.
Name |
Hobby |
Arvind | Cricket |
Sameer | Football |
Rajeev | Chess |
Simran | Badminton |
Rajat | Singing |
Name |
Subject |
Arvind | Maths |
Sameer | Science |
Rajeev | Social science |
Simran | English |
Rajat | Hindi |
Now, this relation satisfied the conditions of the fourth normal form.
A table can also contain a functional dependency along with multi-valued dependency. In that case, the functionally dependent columns are transferred in a separate table and the multi-valued dependent columns are transferred to separate tables.