CSE Roadmap

Common tier · about 3 hours · 5 parts

Part 3 of 5 · 1 min read

Full versus partial dependency

Whether Y depends on all of a composite key, or only part of it.

Think of a two-part library card number made of a branch code and a member number. The member's name depends only on the member number part, not on which branch issued the card.

In plain words: when a key has more than one column, Y is fully dependent on the key if it needs every column of the key to be determined. Y is partially dependent if some smaller subset of the key already determines it.

A worked example. In order_items (order_id, book_id, quantity, title), quantity needs both order_id and book_id together, a full dependency. But title only needs book_id alone, a partial dependency, since the order has nothing to do with a book's title.

The key lines. No new SQL; this distinction is checked by reasoning about the data's meaning, not by a single query.

Full dependency, partial dependency

A full dependency needs every column of a composite key to determine Y. A partial dependency needs only part of that key.

Example: quantity fully depends on (order_id, book_id); title only partially depends on it, through book_id alone.