Fourth Normal Form (4NF): Isolating Independent Facts
4NF prevents storing independent, multi-valued facts in one table. It applies when a key relates to two unrelated lists, like a restaurant's pizza types and its delivery areas.
WHY IT EXISTS Previous normal forms (like BCNF) focus on functional dependencies, where one attribute determines another (e.g., EmployeeID determines EmployeeName). They don't address redundancy from storing multiple, independent one-to-many relationships in a single table. 4NF was created to solve this specific type of redundancy caused by multi-valued dependencies.
THE MENTAL MODEL Imagine a table for a restaurant that lists its available pizza types and its delivery areas. The list of pizzas is independent of the list of delivery areas. If you store them in one table (Restaurant, PizzaType, DeliveryArea), you create redundant data. You'd have to repeat every delivery area for every pizza type. 4NF says: this is wrong. Create two separate tables, one for pizzas and one for delivery areas, both linked to the restaurant.
HOW IT WORKS 4NF is defined by multi-valued dependencies. A multi-valued dependency X ->> Y means that for a single value of X, there's a set of Y values, and that set is independent of any other attributes in the table. A table is in 4NF if, for every non-trivial multi-valued dependency X ->> Y, X is a superkey. This forces any independent lists of facts about an entity to be stored in their own tables, where the key of the original entity is part of the new table's key.
WHEN TO USE IT A table that is already in BCNF might still have update anomalies. This is the signal to check for 4NF violations. Use it when you see a table structure that combines two or more independent lists of information about a single key. For example, a Project table containing lists of TeamMembers and lists of TechnologiesUsed, where the members and technologies are not directly related to each other, only to the project.
WHEN NOT TO USE IT 4NF is an advanced normalization step and is not always necessary. If a table has a multi-valued dependency but you are certain there will never be a second, independent one, 4NF is not violated. Furthermore, if the performance cost of joining the decomposed tables for every query is too high, you might consciously choose to denormalize and handle potential anomalies at the application layer.
ONE CANONICAL EXAMPLE Consider a table tracking which restaurants deliver which pizzas to which areas: (Restaurant, PizzaType, DeliveryArea). Let's say 'Pizza Palace' makes 'Pepperoni' and 'Margherita' and delivers to 'Zone 1' and 'Zone 2'. The pizza list is independent of the delivery zone list. A table violating 4NF would need four rows to capture this: ('Pizza Palace', 'Pepperoni', 'Zone 1'), ('Pizza Palace', 'Pepperoni', 'Zone 2'), ('Pizza Palace', 'Margherita', 'Zone 1'), ('Pizza Palace', 'Margherita', 'Zone 2'). This creates redundancy. To achieve 4NF, you decompose this into two tables: (Restaurant, PizzaType) and (Restaurant, DeliveryArea). This isolates the two independent facts about the restaurant.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.