Marwan Al-Namari Hassan Al-Mathami
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.
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
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
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 & ……..
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.
Second normal form (2NF) The table need to be in 1NF. All attribute has to depend on the whole primary key.
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
Teachers De-normalized table T_IDT_Res_NoT_Name T_Address T_SpeT_Name_of_Children Marwan,Alnamari Alkalediah,Alqu nfudah NetworkingMazen, Mohamed. Ali Abdulkaree m, Ali Alkalediah,Alqu nfudah DatabaseAhmed Hamzah, Awad Albalad,Alqunf udah Security
1NF T_IDT_Res_NoT_FNameT_LNT_Street_Address Marwan Alnamari Alkalediah Abdulkareem Ali Alkalediah Hamzah 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
1NF Child Table T_IDID_ChildChild_Name Mazen Mohamed Ali Ahmed
2NF T_IDT_FNameT_LN Marwan Alnamari Abdulkareem Ali Hamzah Awad T_IDT_Street_Ad dress T_Address Alkalediah, Alqunfudah Alkalediah, Alqunfudah Albalad, Alqunfudah T_IDT_Res_NoT_Spe Networking Database Security
3NF T_NoT_IDT_Res_No T_NoT_Spe 1Networking 2Database 3Security
Question-Summary
Answer