## Closure of Functional Dependency Example and Applications of Closure –

**Closure of a set (X ^{+})** is the set of attributes functionally determined by X.

Let S be the set of functional dependencies on relation R. Let X is set of attributes that appear on left hand side of some FD in S and we want to determine the set of all attributes that are dependent on X. Thus for each such set of attribute X, we determine the set X^{+} of attributes that are functionally determined by X based on S, X^{+} is called closure of X under S.

#### Algorithm to find the X^{+} or Algorithm to find Closure of Functional Dependency is :

X^{+}= X; repeat oldX^{+}:= X^{+}for each FD Y→Z in S do if Y is subset of X^{+}then X^{+}: = X^{+}∪ Z; until (X^{+}=old X^{+}) /* If X^{+}did not change then leave loop*/

**Example:**

Suppose we are given relation R with attributes A,B,C,D and FDs A→BC B→CD

To find the Closure of all the attributes : Let us find closure of A firstly. (B^{+}) = {BCD} (C^{+}) = {C} (D^{+}) = {D} (AB^{+}) = {ABCD} (AC^{+}) = {ABCD} (AD^{+}) = {ABCD} (BC^{+}) = {BCD} (BD^{+}) = {BCD} (CD^{+}) = {CD} (ABC^{+}) = {ABCD} (ABD^{+}) = {ABCD} (ACD^{+}) = {ABCD} (BCD^{+}) = {BCD} (ABCD^{+}) = {ABCDEF}

Question : Compute the closure of following set F of functional dependencies for relation schema R = {A, B, C, D, E}. A → BC CD → E B → D E → A

Solution : Attribute closure of all the attributes : (A)^{+}= {ABCDE} (C)^{+}= {C} (D)^{+}= {D} (AB)^{+}= {ABCDE} (AC)^{+}= {ABCDE} (AD)^{+}= {ABCDE} (AE)^{+}= {ABCDE} (BC)^{+}= {ABCDE} (BD)^{+}= {BD} (BE)^{+}= {ABCDE} (CD)^{+}= {ABCDE} (CE)^{+}= {ABCDE} (DE)^{+}= {ABCDE} (ABC)^{+}= {ABCDE} (ABD)^{+}= {ABCDE} (ABE)^{+}= {ABCDE} (ACD)^{+}= {ABCDE} (ACE)^{+}= {ABCDE} (ADE)^{+}= {ABCDE} (BCD)^{+}= {ABCDE} (BDE)^{+}= {ABCDE} (CDE)^{+}= {ABCDE} (ABCD)^{+}= {ABCDE} (ABCE)^{+}= {ABCDE} (ABDE)^{+}= {ABCDE} (ACDE)^{+}= {ABCDE} (BCDE)^{+}= {ABCDE}

#### Applications of Closure set of attributes –

- It is used to identify the additional Functional Dependencies.
- It is used to identify keys (Candidate Keys and Super Keys).
- It is used to identify the Prime and Non Prime Attributes.
- It is used to identify equivalence of Functional Dependency.
- It is used to identify the irreducible set of Functional Dependencies or Canonical Cover of Functional Dependency.

Previous | Home | Next |

Inference Rules For FD | Membership Test for FD |

### Incoming search terms:

- closure of a set of functional dependency in dbms
- closure of functional dependency in dbms with example
- closure set of functional dependency
- closure in dbms
- how to find closure in dbms
- closure of fd example
- closure of a set of functional dependencies examples
- Closure of Attribute Sets
- closure of functional dependencies
- closure set of attributes example