9. Normalization Flashcards

(8 cards)

1
Q

Normalization Goal:

A

A step-by-step process to replace relations with simpler, more regular structures to reduce unnecessary redundancy and avoid insertion, deletion, and update anomalies, and prevent spurious tuples. Approach is decomposition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Anomalies:

A

◦ Insertion Anomaly: Cannot insert data about one entity without having data about another.
◦ Deletion Anomaly: Deleting data about one entity unintentionally deletes data about another.
◦ Modification/Update Anomaly: Updating a value may require updating multiple tuples inconsistently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Spurious Tuples:

A

Incorrect tuples generated when relations are joined, typically when joining on attributes that are not PK/FK combinations. Avoid by ensuring joins are on PK/FK.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Properties of Successful Decomposition:

A

Attribute preservation, Dependency preservation, Lossless join. Heath’s Theorem states R{X,Y,Z} with X→Y can be non-loss decomposed into R1{X,Y} and R2{X,Z}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Normal Forms:

A

A relation is in a specific normal form if it satisfies certain constraints.
◦ First Normal Form (1NF): A relation is in 1NF if and only if all attribute values are atomic (single-valued). No multivalued, composite attributes, or nested relations. By definition, all relations are in 1NF. To achieve 1NF, move multivalued attributes or repeating groups to a new relation with the original PK as a foreign key.
◦ Second Normal Form (2NF): A relation is in 2NF if it’s in 1NF and every non-key attribute is fully functionally dependent on the PK. Full functional dependency means the dependency X → Y no longer holds if any attribute is removed from X. Partial dependency is when it still holds. Only relevant for composite PKs. To normalize from 1NF to 2NF, remove attributes that are partially dependent on the PK into a new relation, taking the partial key as the PK of the new relation and leaving it as a FK in the original.
◦ Third Normal Form (3NF) / Boyce-Codd Normal Form (BCNF): A relation is in 3NF if it’s in 2NF and no non-key attribute is transitively dependent on a CK. A transitive dependency X → Y via Z exists if X → Z, Z → Y, X is a CK, and Z is not part of a CK. BCNF is stricter: LHS of every FD must be a CK. To normalize from 2NF to 3NF, remove attributes involved in transitive dependencies into a new relation, using the intermediate attribute(s) (Z in X→Z→Y) as the PK of the new relation and leaving it as a FK in the original.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Normalization process:

A

A sequence of steps moving from lower to higher normal forms (e.g., 1NF → 2NF → 3NF/BCNF) by decomposition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Pros:

A

Reduces redundancy, avoids anomalies, separates entities, not biased towards specific queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Cons:

A

More relations means more joins, potentially slower performance for some queries. Normalization can be taken too far.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly