Presentation is loading. Please wait.

Presentation is loading. Please wait.

Marwan Al-Namari Hassan Al-Mathami. Normalization&Functional Dependencies What is Normalization? It is a technique. Why we do Normalization for a database?

Similar presentations


Presentation on theme: "Marwan Al-Namari Hassan Al-Mathami. Normalization&Functional Dependencies What is Normalization? It is a technique. Why we do Normalization for a database?"— Presentation transcript:

1 Marwan Al-Namari Hassan Al-Mathami

2 Normalization&Functional Dependencies What is Normalization? It is a technique. Why we do Normalization for a database? To eliminate redundancy. Redundancy=duplication. Try to have as few NULL values as possible. One piece of information will be stored in on place The data redundancies yield the following anomalies: Update anomalies. Addition anomalies. Deletion anomalies.

3 Functional Dependencies Functional dependencies (FDs) are used to specify formal measures of the "goodness" of relational designs FDs and keys are used to define normal forms for relations FDs are constraints that are derived from the meaning and interrelationships of the data attributes

4 FD X  Y if whenever two tuples depend on each other X  Y in R specifies a constraint on all relation instances r(R) Decomposition If X  YZ, then X  Y and X  Z Union If X  Y and X  Z, then X  YZ

5 How to do Normalization ? Normalization works through a series of stages called normal forms: First normal form (1NF) Second normal form (2NF) Third normal form (3NF) & 4NF & 5NF & ……..

6 First normal form (1NF) All attribute values are atomic(data cannot be broken down further) No Repeating Columns Each tuple can be uniquely identified by the primary key.

7 Second normal form (2NF) The table need to be in 1NF. All attribute has to depend on the whole primary key.

8 Third normal form (3NF) A relation schema R is in third normal form (3NF) if it is in 2NF and no non-prime attribute is transitively dependent on the primary key Transitive functional dependency occurs when A  B and B  C leads to A  C. Examples: T_Name  T_ID and T_ID  T_Res_No leads to T_Name  T_Res_No

9 Teachers De-normalized table T_IDT_Res_NoT_Name T_Address T_SpeT_Name_of_Children 43597700234567890Marwan,Alnamari Alkalediah,Alqu nfudah NetworkingMazen, Mohamed. Ali 42012233345678123Abdulkaree m, Ali Alkalediah,Alqu nfudah DatabaseAhmed 45400111123456789Hamzah, Awad Albalad,Alqunf udah Security

10 1NF T_IDT_Res_NoT_FNameT_LNT_Street_Address 43597700234567890Marwan Alnamari Alkalediah 42012233345678123Abdulkareem Ali Alkalediah 45400111123456789Hamzah Awad Albalad T_City_AddressT_SpeT_Name_of_Child 1 T_Name_of_Child2T_Name_of_Child3 Alqunfudah Networking MazenMohamedAli Alqunfudah Database Ahmed Alqunfudah Security

11 1NF Child Table T_IDID_ChildChild_Name 43597700 1Mazen 43597700 2Mohamed 43597700 3Ali 420122331Ahmed

12 2NF T_IDT_FNameT_LN 43597700Marwan Alnamari 42012233Abdulkareem Ali 45400111Hamzah Awad T_IDT_Street_Ad dress T_Address 43597700Alkalediah, Alqunfudah 42012233Alkalediah, Alqunfudah 45400111Albalad, Alqunfudah T_IDT_Res_NoT_Spe 43597700234567890Networking 42012233345678123Database 45400111123456789Security

13 3NF T_NoT_IDT_Res_No 143597700234567890 242012233345678123 345400111123456789 T_NoT_Spe 1Networking 2Database 3Security

14 Question-Summary

15 Answer


Download ppt "Marwan Al-Namari Hassan Al-Mathami. Normalization&Functional Dependencies What is Normalization? It is a technique. Why we do Normalization for a database?"

Similar presentations


Ads by Google