170 likes | 613 Views
NORMALIZATION. Chapter objective:. What is Normalization Need of Nomalization Procees of Normalization Types of Normalization. Definition:.
E N D
NORMALIZATION Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Chapter objective: • What is Normalization • Need of Nomalization • Procees of Normalization • Types of Normalization Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Definition: • Normalization is the process of organizing the fields and tables of a relational database to minimize redundancy and dependency. • Usually involves dividing large tables into smaller (and less redundant) tables and defining relationships between them. Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Need of Normalization • Relations that have redundant data may have problems called update anomalies, which are classified as , • Insertion anomalies • Deletion anomalies • Modification anomalies Vineet Rao Kohite (Dept. of computer ,Govt college aron)
First Normal Form Tables are said to be in first normal form when: • The table has a primary key. • No single attribute (column) has multiple values. • The non-key attributes (columns) depend on the primary key. Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Unnormalised form: In below table there is a violation of first normal form as a single field has been allowed to contain multiple values. Vineet Rao Kohite (Dept. of computer ,Govt college aron)
A design that complies with 1NF first normal form makes use of two tables: a Customer Name table and a Customer Telephone Number table. Customer name table Customer telephone number table Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Result: • Repeating groups of telephone numbers do not occur in this design • With Customer ID as key fields, a "parent-child" or one-to-many relationship exists between the two tables Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Second Normal Form • A relation is in second normal form if it is in 1NF. • And every non key attribute is fully functionally dependent on the primary key. Vineet Rao Kohite (Dept. of computer ,Govt college aron)
For example… A table that violates Second Normal Form Primary key Here the primary key is a composite key on emp_num and dept_no. But the value of dept_name depends only on dept_no, not on the entire primary key. Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Correcting Second Normal Form violations by creating two tables Emp_dept(emp_num,dept_no) dept (dept_no,dept_name) Primary key Primay key Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Third Normal Form: For a table to be in Third Normal Form, • A table is in second normal form (2NF) • a non-key field cannot depend on another non-key field. Vineet Rao Kohite (Dept. of computer ,Govt college aron)
A table that violates Third Normal Form Dept(dept_no,dept_name,mgr_emp_num,mgr_lname) Depend on non key Primary key Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Solution: • split the Dept table into two tables: Dept table Primay key Employee table Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Benefits of Normalization • Greater overall database organization. • Reduction of redundant data. • It is much easier to modify a small table with little data than to modify one big table • Consistent and accurate data within a database. VineetRaoKohite (Dept. of computer ,Govt college aron)
Any Query ???? Vineet Rao Kohite (Dept. of computer ,Govt college aron)
Thankyou………. Vineet Rao Kohite (Dept. of computer ,Govt college aron)