Partial Dependencies Explained
You'll learn: How to spot when a non-key attribute depends on only part of a composite primary key—a database design smell that violates Second Normal Form.
What Is a Partial Dependency?
A partial dependency occurs when you have a composite primary key (a primary key made of two or more attributes) and some non-key attribute depends on only part of that composite key—not the whole thing.
Think of it like a restaurant order form where the primary key is (OrderID, MenuItemID). If you store CustomerName on that table, it depends only on OrderID, not the full composite key. That's a partial dependency: CustomerName can be determined by knowing just OrderID alone.
Identifying Partial Dependencies
Look for these clues:
- Check your primary key: Does it have multiple columns?
- Examine non-key attributes: Can any be determined by knowing just one part of the key?
Example
Table: OrderDetails (OrderID, ProductID, CustomerName, Quantity)
- Primary key:
(OrderID, ProductID) Quantitydepends on the full key (which product in which order)CustomerNamedepends only onOrderID✗ Partial dependency!
The functional dependency notation:
OrderID → CustomerName
This violates Second Normal Form because CustomerName doesn't depend on the entire composite key.
Why It Matters
Partial dependencies cause:
- Redundancy:
CustomerNamerepeats for every product in an order - Update anomalies: Changing a customer name requires multiple row updates
- Insertion/deletion problems: Can't record a customer without an order detail
Key Takeaway: A partial dependency exists when a non-key attribute depends on only part of a composite primary key; eliminating these is essential for reaching Second Normal Form.