fourth normal form
we present the definition of fourth normal form (4NF), which is violated when a relation has undesirable multivalued dependencies and hence can be used to identify and decompose such relations.
a relation schema
is in 4NF with respect to a set of dependencies
(that includes functional dependencies and multivalued dependencies) if, for every nontrivial multivalued dependency
in
,
is a superkey for
.
[cite:;from @elmasri_db_2015 chapter 14.6.1 formal definition of multivalued dependency]
[cite:;see @elmasri_db_2015 chapter 14 basics of functional dependencies and normalization for relational databases][cite:;from @elmasri_db_2015 chapter 14.6.1 formal definition of multivalued dependency]
4nf is applied in cases where in the key there are pairs of fields between which there is a multivalued dependency, with no relations between the different pairs.
a relation satisfies the 4nf normalization degree if:
a relation satisfies the 4nf normalization degree if:
- it satisfies all of 1nf, 2nf, 3nf: the fields that arent in the key are dependent on the whole key only.
- in the key there is at most one multivalued dependency.
consider the relation
to 4nf-normalize this relation we turn it into the following schema:
(worker id, project code, language), a worker can be a part of many projects, a worker can know different languages, there is no relation between the languages one knows and the projects theyre in.
to 4nf-normalize this relation we turn it into the following schema:
-
(worker id, project) -
(worker id, language)