course content

Course Content

Relational Database and Normalization

Boyce–Codd Normal FormBoyce–Codd Normal Form

Upon reaching the Third Normal Form, the requirements of the Boyce-Codd Normal Form will be automatically met. The Third Normal Form does not coincide with Boyce-Codd Normal Form only when the following 3 conditions are simultaneously fulfilled:

  • A relation has 2 or more primary/foreign keys.
  • These primary/foreign keys contain more than one attribute (composite keys).
  • These primary/foreign keys overlap, meaning they share at least one attribute.

Boyce-Codd Normal Form is a specific normal form. This form is based on the composition of keys. The combination of some columns can create specific foreign and primary keys.

Look at an example:

Here you can see specific foreign and primary keys. The columns for House and Apartment can be duplicated, but when combined, they create a unique value. The same goes for the primary key. In this table, you can see that Robert Jerry owes 100 dollars for utilities, Erica Rohn owes 150 dollars, and Stas Mazer owes 130 dollars.

Look at the composite key principle:

  • House is not unique.
  • Apartment is not unique.
  • House + Apartment is unique.

We consider a set of two columns to be unique.

Look at one more example, but with strings now:

Here you can see different types of resorts with different qualities. A luxury court costs more. The prices for the respective resorts and their qualities are different. Resorts can be the same in Resort Type, but different in Resort Quality. That is why together they form a unique value (unique primary and foreign keys).

Similarly, we can understand which person should pay how much for their resort.

Section 3.

Chapter 5