2

I have definitely checked out many different related posts, as suggested when creating this question. I have also done different sample problems from online sources as well from a similar problem. However, I am stuck on the problem below specifically.

Given the following relation R and the set of functional dependencies S that hold on R, find all candidate keys for R. Show your work.

R(A, B, C, D, E, F)
S:
AB → C

AC → B

AD → E

BC → A

E → F

Initially, I broke the attributes into groups: attributes found only on the left, only on the right, and on both sides (they are D, ABCE, and F respectively). I also know that I should try to compute the closure of D. This is where I get stuck. At first glance, this seems like I am unable to solve this problem, which isn't true. I also tried computing the closures of (AD), (BD), (CD), and (ED) because I thought that the closure of D = D. Any thoughts?

Barmar
  • 741,623
  • 53
  • 500
  • 612
RBG
  • 85
  • 1
  • 1
  • 6
  • I'm voting to close this question as off-topic because it looks like CS homework, not a practical programming problem. cs.stackexchange.com may be a better place for it. – Barmar Mar 12 '15 at 02:02
  • 1
    I understand, however there have been plenty of similar questions that weren't closed for this reason. They received some pretty great answers as well. – RBG Mar 12 '15 at 02:13
  • 1
    What *definiton* of CK in terms of FDs were you given and what *procedure* to find a CK from FDs were you given? – philipxy Mar 21 '15 at 23:33

1 Answers1

1

The keys here are ABD, ACD and BCD.

You were on the right track. After dividing the attributes in three groups, the attributes under "only on the left" list are always a part of the key. Here that attribute is D.

"I also tried computing the closures of (AD), (BD), (CD), and (ED)"

As you couldn't determine the key while taking attributes in groups of 2 you should have then tried making group of 3 attributes and check their closure.

Karup
  • 2,024
  • 3
  • 22
  • 48