-3

In the relation X below P, Q, R, S, T and U are the attributes of the relation. Find the functional dependencies and candidate keys.

Relation X
+---+---+---+---+---+---+
| P | Q | R | S | T | U |
+---+---+---+---+---+---+
| p | c | e | i | k | v |
| p | d | f | j | k | w |
| p | d | g | j | n | y |
| p | d | g | i | n | z |
| q | d | f | i | k | x |
| q | c | g | j | m | y |
+---+---+---+---+---+---+

I do not understand how to find. Thanks.

philipxy
  • 14,867
  • 6
  • 39
  • 83

1 Answers1

1

A functional dependency expresses the idea that, given one value for A, we find one and only one value for B, where A and B represent sets of attributes. So, to find the functional dependencies in X, you ask yourself these questions.

  • Is there an FD from P to Q? (Given one value for P, do we find one and only one value for Q? And the answer is, "No". Given the value 'p' for P, we find 'c' and 'd' for Q.)
  • Is there an FD from P to R? (No.)
  • Is there an FD from P to S? (No.)
  • . . . and so on
  • Is there an FD from {PQ} to R? (No.)
  • . . . and so on

Repeat for every possible combination of {PQRSTU}. This will give you the set of all functional dependencies.

From that set of functional dependencies, determine the candidate keys following whichever algorithm your textbook gives you.

Mike Sherrill 'Cat Recall'
  • 91,602
  • 17
  • 122
  • 185
  • "... and so on" means there are all in all 6*2^5 attribute combinations to check? – miracle173 May 04 '14 at 06:40
  • One has to check for FD from X to Y, for Y=P one has to check X= Q R S T U QR QS QT QU RS RT RU ST SU TU QRS QRT QRU QST QSU QTU RST RSU RTU STU QRST QRSU QRTU RSTU QRSTU , these are 31 combinatins, maybe one also has to check if X is empty, hten we have 32 combinations for Y=P, the same for Y= ! R S T or U gives 6*32=192 checks – miracle173 May 04 '14 at 07:19