4. Aims of normalization:
• Minimize logical redundancy;
• Free the DB of modification anomalies;
• Minimize redesign when extending DB
structure;
• Simplification for applying integrity
constraints.
Edgar Frank Codd
5. Other suggestions:
• The aim of Normalization is not to decrease or
increase performance;
• The aim of Normalization is not to decrease or
increase physical memory size of DB.
6. So what is Normalization?
• The process of transformation of database
relations to the structure that fits normal form
(NF).
7. Normal Form
• A set of requirements (rules, principals) that
satisfy relations in DB.
8. Normal forms:
• 1st Normal Form (1NF);
• 2nd Normal Form (1NF);
• 3rd Normal Form (3NF);
• Boyce-Codd Normal Form (BCNF);
• 4th Normal Form (4NF);
• 5th Normal Form (5NF);
• Domain/key Normal Form (DKNF);
• 6th Normal Form (6NF).
9. 1st Normal Form Principals
• No top-to-bottom ordering to the rows;
• No left-to-right ordering to the columns;
• No duplicate rows;
• Every cell contains only one value;
• All columns are regular (no hidden
components).
10. 2nd Normal Form Principals
• Relations are in 1st Normal Form;
• Every non-prime attribute is dependent on
candidate key.
11. 3rd Normal Form
• Relations are in 2nd Normal Form;
• Non-prime attribute can be determined only
by the candidate key and not any other non-
prime attribute (transitive dependency).
13. Boyce-Codd Normal Form
• Relations are in 3rd Normal Form
• Primary key does not depend on non-prime
attribute.
Relation is in 3NF but not in BCNF when relation has two or more candidate
key that are composite and have common attribute
14. Denormalization
• Transformation of DB structure to the form
that does not satisfy normal forms.
• Process of optimizing performance by adding
redundant data or by grouping data.
19. Compare
Normalization:
SELECT product_name, order_date
FROM orders
INNER JOIN products USING(product_id)
WHERE product_name like 'A%'
ORDER by order_date DESC
Denormalizaion:
SELECT product_name, order_date
FROM orders
WHERE product_name like 'A%'
ORDER by order_date DESC
26. What is the best way?
The best way is to –
MIX principals of normalization with
denormalization approach depending on
certain application purposes.