3NF Algorithms




CS157a

Chris Pollett

Oct 8, 2018

Outline

Introduction

Dependency Preservation

Dependency Preservation versus BCNF Example - Part 1

Dependency Preservation versus BCNF Example - Part 2

Quiz

Which of the following is true?

  1. A functional dependency is a kind of deletion anomaly.
  2. The BCNF decomposition algorithm relies on being able to compute the closure of a set of attributes by a set of FDs.
  3. The chase test was used to test if a table was in BCNF.

Third Normal Form (Codd 1971)

1NF and 2NF

The Synthesis Algorithm for 3NF Schemas

Input
A relation `R` and a set of FDs `F` that hold on `R`.
Output
A decomposition of `R` into relations, each of which is in 3NF. Further, the decomposition satisfies the LJD and DP properties.
Method
Perform the following steps:
  1. Find a minimal basis for `F`, say `G`.
  2. For each FD `X->A` in `G`, use `XA` as the schema of one of the relations in the decomposition.
  3. If none of the relation schema from Step 2 is a superkey for `R`, add another relation whose schema is a key for `R`.

Example of the Synthesis Algorithm

Why the Synthesis Algorithm Works