A functional dependency (FD) is a constraint between two sets of attributes in a relation. It describes a relationship where a particular attribute (or a set of attributes) uniquely determines another attribute.
Notation: If A → B, it means that if two tuples have the same value for A, they must have the same value for B.
A functional dependency is **trivial** if the right-hand side is a subset of the left-hand side.
Example: {A, B} → A (Here, A is already part of {A, B}, making it trivial).
If the right-hand side is not a subset of the left-hand side, the FD is **non-trivial**.
Example: A → B (Here, B is not part of A).
An FD is **completely non-trivial** if the left and right sides have no attributes in common.
Example: A → B, where A and B are distinct attributes.
The **closure of a set of attributes** (denoted as A+) is the set of all attributes that can be functionally determined by A.
Steps to Find Closure:
A **candidate key** is the minimal set of attributes that uniquely identify a tuple in a relation.
Steps to Find Candidate Keys:
| Concept | Description |
|---|---|
| Trivial FD | Right-hand side is a subset of the left-hand side (A, B → A). |
| Non-Trivial FD | Right-hand side is not a subset of the left-hand side (A → B). |
| Completely Non-Trivial FD | Left and right sides have no common attributes (A → B, A ≠ B). |
| Closure of Attributes | Set of attributes functionally determined by a given attribute. |
| Candidate Key | Minimal set of attributes that uniquely identify a row. |