Fifth Normal Form/Projected Normal Form (5NF)
A relation R is in Fifth Normal Form if and only if everyone joins dependency in R is implied by the candidate keys of R. A relation decomposed into two relations must have lossless join Property, which ensures that no spurious or extra tuples are generated when relations are reunited through a natural join.
Properties
A relation R is in 5NF if and only if it satisfies the following conditions:
1. R should be already in 4NF.
2. It cannot be further non loss decomposed (join dependency).
Example – Consider the above schema, with a case as “if a company makes a product and an agent is an agent for that company, then he always sells that product for the company”. Under these circumstances, the ACP table is shown as:
Table ACP
Agent | Company | Product |
---|---|---|
A1 | PQR | Nut |
A1 | PQR | Bolt |
A1 | XYZ | Nut |
A1 | XYZ | Bolt |
A2 | PQR | Nut |
The relation ACP is again decomposed into 3 relations. Now, the natural Join of all three relations will be shown as:
Table R1
Agent | Company |
---|---|
A1 | PQR |
A1 | XYZ |
A2 | PQR |
Table R2
Agent | Product |
---|---|
A1 | Nut |
A1 | Bolt |
A2 | Nut |
Table R3
Company | Product |
---|---|
PQR | Nut |
PQR | Bolt |
XYZ | Nut |
XYZ | Bolt |
The result of the Natural Join of R1 and R3 over ‘Company’ and then the Natural Join of R13 and R2 over ‘Agent’and ‘Product’ will be Table ACP.
Hence, in this example, all the redundancies are eliminated, and the decomposition of ACP is a lossless join decomposition. Therefore, the relation is in 5NF as it does not violate the property of lossless join.
Introduction of 4th and 5th Normal Form in DBMS
Two of the highest levels of database normalization are the fourth normal form (4NF) and the fifth normal form (5NF). Multivalued dependencies are handled by 4NF, whereas join dependencies are handled by 5NF.
If two or more independent relations are kept in a single relation or we can say multivalue dependency occurs when the presence of one or more rows in a table implies the presence of one or more other rows in that same table. Put another way, two attributes (or columns) in a table are independent of one another, but both depend on a third attribute. A multivalued dependency always requires at least three attributes because it consists of at least two attributes that are dependent on a third.
For a dependency A -> B, if for a single value of A, multiple values of B exist, then the table may have a multi-valued dependency. The table should have at least 3 attributes and B and C should be independent for A ->> B multivalued dependency.
Example:
Person | Mobile | Food_Likes |
---|---|---|
Mahesh | 9893/9424 | Burger/Pizza |
Ramesh | 9191 | Pizza |
Person->-> mobile,
Person ->-> food_likes
This is read as “person multi determines mobile” and “person multi determines food_likes.”
Note that a functional dependency is a special case of multivalued dependency. In a functional dependency X -> Y, every x determines exactly one y, never more than one.