-2

In relation R = (ABCDEFGH) the set of functional dependencies that hold is
{BE -> GH, G -> FA, D -> C, F -> B}

What is a candidate key of R?

I found the answer can be BED, DEG, or FED. However, this question is a multiple choice question where I can't select multiple answers.

What is the method used and how do I use it here?

philipxy
  • 14,867
  • 6
  • 39
  • 83
zgfn
  • 1

2 Answers2

0

The set of candidate keys is {{BDE}, {DEF}, {DEG}}

A relation can have multiple candidate keys. However you can choose only one of them as a primary key.

philipxy
  • 14,867
  • 6
  • 39
  • 83
arunmoezhi
  • 3,082
  • 6
  • 35
  • 54
0

To to find the candidate keys:

Form three columns: left, right and middle.

  • In the left column, add the attributes which appear only on the left hand side of a FD or do not appear in any FD.
  • In the right column, add the attributes which appear only on right hand side of FD.
  • In the middle column, add attributes which appear both on right and left hand side of FD.

Explanation:

  • Attributes in the left column must be included in every candidate key.
  • Attributes in the right column must not be included in any candidate key.
  • Attributes in the middle may or may not be included in candidate keys.

In this example, we get E, D in the left column, B, F, G in the middle and A, C, H in the right column.

Then, apply the Closure property:
BED+ = ABCDEFGH
since
BE->GH Given.
BE->FA Decomposition rule and transitivity rule and BE->G and G->FA.
BED->C Given since D->H.

Similarly DEF and DEG can be proved to be candidate keys.

Thus, all three are candidate keys.

philipxy
  • 14,867
  • 6
  • 39
  • 83
Lordferrous
  • 678
  • 8
  • 8
  • @jsotola Please remove thanks, greetings & other social & meta content when editing. Also quote & code formats are only for quotes & code. Also please correct prose. – philipxy Aug 18 '23 at 19:03