-1

I need help finding the candidate keys from the given relation:

R (A,B,C,D,E) with FD:

A -> BE
B -> BE
B -> D

STEPS:

  1. I know all the attributes can identify themselves so: A,B,C,D,E -> {ABCDE}
  2. Now I know A -> BE, so i can cross out BE and get this: ACD -> {ABCDE}
  3. The prime attributes are (A,C,D)
  4. D would now be replaced by B giving me my other candidate key of (ABC)

I have the answer has ACD and ABC but apparently, it's AC. What am I doing wrong?

user372204
  • 69
  • 2
  • 10
  • Your "I have these FDs" doesn't make sense. "These are all the FDs that hold"?--Not possible. "These are all the non-trivial FDs that hold"?--Not possible. "These are some FDs that hold"?--Question can't be answered. Find out what a *cover* is & what the exact conditions are to apply a particular definition/rule/algorithm. To determine CKs & NFs we must be given FDs that form a cover. Sometimes a minimal/irreducible cover. And the set of all attributes must given. [See this answer.](https://stackoverflow.com/a/53386492/3404097) – philipxy Dec 14 '20 at 20:33
  • It's good you show your work, but: Quote & reference the algorithm you are following--preferably from a (good) textbook. Show how you are supplying proper input & following its steps. Explain all your reasoning clearly. (Because people take too-big unjustified cryptic steps. Like here.) PS "identify themselves" isn't using a proper technical term. Also "A,B,C,D,E -> {ABCDE}" isn't a FD. We write x->y where each of x & y is a set or attribute; an attribute A means set {A}. A set is adjacent attributes or curly braces around a list. (Or, adjacent set names gives their union.) Be consistent. – philipxy Dec 14 '20 at 20:57

1 Answers1

0

A simple reasoning is the follow.

A and C must be present in any candidate key, since they never appear in the right part of some FD.

So, let’s see if they are already a candidate key by computing their closure, AC*.

By applying the rules for computing the closure of a set of attributes, we can see easily that AC* is equal to ABCDE, so AC is a candidate key. The only other attribute that appears in the left side of a FD is B, so we should check that no other candidate key contains it. But noting that the attributes AC must be present in any key and already they form a candidate key, so adding any attribute to them produces only superkeys, we can conclude that this is the only candidate key.

Renzo
  • 26,848
  • 5
  • 49
  • 61