If a functional dependency in a relation is in "transitive form" (meaning, a transitive dependency exists), then the relation does not belong to Third Normal Form (3NF).
Let's break this down:
-
What is a Transitive Dependency?
A transitive dependency occurs when a non-key attribute is dependent on another non-key attribute, and that second non-key attribute is dependent on the primary key (or a superkey).
- Formally: If
A -> B and B -> C, and A is the primary key (or a superkey), B and C are non-key attributes, and B does not determine A, then C is transitively dependent on A via B.
-
Normal Forms and Transitive Dependencies:
- First Normal Form (1NF): A table with transitive dependencies can still be in 1NF (atomic values, no repeating groups).
- Second Normal Form (2NF): A table with transitive dependencies can still be in 2NF (it's in 1NF and all non-key attributes are fully dependent on the entire primary key, not just part of it). Transitive dependencies don't directly violate 2NF.
- Third Normal Form (3NF): This is where transitive dependencies are explicitly disallowed.
- Definition of 3NF: A relation is in 3NF if it is in 2NF and no non-prime attribute is transitively dependent on the primary key (or any candidate key). In simpler terms, no non-key attribute should be dependent on another non-key attribute.
Conclusion:
If a relation contains a transitive functional dependency, it means it fails to meet the requirements for Third Normal Form (3NF). It might be in 1NF or 2NF, but it needs to be decomposed to achieve 3NF.
Example:
Consider a table ORDER_DETAILS with attributes:
OrderID (Primary Key)
CustomerID
CustomerName
ItemCode
ItemName
ItemPrice
Functional Dependencies:
OrderID -> CustomerID, CustomerName, ItemCode, ItemName, ItemPrice (PK determines everything)
CustomerID -> CustomerName (A non-key attribute determines another non-key attribute)
ItemCode -> ItemName, ItemPrice (A non-key attribute determines other non-key attributes)
Here:
CustomerName is transitively dependent on OrderID via CustomerID. (OrderID -> CustomerID and CustomerID -> CustomerName)
ItemName and ItemPrice are transitively dependent on OrderID via ItemCode. (OrderID -> ItemCode and ItemCode -> ItemName, ItemPrice)
Because of these transitive dependencies, the ORDER_DETAILS table is not in 3NF. To achieve 3NF, it would need to be decomposed, for example, into:
ORDER (OrderID, CustomerID, ItemCode)
CUSTOMER (CustomerID, CustomerName)
ITEM (ItemCode, ItemName, ItemPrice)