CS457 Syllabus & Progress

### Intro to Finding Keys of a Relation R

• Importance of the Key

• The "natural" ( "trivial" or "beneficial" ) functional dependencies arise from the fact that:

 the key of a relation functionally determines   all attributes in the relation.

• To determine if a functional dependency is natural (beneficial, "harmless") , we must therefore first find all keys of a relation.

 The problem of find all keys of a relation. is NP-complete ....

What this means is the problem is very hard to solve efficiently

(I.e., we don't have any efficient solution and it is not likely that one will be found easily...

Nevertheless, we must find all keys of a relation.

In this webpage, we look at a heuristical algorithm that can help us find all the keys of a relation.

• How to recognize a key of a relation R

• Recall that a set of attributes S is a super key of a relation R if:

 S functionally determines all attributes in R

• Recall that a set of attributes K is a key of a relation R iff:

 K functionally determines all attributes in R K is minimal