3NF Algorithms




CS157a

Chris Pollett

Sep 30, 2019

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. All FDs in a minimal basis have left hand sides consisting of a single attribute.
  2. The relation `R(A,B,C)` subject to FD's `A->C` and `B->C` is in BCNF.
  3. It is possible for a table decomposition to be in BCNF but not have the lossless join decomposition property.

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