Jerry's Blog

Recording what I learned everyday

View on GitHub


14 October 2019

Database(17) -- Review(2)

by Jerry Zhang

Keys of Relations

We say a set of one or more attributes {A1, A2,…,An} is a key for a relation R if:

  1. Those attributes functionally determine all other attributes of the relation. That is, it is impossible for two distinct tuples of R to agree on all of A1,A2,…,An.
  2. No proper subset of {A1,A2,…,An} functionally determines all other attributes of R; i.e., a key must be minimal.

superkey, short for “superset of a key.”

Equivalence of FD

Trivial FD

A trivial FD has a right side that is a subset of its left side.

The Transitive Rule

If A1A2…An -> B1B2…Bm and B1B2…Bm -> C1C2…Ck hold in relation R, then A1A2…An -> C1C2…Ck also holds in R.

Minimal basis

A minimal basis for a relation is a basis B that satisfies three conditions:

  1. All the FD’s in B have singleton right sides.
  2. If any FD is removed from B, the result is no longer a basis.
  3. If for any FD in B we remove one or more attributes from the left side of F, the result is no longer a basis.
tags: Database