Domanda

According to a wikipedia example, the following example is not bcnf because there are overlapping candidate keys (name and work, and name and contractor)

Name   Work        Contractor
John   Plumber     Plumber industries
Ryan   Plumber     Plumber industries
Ryan   Elektrician Electro industries

However, isn't this table also not in 2NF? Consider that Name and work compose the primary key, contractor can then be derived from only work, so the database should be splitted?

If my statement is true, can somebody provide me an (easy) example of a database that is is not in BCNF, but is 2NF?

È stato utile?

Soluzione

isn't this table also not in 2NF?

No it doesn't violate 2NF. 2NF requires that every nonprime attribute is fully dependent on every candidate key. Since the table in your example has no nonprime attributes it cannot violate 2NF. This is the essential difference between BCNF and 2NF/3NF. BCNF requires that every attribute must be fully dependent on every key. The lower normal forms of 2NF and 3NF only require that of nonprime attributes.

A nonprime attribute means an attribute that is not part of any candidate key.

Altri suggerimenti

The table is in 2NF. A table can have many candidate keys. In our example, we have two. Hence, there are no non-key attributes. That means all are prime/key attributes. Work determines Contractor uniquely, at the same time Contractor too determines Work uniquely.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top