CS457 Syllabus & Progress

Finding the closure set X+ of a set of attribute X

• The closure set X+ of a set of attribute X

• Let X be some set of attributes of a R

The closure set X+ is:

 set of attributes that are functionally determined by X

• Clearly:

 X ⊆ X+

because X X

• The importance of the closure set X+

• Property:

Let R be a relation

Let X be a set of attributes of R

 ``` If X+ = R then X is a superkey ```

• In other words:

 The closure can tell us if the set of attribute X is a super key

• How to proceed to find a key after computing   X+:

• If X+ R then:

 X is not a super key.... We must augment (= add) other attributes to X in order to obtain a key

• If X+ = R then:

• X is a super key

• However:

 X may not be a key because X is not minimal !!!!

How to check for minimality:

• Remove one or more attributes A from X

• Compute the closure of X-A:

 If (X-A)+ = R then X is not minimal !!! (because you do not need A to be a super key !!!)

• X is a key if:

 For every attribute A:   (X−A)+ ≠ R

(Only then we know X is minimal)