1

Given a relational schema $R(V,W,X,Y,Z)$ with functional dependencies $F = \{VW \to X, X \to YZ, W \to VX, V \to W, Z \to XY\}$. What are the keys of $R$?

Is the key just $V$? If so, is $\{ R_2(V,W,Z), R_3(V,X,Y) \}$ the lossless-join decomposition of $R$?

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
paradoxica
  • 11
  • 2

1 Answers1

1

I assume, by key, you mean the candidate key.

Let's check whether V is a candidate key:

closure(V) = {V, W, X, Y, Z}

Hence, V is a candidate key.

closure(W) = {W, V, X, Y, Z}

Hence, W is also a candidate key.

closure(X) = {X, Y, Z}

closure(Y) = {Y}

closure(Z) = {Z, X, Y}

By checking all the other possible keys, one can see that only V and W are candidate keys.

The lossless-join decomposition of R does not have to be unique.

One can be described as follows:

R = {R1(V, W, X), R2(X, Y, Z)}

Since R1 ⋂ R2 = {X} And X -> {X, Y, Z}.

Hence, X -> R2.

Hence, R1 ⋂ R2 -> R2. Hence, this decomposition is a lossless join decomposition.

R2 can be further divided as R2 = {R3(X, Y), R4(X, Z)}

Similarly, R1 = {R5(V, W), R6(W, X)}

Hence R = {R5(V, W), R6(W, X), R3(X, Y), R4(X, Z)}