Skip to the content.

Definitions to memorize

Memorize everything in bold.

Relation on sets A, B:

Subset of the Cartesian product A x B

Relation schema on sets A, B, C,… :

A collection of constraints on the possible tuples

Superkey of a relation schema:

Any collection of columns whose values are guaranteed to be unique

Key of a relation schema:

A minimal superkey

Candidate key of a relation schema:

Same as a key

Primary key (PK) of a relation schema:

A single key designated as the primary key by the database designer

Alternate key of a relation schema:

A key that is not the primary key

Foreign key of a relation R referring to relation S:

Short definition (memorize this): A in R is a foreign key referring to B in S if the values of A are a subset of B.

Formal definition (understand this): Let R and S be relation schemas, such that:

Then A is a foreign key referring to B if the values of A are constrained to be a subset of B. There is some fine print, which you can ignore.

Prime column of a relation schema:

A column that is part of a key.

Functional dependency in a relation schema:

A–>B is a functional dependency if the mapping from A to B is always a function.

Boyce-Codd normal form (BCNF) for a relation schema:

The left hand side of every functional dependency is a superkey.

Third normal form (3NF) for a relation schema:

For every functional dependency, either:

Important fact: Any relation schema can be converted to an equivalent collection of relation schemas in 3NF. BCNF is preferable, but in certain rare cases it’s not possible (e.g. the ZIP code example).