240 likes | 378 Views
Introduction to Normalization Workshop. 10 June 2011. Normalizing a Table. Normalizing a Table. Referring to the sales invoice at the previous slide. Tabulate the information in a table. Normalizing a Table. Normalizing a Table. Normalizing a Table. Normalizing a Table.
E N D
Introduction to NormalizationWorkshop 10 June 2011
Normalizing a Table • Referring to the sales invoice at the previous slide. • Tabulate the information in a table.
Normalizing a Table • The NOTnormalized form is a table in which items that appear more than once (redundancy) have not been removed. • Cannot manage the data well using this kind of table. • Divide the table. – into 1st normal form • First Normal Form • A Simple, two dimensional table resulting form the division of the original table.
Normalizing a Table First Normal Form Primary Key Primary Key (Composite Key)
Normalizing a Table • Second Normal Form • A key that can identify data determines values in other columns. • The primary key that determines the values in other columns – functional dependent. • The table is further divide so that values in other columns are functionally dependent on the primary key.
Normalizing a Table I am already in 2nd normal form Depend on Product ID only Functionally Dependent Functionally Dependent
Normalizing a Table Second Normal Form
Normalizing a Table • Third Normal Form • A table is divided so that a value is NOT determined by any non-primary key. • A value is called Transitively dependent if that value determines values in other columns indirectly which is part of functional dependent. • Table is divided so that transitively dependent values removed.
Normalizing a Table Transitively dependent on invoice number
Question 1 One person can borrow multiple books and Books can be borrowed by multiple students at different times. To what stage the following tables are normalized?
Question 1 - answer One person can borrow multiple books and Books can be borrowed by multiple students at different times. To what stage the following tables are normalized? Answer: Second Normal Form
Question 2 The following tables also shows a book lending situation. To what stage is it normalized?
Question 2 - answer The following tables also shows a book lending situation. To what stage is it normalized? Answer : Third Normal Form
Question 3 • The following table shows monthly sales for each staff member. Each department has multiple staff members. A staff member can only be part of one department. Normalized this table to the third normal form.
Question 4 • The following table represents an order-receiving system. Normalize it to the third normal form. However, process one customer per order-taking code. You can process multiple products based on one order-taking code. In addition, one order-taking code should correspond to only one representative.
Question 5 • The following table represents an order-receiving system. Normalize it to the third normal form. Assume that products are classified by product code.