The fourth normal form

The first four forms (the first through third, and Boyce Codd) apply structural constraints that allow one to assert compliance. The fourth normal form, on the other hand, is a little more subtle.

To demonstrate, consider that we will be building a holidays feature on a travel website. Holidays mean a combination of activities and hotels. To model this, a table is created that defines all the destinations in which holidays are possible and the options that are available:

Destination

HotelId

ActivityId

Singapore

ABxx2

124

Singapore

ABxx2

567

Singapore

Psawe212

124

Dubai

sa0943

124

Dubai

we1321

124

 

This table documents all the possible activities/hotels options available at a destination. 

The redundancy observed here is that there are multivalued dependencies. This is a type of dependency that exists between two attributes when, for each value of the first attribute, there is one or more associated values of the second attribute. For example, the fact that activityid=124 (snorkeling) is available in Singapore is stored more than once.

The fourth constraint states, "There may be no independent sets of dependencies within a primary key." This leads to the fourth normal form. To move the model to the fourth normal form, the preceding table can be decomposed into two tables: 

  • HolidayActivities:

Destination

ActivityId

Singapore

124

Singapore

567

Dubai

124

  • HolidayHotels:

Destination

HotelId

Singapore

ABxx2

Singapore

Psawe212

Dubai

sa0943

Dubai

we1321

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset