Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have the following relation:

R = ABCDE
F: AB->DE, AC->B, DE->C, AE->C, C->AB

I need to determine this relations candidate keys.

Now, if I understood the defintion correctly:

In the relational model of databases, a candidate key of a relation is a minimal superkey for that relation; that is, a set of attributes such that the relation does not have two distinct tuples

The candidate keys would be: C, AB, AE, DE.

Is this correct or are there more?

share|improve this question
    
I think it's correct. –  ypercube Dec 2 '12 at 21:57
    
Always nice to say it's your homework so that we can help you a bit more and explain. –  Phil Dec 3 '12 at 1:31
    
Correct. (But my comment is too short.) –  Mike Sherrill 'Cat Recall' Dec 3 '12 at 2:15
    
Why wouldn't the key for example be ABD? –  Tool Dec 3 '12 at 22:02

1 Answer 1

up vote 0 down vote accepted

A superkey (and therefore a candidate key) that does not contain all attributes must contain at least an attribute set that is the left side of a functional dependency. Otherwise it would not be possible to generate an additional attribute from the attribute set of this superkey and this contradicts the definition of a superkey.

But a subset of ABCDE containing at least one of C,AB,AE or DE is already a superkey and to be minimal it is necessary that it contains only one of these subsets.

So the only subsets that must me investigated are that that are supersets of AC. But a superset of AC cannot be a minimal superkey because C already is a key.

Therefore the only candidate keys are C,AB,AE and DE

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.