Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between 2NF and BCNF

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?

like image 882
user3231622 Avatar asked Jan 24 '14 10:01

user3231622


People also ask

What is the difference between BCNF and 3NF?

The basic difference between 3NF and BCNF is that 3NF eliminates the transitive dependency from a relation and a table to be in BCNF, the trivial functional dependency X->Y in a relation must hold, only if X is the super key.

What is normalization 1NF 2NF 3NF and BCNF?

Following are the various types of Normal forms: A relation is in 1NF if it contains an atomic value. 2NF. A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional dependent on the primary key. 3NF. A relation will be in 3NF if it is in 2NF and no transition dependency exists.


1 Answers

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.

like image 98
nvogel Avatar answered Sep 25 '22 02:09

nvogel