Categories: DBMS

Fifth Normal Form (5NF)

What is 5NF?

The fifth normal form, or 5NF, is also called the project-join normal form. If a relation is in 4NF and does not have lossless decomposition into smaller tables, it is in Fifth Normal Form (5NF). If redundancy is avoided, 5NF is satisfied when all tables are divided into as many tables as possible.

Objective:
  • 5NF aims to guarantee that no redundant data is stored and that all data dependencies in a database are explicitly represented in the schema.
  • This can help to eliminate update anomalies, insertion anomalies, and deletion anomalies that can occur when data is stored in a non-normalized or partially normalized database.

Note: one can also consider that a relation is in 5NF if the candidate key implies every join dependency.

Example:

Let’s take a look at an example for a better understanding of the Fifth Normal Form.

SUBJECTLECTURERSEMESTER
ComputerAnshikaSemester 1
ComputerJohnSemester 1
MathJohnSemester 1
MathAkashSemester 2
ChemistryPraveenSemester 1

In the above table, John takes both Computer and Math classes for Semester 1, but he doesn’t take Math classes for Semester 2. To identify valid data in this situation, a combination of all these fields is needed.

Therefore,  to make the above table into 5NF, we can decompose it into three relations:

Relation 1:

SEMESTERSUBJECT
Semester 1Computer
Semester 1Math
Semester 1Chemistry
Semester 2Math

Relation 2:

SUBJECTLECTURER
ComputerAnshika
ComputerJohn
MathJohn
MathAkash
ChemistryPraveen

Relation 3:

SEMESTERLECTURER
Semester 1Anshika
Semester 1John
Semester 1John
Semester 2Akash
Semester 1Praveen

Now we can say that all 3 relations are in 5NF.

Note: also read about Fourth Normal Form (4NF)

Follow Me

Please follow me to read my latest post on programming and technology if you like my post.

https://www.instagram.com/coderz.py/

https://www.facebook.com/coderz.py

Share
Published by
Rabecca Fatima

Recent Posts

Find Intersection of Two Singly Linked Lists

You are given two singly linked lists that intersect at some node. Your task is…

5 months ago

Minimum Cost to Paint Houses with K Colors

A builder plans to construct N houses in a row, where each house can be…

5 months ago

Longest Absolute Path in File System Representation

Find the length of the longest absolute path to a file within the abstracted file…

6 months ago

Efficient Order Log Storage

You manage an e-commerce website and need to keep track of the last N order…

6 months ago

Select a Random Element from a Stream

You are given a stream of elements that is too large to fit into memory.…

6 months ago

Estimate π Using Monte Carlo Method

The formula for the area of a circle is given by πr². Use the Monte…

7 months ago