View on GitHub

Notes

reference notes

Normalization

Normalization is a technique for producing a set of suitable relations that support the data requirements of an enterprise. ​

The process of analyzing a given relation schema based on their functional dependencies and Primary Key to achieve a minimum redundancy and insertion, deletion and modification anomalies.

Relations that contain redundant information may potentially suffer from update anomalies. ​

ANOMALIES: Errors that occur when we want to update a table that contains redundant data.​

Types of update anomalies include​

Data Redundancy and Update Anomalies:

r

Modification Anomalies - INSERTION

StaffBranch relation​(unnormalized)

Staff and Branch relation​(normalized)

Modification Anomalies - DELETION

StaffBranch relation​

Staff and Branch relation​

Modification Anomalies - UPDATE

StaffBranch relation​

Functional Dependencies

important concept associated with normalization.​

Functional dependency describes relationship between attributes.​

For example, if A and B are attributes of relation R, B is functionally dependent on A (denoted A -> B), if each value of A in R is associated with exactly one value of B in R.

A functionally determines B.​

The determinant of a functional dependency refers to the attribute or group of attributes on the left-hand side of the arrow.​

A is the determinant of B.

  1. Full Functional Dependency indicates that if A and B are attributes of a relation, B is fully functionally dependent on A, if B is functionally dependent on A, but not on any proper subset of A.​
    A,B -> C,D [Full Functional Dependency]​
    A -> E [Partial Dependency]​
    B -> F, G, H, I [Partial Dependency]​
    H -> I [Transitive Dependency]​
    
  2. Partial Dependency: depends on part of the key​

  3. Transitive Dependency: A -> B, B -> C then A -> C​

Non key attributes can determine other attributes

NORMALIZATION OF RELATIONS

Definition : The process of analyzing a given relation schema based on their functional dependencies and Primary Key to achieve a minimum redundancy and insertion, deletion and modification anomalies.​

Proposed by Codd, which requires relation schemas to go through ‘series of normal form test’.

NORMALIZATION PROCESS:

r

FIRST NORMAL FORM (1NF)

SECOND NORMAL FORM (2NF)

1NF to 2NF​:

THIRD NORMAL FORM (3NF)

2NF to 3NF​:

Relation in 2NF:​

Client (clientNo, cName) - Full​
Property (propertyNo, pAddress, rent, ownerNo, oName) ​
ownerNo -> oName [Transitive]​
Rental (clientNo, propertyNo, rentStart, rentFinish) – Full​
Client (clientNo, cName) ​
Rental (clientNo, propertyNo, rentStart, rentFinish)​
Property (propertyNo, pAddress, rent, ownerNo) ​
Owner (ownerNo, oName)