What is 4NF: Fourth Normal Form Explained in DBMS
4NF or Fourth Normal Form is a level of database normalization that removes multi-valued dependencies to ensure data is stored without redundancy. It requires that a table is already in BCNF and that no multi-valued dependencies exist except those that are trivial.How It Works
Fourth Normal Form (4NF) focuses on eliminating a specific kind of redundancy called multi-valued dependency. Imagine you have a table where one column depends on another, but there are multiple independent sets of values related to the same key. This causes repeated rows and wastes space.
4NF says that if a table has multiple independent multi-valued facts about an entity, you should split the table into smaller tables so each one only describes one fact. This way, each piece of information is stored once, making the database cleaner and easier to maintain.
Example
This example shows a table that violates 4NF because it stores multiple independent multi-valued facts about a student in one table.
StudentID | Course | Hobby ----------|-----------|------- 1 | Math | Chess 1 | Math | Painting 1 | Science | Chess 1 | Science | Painting
When to Use
Use 4NF when your database tables have multiple independent sets of multi-valued data related to the same key. For example, if a student can have many courses and many hobbies, and these two lists do not depend on each other, 4NF helps you split this data into separate tables.
This reduces data duplication and makes updates easier because you only change information in one place. It is especially useful in complex databases where data integrity and efficiency are important.
Key Points
- 4NF removes multi-valued dependencies to avoid redundancy.
- A table must be in BCNF before applying 4NF.
- It splits tables with independent multi-valued facts into separate tables.
- Helps maintain data integrity and reduces update anomalies.