# How to find attribute closure using Functional Dependency

For a Given set of Functional dependencies, the attribute closure of an attribute A will be a set S determined as below:

- Add A to the set S.
- Add all the attributes which are derived from A to the set S
- Add all the attributes which are functionally determined by the attributes of set S, recursively.

Attribute closure is denoted by A^{+}

**Example:**

Given a Relation R(A, B, C, D, E) {AB -> CD, D -> E, A -> C,B -> D}.

we can determine A** ^{+}** as:

^{ }- Add A to the set S = {A}.
- get all the attribute which are derived from A
- A->C (From given Functional Dependencies)
- Add C to the set. Now S will contain {A,C}

- No other attribute can be derived from A and C hence

**A ^{+}= {A,C}.**

we can determine B** ^{+}** as:

- Add B to the set S = {B}.
- get all the attribute which are derived from B
- B->D (From given Functional Dependencies)
- Add D to the set. Now S will contain {B,D}

- get all the attribute which are either derived by D or the combination of BD
- D->E
- Add E to the Set. Now S will contain {B,D,E}

- No other attribute can be derived from B,D,E or with their combination hence

**B ^{+}= {B,D,E}.**

Similarly we can get closure of any attribute.

Advertisements

## 1 reply »