OneCompiler

FDS

145

Compute the closure of the following set F of functional dependencies for relation schema R = {A, B, C, D, E}.
A -> BC
CD -> E
B -> D
E -> A
List the candidate keys for R.

ANS=

  1. Reflexivity: If X is a subset of Y, then Y is functionally dependent on X. (X → Y)

  2. Augmentation: If X → Y, then XZ → YZ for any set of attributes Z.

  3. Transitivity: If X → Y and Y → Z, then X → Z.

  4. A -> BC

  5. CD -> E

  6. B -> D

  7. E -> A

  8. A+ (Closure of A):
    A+ = ABC.

  9. B+ (Closure of B):
    B+ = BD.

  10. C+ (Closure of C):

    • C is already in C.
  11. D+ (Closure of D):

    • D is already in D.
  12. E+ (Closure of E):
    E+ = EA.

  13. AB+ (Closure of AB):

    • AB+ = ABC (from A+).
  14. AC+ (Closure of AC):

    • AC+ = AC
  15. AD+ (Closure of AD):

    • AD+ =
  16. BC+ (Closure of BC):

    • BC+ = BC
  17. BD+ (Closure of BD):

    • BD+ = BD
  18. CD+ (Closure of CD):

    • CD+ = CDE
  19. ABC+ (Closure of ABC):

    • ABC+ = ABC
  20. ACD+ (Closure of ACD):

    • ACD+ = ACDE
  21. ABCDE+ (Closure of ABCDE):

    • ABCDE+ = ACDE (from ACD+).

The closure of the given set F for the relation schema R = {A, B, C, D, E} is {A, C, D, E}.

Possible candidate keys:

  1. ACDE
  2. ABCE

Both ACDE and ABCE are candidate keys for the relation schema R.