In relational database design, Attribute Closure is a technique used to find all attributes that can be determined from a given set of attributes using a set of functional dependencies. It is denoted as and is read as “the closure of ”.
Attribute closure is very useful for:
Finding candidate keys and super keys from a given set of functional dependencies.
Verifying whether a functional dependency logically follows from a given set of FDs.
What is Attribute Closure?
For a relation schema and a set of functional dependencies :
The attribute closure of , written , is the set of all attributes that can be functionally determined by using the FDs in .
In practice, you start with and repeatedly apply FDs to add more attributes as long as new attributes can be determined.
Algorithm to Compute Attribute Closure
Given a set of functional dependencies and an attribute set :
Initialize .
For each functional dependency in :
If , then add to .
Repeat step 2 until no more attributes can be added to .
The final result is , the attribute closure of .
Example of Attribute Closure
Consider a relation with functional dependencies:
Find .
Start with: .
and ⇒ add :
.
and ⇒ add :
.
and ⇒ add :
.
So . This means is a super key for this relation.
Using Attribute Closure to Check Functional Dependencies
To check whether a functional dependency follows from a set of FDs :
Compute .
If , then holds.
If contains all the attributes of the relation, then is a super key.
Why Attribute Closure Matters in Design?
It helps identify candidate keys from a set of functional dependencies.
It supports normalization by clarifying which attributes determine others.
It is used in dependency preservation and lossless decomposition algorithms.
Summary
Attribute Closure in DBMS is the process of finding all attributes that can be functionally determined by a given set of attributes using the given functional dependencies. It is denoted as and is a fundamental tool for finding super keys, verifying FDs, and supporting normalization in relational database design.