Multi-valued Dependencies, High Level Database Models




CS157a

Chris Pollett

Oct 2, 2019

Outline

Introduction

Multivalued Dependencies

Multivalued Dependencies

In-Class Exercise

Reasoning about MVDs

Fourth Normal Form

4NF Decomposition Algorithm

We can modify our BCNF decomposition algorithm to get a 4NF decomposition algorithm as follows:

Input:
A relation `R_0` with a set of FDs and MVDs
Output:
A decomposition of `R_0` into relations all of which are in 4NF. The decomposition has the lossless join property.
Method:
Do the following steps, with `R = R_0` and `S= S_0`:
  1. Find a 4NF violation in R, say `A_1A_2...A_n ↠ B_1...B_m`, where
    `{A_1,A_2,...,A_n}`
    is not a superkey. If there is none, return; R by itself as a decomposition.
  2. If there is such a 4NF violation, break the schema for the relation `R` into two schemas:
    • `R_1`, whose schema is `A_i`s and `B_j`s.
    • `R_2`, whose schema is the `A_i`s together with all the attributes that are not `A_i`'s or `B_j`'s.
  3. Find the FDs and MVDs that hold in `R_1` and `R_2`. The book shows how to modify the chase algorithm to do this, but we are going to skip it. Recursively, apply the algorithm to each of `R_1` and `R_2`.

In the case of our earlier example table. The above algorithm would split the table because of `n\a\m\e ↠ s\t\r\e\e\t \ \ c\i\t\y` and decompose it into two tables `R_1`(name, street, city) and `R_2`(name, title, year).

High Level Database Models

Entity-Relationship Model