Closure of Attributes


Closure of Attribute Set

The set of all those attributes which can be functionally determined from an attribute set is called the closure of that attribute set.

The closure of attribute set {A} is denoted as {A}

Steps for the closure of attribute set

Step-1: Add the attributes contained in the attribute set for which closure is being calculated to the result set.

Step-2: Thus, keep adding the attributes recursively to the result set which can be functionally determined from the attributes already contained in the result set.

E.g.: In R(A,B,C,D) with the functional dependencies.
FD1: A -> B
FD2: B -> C
FD3: C -> D

Let us find closure for attribute A,B,C and D.
{A}+ =    {A}
                {A,B}
                {A,B,C,D}
{B}+ =     {B}
                {B,C,D}
{C}+ =     {C}
                {C,D}
{D}+ =    {D}

If the closure result of the attribute set contains all the attributes of the relation, then that attribute set is called a superkey of that relation. eg. A is superkey in the above example.

No subset of attribute A contains all the attributes of the relation, such attribute set is called a candidate key.

Comments

Popular posts from this blog

Transaction State Diagram

Introduction to transaction