0

I have am having a big problem grasping my head around Functional Dependencies and Candidate keys. I'm currently doing a project where I have to identify 'two' candidate keys and can only have four functional dependencies. My whole relation is:

R(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W)

And my functional dependencies are:

B -> A,C,D,G
M -> K,L,N
W -> R,T,S
BH -> Q,P,O,U,I,V,J,K,L,M,E,F,W

Therefore, I have worked out my candidate key as:

[BH]

However, I am required to have a second candidate key, when I can't as I have tried all of the potential solutions and none of them match all attributes. I have watched lots of videos online, but I'm still confused, is the reason I cannot get a second candidate key because I have done it wrong?

Thanks,

Kieran

KieranLowe
  • 81
  • 1
  • 10
  • I too get just {B,H}. Are you sure that this it the assignment? – philipxy Dec 21 '15 at 05:19
  • @philipxy Yeah, basically I have had to do my functional dependencies, but I'm not sure if they're correct either. Thanks for your help! – KieranLowe Dec 21 '15 at 09:50
  • It *sounds* like you're expected to change the functional dependencies. That's the only way you're going to "manufacture" another candidate key. I don't think I've ever seen an assignment like that, though. – Mike Sherrill 'Cat Recall' Dec 22 '15 at 13:40
  • Do you mean you are the person who generated those FDs? From what initial info? – philipxy Dec 22 '15 at 23:55
  • @philipxy The project brief, but I'm not allowed to place it on here I don't think haha, if that makes sense – KieranLowe Dec 22 '15 at 23:58
  • 1
    I guess you mean, the FDs are determined by the nature of the application relationships in the real world. If you feel ok to ask about CK derivation, can you find a way to ask for, say, the first error in your justification of your FDs? Maybe by paraphrasing aspects of the spec justifying each FD? – philipxy Dec 23 '15 at 00:18
  • @philipxy I could try, I might be able to message you the relationship and just abbreviate them, if that makes sense :) – KieranLowe Dec 23 '15 at 00:30

1 Answers1

0

For the given set of functional dependencies, {B,H} is the only possible candidate key. As B and H are the only attributes that appear only on the left hand side of the given FDs and there closure (BH-closure) gives all the attributes of the relation R.

If you are required to find two candidate keys then probably the given set of FDs are wrongly formed.

Karup
  • 2,024
  • 3
  • 22
  • 48
  • Thanks for that, I have been trying to sort them, as I need them for a project, however, I have reformed them but I think there is only one still. I spoke to my manager about it and he agrees there is only one. Still not sure if my new FDs make sense though, will update the post shortly – KieranLowe Dec 22 '15 at 10:08