boyce-codd normal form
boyce-codd normal form (BCNF): was proposed as a simpler form of 3NF, but it was found to be stricter than 3NF. that is, every relation in BCNF is also in 3NF; however, a relation in 3NF is not necessarily in BCNF.
a relation schema
is in BCNF if whenever a nontrivial functional dependency
holds in
, then
is a superkey of
.
[cite:;from @elmasri_db_2015 chapter 14.5 boyce-codd normal form]
[cite:;see @elmasri_db_2015 chapter 14 basics of functional dependencies and normalization for relational databases][cite:;from @elmasri_db_2015 chapter 14.5 boyce-codd normal form]
a relation satisfies the BC/NF normal form if:
exists, create a new relation where
is the key.
- it satisfies the 3nf normal form;
- if there exists a functional dependency
, then
is the key of the relation. i.e. there exist no dependencies
such that
isnt in the key or is only part of the key.
a student can take many courses and the converse is true, when a student takes a course a single person lectures them, a course can be given by different lecturers, but a lecturer can only teach one course
given the following relation:
this relation doesnt satisfy BCNF because we have the relation lecturer id \(\to\) course. to fix that we create a new relation
given the following relation:
(_student id, course_, lecturer id)
this relation doesnt satisfy BCNF because we have the relation lecturer id \(\to\) course. to fix that we create a new relation
(course, _lecturer id_)