-1

I have a following problem.

I need to determine is the following assingment in the second normal form, and I have some problems understanding what the second normal form is, and how to determine it.

I have this example for learning/practicing.

R = ({A, B, C, D, E, F};{AB->ACD, BC->DE})

The primary key is ABF.

In the solutions it is written that the table is not in the second normal form because not every NKA(non key attribute) is dependent on KA(key attribute), and is also written

example: AB->C

I dont know how to get to this solution, or what AB->C has to do with anythoing(because it is not in the assingment).

Can somebody please explain this to me.

Thanks!!!

philipxy
  • 14,867
  • 6
  • 39
  • 83
depecheSoul
  • 896
  • 1
  • 12
  • 29
  • 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 Feb 17 '21 at 18:36

2 Answers2

3

First let's define 2NF:

Let R be a relation schema with set of functional dependencies F. Let X be a set of attributes of R. A is a non-prime attribute not in X. Then R is in 2NF if whenever X->A is in F+, then X is not a proper subset of any key.

Now looking at your problem. Here R is your relation R(A,B,C,D,E,F) and F is {AB->ACD, BC->DE}. Primary key is ABF and therefore A, B and F are prime attributes and C, D and E are non-prime attributes.

Now let's find F+ (F-closure) , that is, set of all dependencies that are derivable from F.

We get F+ as {AB->A, AB->C, AB->D, BC->D ,BC->E, ...}

Now our definition above says that for any X->A in F+, X should not be a proper subset of the key.

Here one of the dependencies in F+ is AB->C . Here C is a non-prime attribute and AB is a proper subset of the key ABF. Therefore it violates second normal form.

Karup
  • 2,024
  • 3
  • 22
  • 48
2

First let's define 2NF: Firstly we should check the form whether it is in 1NF or not. If it is not, then make it in 1NF because it is necessary.

Secondly, Let R be a relation schema with set of functional dependencies F. Let X be a set of attributes of R. A is a non-prime attribute not in X. Then R is in 2NF if whenever X->A is in F+, then X is not a proper subset of any key.

Now lets take a look at your problem and check for the solution. Here R is your relation R(A,B,C,D,E,F) and F is {AB->ACD, BC->DE}. Primary key is ABF and therefore A, B and F are prime attributes and C, D and E are non-prime attributes.

Now let's find F+ (F-closure) , that is, set of all dependencies that are derivable from F.

We get F+ as {AB->A, AB->C, AB->D, BC->D ,BC->E, ...}

Now above statement says that for any X->A in F+, X should not be a proper subset of the key.

Here one of the dependencies in F+ is AB->C . Here C is a non-prime attribute and AB is a proper subset of the key ABF. Therefore it is not in second normal form.

Bhavya
  • 53
  • 1
  • 8