Course contentsShow
← Computer Science
Lesson 1635 of 2,87237. Database Design and NormalizationFree lesson

Partial Dependencies Explained

Identifying when non-key attributes depend on only part of a composite primary key.

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:

  1. Check your primary key: Does it have multiple columns?
  2. 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)
  • Quantity depends on the full key (which product in which order)
  • CustomerName depends only on OrderID ✗ 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: CustomerName repeats 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.