Docsity

Normalization-Techniques for Data Warehousing-Lecture Slides, Slides of Basics of Data Warehousing

Partial preview of the text

Download Normalization-Techniques for Data Warehousing-Lecture Slides and more Slides Basics of Data Warehousing in PDF only on Docsity!

Ahsan Abdullah

2

Normalization

Ahsan Abdullah

3

Normalization

What is normalization?What are the goals of normalization?^ 

Eliminate redundant data.  Ensure data dependencies make sense.

What is the result of normalization?What are the levels of normalization?Always follow purists approach of normalization? NO

Ahsan Abdullah

5

Normalization: 1NF

Only contains atomic values, BUT also contains redundant data.

40 CS- Islamabad BS 4

30 CS- Islamabad BS 4

20 CS- Islamabad BS 4

20 CS- Lahore MS 3

40 CS- Lahore MS 2

30 CS- Lahore MS 2

10 CS- Islamabad BS 1

10 CS- Islamabad BS 1

20 CS- Islamabad BS 1

40 CS- Islamabad BS 1

20 CS- Islamabad BS 1

30 CS- Islamabad BS 1

Marks Course Campus Degree

FIRSTSID

Ahsan Abdullah

6

Normalization: 1NFUpdate anomalies

INSERT. Certain student with SID 5 got admission in adifferent campus (say) Karachi cannot be added until thestudent registers for a course.DELETE. If student graduates and his/her correspondingrecord is deleted, then all information about that studentis lost. UPDATE. If student migrates from Islamabad campus toLahore campus (say) SID = 1, then six rows would haveto be updated with this new information.

Ahsan Abdullah

8

Normalization: 2NF

SID^
Degree
Campus
BS^
Islamabad
MS^
Lahore
MS^
Lahore
BS^
Islamabad
PhD^
Peshawar
SID^
Course
Marks
1 CS-
1 CS-
1 CS-
1 CS-
1 CS-
1 CS-
2 CS-
2 CS-
3 CS-
4 CS-
4 CS-
4 CS-
REGISTRATION
PERFORMANCE
SID is now a PK

PERFORMANCE in 2NF as (SID, Course) uniquely identify Marks

Ahsan Abdullah

9

Normalization: 2NF

Presence of modification anomalies for tables in 2NF.For the table REGISTRATION, they are: ^ INSERT:

Until a student gets registered in a degree program, that program cannot be offered! ^ DELETE:

Deleting any row from REGISTRATION destroys

all other facts in the table.Why there are anomalies?The table is in 2NF but NOT in 3NF

Ahsan Abdullah

11

Normalization: 3NF

To transform REGISTRATION into 3NF, we create anew table called CAMPUS_DEGREE and move thecolumns campus and degree into it.Degree is deleted from the original table, campus isleft behind to serve as a foreign key toCAMPUS_DEGREE, and the original table isrenamed to STUDENT_CAMPUS to reflect itssemantic meaning.

Ahsan Abdullah

12

Normalization: 3NF^ Peshawar

PhD
Islamabad
BS
Lahore
MS
Lahore
MS
Islamabad
BS
Campus
Degree
REGISTRATION SID

Campus Islamabad 1 Lahore 2 Lahore 3 Islamabad 4 Peshawar 5 SID

STUDENT_CAMPUS

PhD Peshawar

MS Lahore

BS Islamabad

Degree

CAMPUS_DEGREE Campus

Ahsan Abdullah

14

Normalization

Conclusions: ^ Normalization guidelines are cumulative. ^ Generally a good idea to only ensure 2NF. ^ 3NF is at the cost of simplicity and performance. ^ There is a 4NF with no multi-valueddependencies. ^ There is also a 5NF.