Fifth Normal Form (5NF) in DBMS
Fifth Normal Form (5NF)
In the world of relational database design, normalization plays a crucial role in reducing data redundancy and ensuring data integrity. The Fifth Normal Form (5NF), sometimes referred to as Project-Join Normal Form (PJ/NF), is one of the more complex normalisation stages. It is a refinement over the Fourth Normal Form (4NF) and focuses specifically on eliminating join dependencies while maintaining lossless decomposition.
What is 5NF?
Fifth Normal Form is applied to a relationship if:
- It is already in 4NF.
- It contains no non-trivial join dependencies.
- All joins are lossless, meaning they preserve the original data when decomposed and recombined.
To put it another way, 5NF makes sure that a complex connection can be divided into smaller relations without introducing redundancy or losing data.The decomposition must be such that no meaningful join dependency remains, except the trivial ones or those that are implied by candidate keys.
Machine Learning Tutorial:–Click Here
Data Science Tutorial:-Click Here
Complete Advance AI topics:-Â CLICK HERE
Deep Learning Tutorial:-Â Click Here
Understanding Key Concepts
Join Dependency (JD)
A join dependency occurs when a relation can be reconstructed by joining multiple projections (subsets of attributes) of itself. A JD is trivial if one of the projections is the entire relation itself.
Lossless Decomposition
A lossless decomposition is one where no data is lost during the process of splitting a relation into smaller ones. When these relations are joined back together, they should reproduce the original relation without any additional or missing tuples.
Example 1: Fact_Comp_Proj Relation
Consider a relation Fact_Comp_Proj
:
Factory | Component | Project |
---|---|---|
GM | Engine | MPC |
GM | Gear box | 125 A |
Honda | Engine | 125 A |
GM | Engine | 125 A |
Due to the absence of multivalued dependencies, this relation is in 4NF. It can be broken down into the three sub-relations shown below:
R1 (Factory, Component):
Factory | Component |
---|---|
GM | Engine |
GM | Gear box |
Honda | Engine |
R2 (Component, Project):
Component | Project |
---|---|
Engine | MPC |
Gear box | 125 A |
Engine | 125 A |
R3 (Factory, Project):
Factory | Project |
---|---|
GM | MPC |
GM | 125 A |
Honda | 125 A |
These relations, when joined, recreate the original relation. Hence, a join dependency exists. However, not all sub-relations include a candidate key. For instance, R1 lacks the Project attribute. Therefore, Fact_Comp_Proj
is not in 5NF, though R1, R2, and R3 are each in 5NF.
Now, if we add the tuple (Honda, Gear box, MPC)
, it breaks the existing join dependency, making Fact_Comp_Proj
eligible for 5NF.
Example 2: RANKING Relation
Consider the following relation:
Factory# | Fact_name | Position | City |
---|---|---|---|
F01 | Volvo | 17 | Mumbai |
F11 | Honda | 22 | Chennai |
F15 | Maruti | 26 | Gurgaon |
F25 | GM | 37 | Chandigarh |
This relation has two candidate keys: Factory#
and Fact_name
. It satisfies two join dependencies:
- JD1 → ((Factory#, Fact_name, Position), (Factory#, City))
- JD2 → ((Factory#, Fact_name, Position), (Factory#, Position), (Fact_name, City))
Since each component relation involved in these dependencies contains a candidate key, the original relation is in 5NF.
Example 3: SUBJECT–LECTURER–SEMESTER Relation
Subject | Lecturer | Semester |
---|---|---|
Computer | Anshika | Semester 1 |
Computer | John | Semester 1 |
Math | John | Semester 1 |
Math | Akash | Semester 2 |
Chemistry | Praveen | Semester 1 |
This relation might seem fine at first, but issues arise when new semesters are introduced without information on subjects or lecturers. Since all three attributes form the primary key, NULLs are not allowed. To resolve this, we decompose it into the following:
P1 (Semester, Subject):
Semester | Subject |
---|---|
Semester 1 | Computer |
Semester 1 | Math |
Semester 1 | Chemistry |
Semester 2 | Math |
P2 (Subject, Lecturer):
Subject | Lecturer |
---|---|
Computer | Anshika |
Computer | John |
Math | John |
Math | Akash |
Chemistry | Praveen |
P3 (Semester, Lecturer):
Semester | Lecturer |
---|---|
Semester 1 | Anshika |
Semester 1 | John |
Semester 2 | Akash |
Semester 1 | Praveen |
This decomposition removes redundancy and brings the relation into 5NF.
Important Points on 5NF
- Join dependencies that are not suggested by candidate keys are removed by 5NF.
- All 5NF relationships are also in 4NF, but not the other way around.
- 5NF is especially useful in handling cyclic join dependencies involving more than two tables.
- Testing 5NF typically requires checking for hidden join dependencies by decomposing into three or more relations.
Disadvantages of 5NF
While 5NF offers optimal data integrity and minimal redundancy, it comes with a cost:
- Increased complexity due to a higher number of tables.
- Slower query performance, especially in join-intensive operations.
- Maintenance overhead for managing highly decomposed structures.
Complete Python Course with Advance topics:-Click Here
SQL Tutorial :-Click Here
Download New Real Time Projects :–Click here
Conclusion
5NF is a powerful but advanced concept in database normalization. It is essential when designing databases that require maximum integrity and minimum redundancy, especially in large-scale systems with complex data relationships. However, its practical application should be balanced against performance and design complexity.
5nf in dbms
fifth normal form example
fifth normal form is concerned with
join dependency and 5nf in dbms
6th normal form
join dependency in dbms
4th normal form in dbms
fourth normal form
fifth normal form 5nf pdf
fifth normal form 5nf example
fifth normal form 5nf dbms
fifth normal form 5nf dbms example
Post Comment