-1

I have this database:

R(A, B, C, D, E)
Keys: A
F = {A -> B, D -> E, C -> D}

I normalize it into 3NF like this:

R(A, B, C, D, E)
Keys: AD
F = {AD -> B, AD -> E, C -> D}

What I do is when I check D -> E, D is not a superkey and E is not a key attribute, so I treat D and A as a superkey {AD}. When I check C -> D, C is not a key but D is a key attribute so it's OK.

Is my normalization correctly?

philipxy
  • 14,867
  • 6
  • 39
  • 83
  • You haven't normalized & it's not clear what you think "normalize" means or what you were doing or why or what you are trying to say in the 2nd last paragraph or what your question is. – philipxy Aug 23 '21 at 01:23
  • 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 be given. [See this answer.](https://stackoverflow.com/a/53386492/3404097) – philipxy Aug 23 '21 at 01:23

1 Answers1

2

There is a problem in your input data. If the relation R has the dependencies F = {A -> B, D -> E, C -> D}, then A cannot be a key. In fact, a key is a set of attributes whose closure determines all the attributes of the relation, which is not the case here, since:

A+ = AB

From F, the (only) possible key is AC, in fact

AC+ = ABCD

Normalizing means to reduce the redundancy by decomposing a relation in other relations in which the functional dependencies do not violate the normal form, and such that joining the decomposed relations, one can obtain the original one.

In you solution, you do not decompose the relation, but only change the set of dependencies with other dependencies not implied by the first set.

A correct decomposition would be instead the following:

R1 < (A B) ,
{ A → B } >

R2 < (C D) ,
{ C → D } >

R3 < (D E) ,
{ D → E } >

R4 < (A C) ,
{ } >

The algorithm to decompose a relation into 3NF can be found on any good book on databases.

Renzo
  • 26,848
  • 5
  • 49
  • 61