Normalization

A technique used to remove undesired redundancy from databases ( Break one large table into serveral smaller tables )

A relation is normalized if all determinants are candidate keys.

Anomalies

  • Insertion Anomaly: A new course cannot be added until at least one student has enrolled (which comes first student or course?)

  • Deletion Anomaly: If student 425 withdraws, we lose all record of course C400 and its fee!

  • Update Anomaly: If the fee for course C200 changes, we have to change it in multiple records (rows), else the data will be inconsistent.

Functional Dependency

A functional dependency concerns values of attributes in a relation.

A set of attributes XX determines another set of attributes YY if each value of XX is associated with only one value of YY.

Written XYX \rightarrow Y

Read as XX determines YY (if I know XX Then I also know YY)

Determinants (X,Y)Z(X, Y)\rightarrow Z: the attributes on the left side of the arrow.

Key and Non-Key attributes: each attribute is either part of the primary key or it is not.

Partial functional dependency (YZ)(Y\rightarrow Z): a functional dependency of one or more non-key attributes upon part (but not all) of the primary key.

Transitive dependency (ZD)(Z\rightarrow D): a functional dependency between 2 or more non-key attributes.

Armstrong's Axioms

Functional dependencies can be identified using Armstorng's Axioms

A=(X1,X2,,Xn)A=(X_1, X_2, \dots, X_n)

B=(Y1,Y2,,Yn)B=(Y_1, Y_2,\dots,Y_n)

  1. Reflexivity: BAABB\sub A \Rightarrow A\rightarrow B

    Example: Student_ID, name ightarrowightarrowname

  2. Augmentation: ABACBCA\rightarrow B \Rightarrow AC \rightarrow BC

  3. Transitivity:

Steps in Normalization

Normalizationvs Denormalization

It doesn't mean Denormalization is trash. Denormalization may be used to improve performance of time-critical operations.

Last updated