Why do normalized schematics up to 3FN not have N:N relationships?

Asked

Viewed 201 times

4

Explanation of the concept

I believe that by definition a database schema is found in 3FN, when it is in 1FN,2FN and nay has transitive dependency.

Transitive dependence is when an attribute NONKEY, besides depending on an attribute key also depends on an attribute NAY key.

Example: imagem

In the example of the book, the attribute Cpf_gerente is a non-key attribute that depends on the attribute Dnumero (non-key) and attribute CPF (key).

Caption

X: Key attribute CPF.

Y: A non-key attribute Dnumero.

Z: A non-key attribute CPF_Gerente.

So by notation we have the concept of transitivity explained in this way

X -> Y e Y -> Z e X -> Z.

Translating would be like this:

CPF determines exclusively Dnumero or Dnumero depends functionally on CPF.

Dnumero determines exclusively CPF_GERENTE or CPF_GERENTE depends functionally on Dnumero.

After finding all DF(Dependências Ffunctions), see that the FUNC_DEP table is divided into two and starts to eliminate the old transitive dependency.

Soon we have the scheme within the normal form 3FN.

Yeah, but what’s the doubt?

Even knowing the above concept I could not understand why it is correct states that in standard relational model up to 3FN is correct states that 3FN contains only 1:1 and 1:N relationships.

For those interested to see the question, it is here:

Consider a standard relational model up to

I. 3FN contains only relationships N:M.

II. 3FN contains only 1:1 and 1:N relationships.

III. 3FN cannot contain functional dependencies between non-key attributes.

IV. 1FN or 2FN shall not contain functional dependencies between non-key attributes and nor relationships N:M.

It is correct what is stated ONLY in

To. II, III and IV.

B. II and III.

C. I and III.

D. II.

And. I.

1 answer

3


Let’s say we want to relate which dogs have which owners and vice versa. We have that the same person can own several dogs and a dog can have more than one owner. There are also dogs without owners and people who don’t have dogs.

We could implement in the people table, a field with the ids of all the dogs she owns and in the dog table a field with the ids of all their owners. This is possible, but it is a violation of 1FN.

Therefore, in order to reach 1FN, the multivariate fields should be eliminated. We will have to create a table that says which are the dogs of each person and one that says which are the owners of each dog. It turns out that these tables are actually only one. Therefore, we use an intermediate table, where a relationship M:N between the tables To and B is implemented through a new table C where we have relationships 1:m amid To and C and 1:N amid B and C. That is, the relationship M:N was broken into two relationships, one 1:m and a 1:N. On the table C, there is no field other than the two foreign keys and both are part of the primary key.

So if relationships M:N they must be decomposed (and therefore eliminated) to reach 1FN, so there is no way they persist by reaching 2FN, 3FN or any other normal form beyond.

  • And all this only in 1FN? No need to worry about 3FN?

  • 1

    @Jeffersonquesado Yes.

  • Well I suspected that the question was making a mess when talking about 3FN... but first I question my truths, then I got confused. Thank you for clarifying

  • 1

    I thank you for removing my doubt, in fact I had not paid attention that when the composition or aggregation occurs enters the tables, the relation M:N ceases to exist and becomes 2, I thought it continued to exist together.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.