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:

  1. Add A to the set S.
  2. Add all the attributes which are derived from A to the set S
  3. 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:    

  1. Add A to the set S = {A}.
  2. 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}
  3. No other attribute can be derived from A and C hence

A+= {A,C}.

we can determine B+ as:

  1. Add B to the set S = {B}.
  2. 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}
  3. 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}
  4. 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.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s