Fourth Normal Form (4NF)
Fourth Normal Form (4NF)
Introduction
Before diving into the concept of Fourth Normal Form (4NF), it’s essential to understand multivalued dependencies. These arise as a result of First Normal Form (1NF), which restricts an attribute in a tuple from holding multiple values.
While earlier normal forms—1NF, 2NF, 3NF, and Boyce-Codd Normal Form (BCNF)—focus primarily on functional dependencies, they do not fully address anomalies that can occur when multivalued dependencies are present. Even a relation in BCNF can suffer from insertion, deletion, or update anomalies if multivalued dependencies are not resolved.
To address this, Fourth Normal Form (4NF) was introduced.
Machine Learning Tutorial:–Click Here
Data Science Tutorial:-Click Here
Complete Advance AI topics:-Â CLICK HERE
Deep Learning Tutorial:-Â Click Here
What is Fourth Normal Form?
A relation is in 4NF if:
- It is already in Boyce-Codd Normal Form (BCNF), and
- It has no multivalued dependencies.
In simpler terms, if a single attribute in a table determines multiple independent values of another attribute, a multivalued dependency exists. These need to be separated into different tables to achieve 4NF.
Example 1: Employee Relation
Consider the following Employee
relation:
Emp_Name | Equipment | Language |
---|---|---|
Anurag | Personal Computer | English |
Anurag | Personal Computer | French |
Anurag | Mainframe | English |
Anurag | Mainframe | French |
Kapil | Personal Computer | English |
Kapil | Personal Computer | French |
Kapil | Personal Computer | Japanese |
In this case:
- Each employee is associated with multiple pieces of equipment, and
- Each employee is also associated with multiple languages,
- But equipment and language are independent of each other.
Thus, we identify two multivalued dependencies:
Emp_Name →→ Equipment
Emp_Name →→ Language
To convert this into 4NF, we decompose the original relation into two separate tables:
Emp_Equip
Emp_Name | Equipment |
---|---|
Anurag | Personal Computer |
Anurag | Mainframe |
Kapil | Personal Computer |
Emp_Lang
Emp_Name | Language |
---|---|
Anurag | English |
Anurag | French |
Kapil | English |
Kapil | French |
Kapil | Japanese |
Both new relations are now in Fourth Normal Form, with no multivalued dependencies and non-lossy decomposition (i.e., no data is lost in the process).
Example 2: Student Relation
Consider a STUDENT
table:
STU_ID | COURSE | HOBBY |
---|---|---|
21 | Computer | Dancing |
21 | Math | Singing |
34 | Chemistry | Dancing |
74 | Biology | Cricket |
59 | Physics | Hockey |
Here, COURSE and HOBBY are independent attributes related to the same student. For instance, student 21 is enrolled in two courses and has two hobbies. This causes unnecessary repetition and reflects a multivalued dependency on STU_ID
.
To bring this relation into 4NF, we split it into:
STUDENT_COURSE
STU_ID | COURSE |
---|---|
21 | Computer |
21 | Math |
34 | Chemistry |
74 | Biology |
59 | Physics |
STUDENT_HOBBY
STU_ID | HOBBY |
---|---|
21 | Dancing |
21 | Singing |
34 | Dancing |
74 | Cricket |
59 | Hockey |
These decompositions remove redundancy and ensure the relation adheres to 4NF principles.
Frequently Asked Questions on 4NF
1. What are the benefits of Fourth Normal Form?
- Improved database performance
- Elimination of redundant data
- Enhanced data consistency and integrity
2. How can a database be transformed into 4NF?
To achieve 4NF, the following techniques are recommended:
- Partitioning tables to isolate independent multivalued attributes
- Creating additional tables to represent those attributes separately
- Establishing foreign key relationships between the new and original tables
Complete Python Course with Advance topics:-Click Here
SQL Tutorial :-Click Here
Download New Real Time Projects :–Click here
Final Thoughts
Fourth Normal Form is essential for designing efficient, maintainable, and consistent databases. It ensures that multivalued data is stored logically, preventing redundancy and anomalies that may otherwise compromise data integrity.
If you’re working on complex data models, especially where multiple independent attributes exist per key, adopting 4NF is a critical step toward robust database design.
5nf in dbms
4th normal form in dbms
4th normal form example
fourth normal form in dbms with example
5th normal form
fifth normal form example
join dependency and fifth normal form
4nf and 5nf in dbms with example
fourth normal form 4nf example
fourth normal form 4nf java
Post Comment