Finish 3NF, MySQL, Multi-valued Dependencies, High Level Database Models




CS157a

Chris Pollett

Oct 2, 2023

Outline

Introduction

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

Quiz

Which of the following is true?

  1. Starting on a single relation, the BCNF decomposition algorithm from class always outputs two relations.
  2. In order to run the chase, lossless join algorithm you need a set of functional dependencies and a set of decomposed tables each with at least 5 rows.
  3. There exists table decompositions into 3NF that are not in BCNF.

MySQL

Ways to Install MySQL

Interacting with MySQL

MySQL Command Line

Multivalued Dependencies

Multivalued Dependencies

Reasoning about MVDs

Fourth Normal Form