0

I'm trying to find the keys for the relation R = ABCDE, with functional dependencies AB->C, C->D, C->E, D->A, E->B

I know how to find the keys when on the right side of the dependencies there are some attributes missing. But here all attributes appear on the right side. I'm not sure how to find the keys and I couldn't find an explanation for this specific example.

philipxy
  • 14,867
  • 6
  • 39
  • 83
yoko
  • 15
  • 3
  • Find your textbook's algorithm(s) or use the definition of CK to look at all subsets of attributes. Right now you are just asking for us to rewrite a textbook with a bespoke tutorial. Show the steps of your work following your textbook with justification & explain re the first place you are stuck. Moreover this is a faq. Before considering posting please always google any error message & many clear, concise & precise phrasings of your question/problem/goal, with & without your particular strings/names; read many answers. See [ask] & the voting arrow mouseover texts. – philipxy Jun 16 '19 at 17:34
  • 1
    Possible duplicate of [Determining candidate keys with functional dependencies simple](https://stackoverflow.com/questions/13629637/determining-candidate-keys-with-functional-dependencies-simple) – philipxy Jun 16 '19 at 17:40
  • The candidate keys in this example are `{ (A B) (A E) (B D) (C) (D E) }`. For how to find them see the algorithms presented in the books, or search “find candidate keys” on this site or with Google Search. – Renzo Jun 16 '19 at 20:14
  • @philipxy, [How to find a candidate key](https://stackoverflow.com/questions/43465696/how-to-find-a-candidate-key/43467969#43467969) offers a better explanation. – Marcus Vinicius Pompeu Jun 16 '19 at 23:23

1 Answers1

1

My answer is based on https://stackoverflow.com/a/43467969/206413 and https://djitz.com/neu-mscs/answers-to-candidate-key-hard-questions/.

(1) AB -> C
(2) C -> D
(3) C -> E
(4) D -> A
(5) E -> B

AB+ = (1) ABC               = (2, 3) ABCDE
C+  = (2, 3) CDE = (4) ACDE = (5)    ABCDE
D+  =                       = (4)    AD
E+  =                       = (5)    BE

So far we have as candidates (AB, C).

Exploring further:

D+ = AD => DAB+ = ABCDE
E+ = BE => EAB+ = ABCDE

Hence our candidates are (AB, C, DAB, EAB)

Marcus Vinicius Pompeu
  • 1,219
  • 1
  • 11
  • 24