Normalization Flashcards
1NF
Atomic and single-valued columns (values in cells must not be tables).
No composite or multi-valued attribute types.
Relational Database Prerequisite
Each row must have a primary key, which uniquely identifies each row.
2NF
Satisfies 1NF and no partial functional dependencies of non-prime attributes on candidate keys
Why Normalize (What is the goal)
- Minimize update, insertion, and deletion anomalies.
2. Minimize redesign when extending Database structure.
To get to 1NF
For any column with multi-valued or composite values, create a second table with a Foreign key to the Primary key of the original table and the values as single rows in the new table.
To get to 2NF
Set up a new relation for each partial key together with its dependent attribute types. Keep a relation with the original table through a primary key
3NF
Satisfies 2NF and no non-prime attribute type is transitively dependent on the primary key.
To get to 3NF
Set up a new relation that includes the non-key attribute types that functionally determine the other non-key attribute types.
BCNF (Boyce-Codd)
3NF and for each of its non-trivial functional dependencies X->Y, X is a superkey. X is either a candidate key or a superset thereof.
4NF
Every non-trivial multi-valued dependency begins with a superkey
What is Denormalization
Denormalization refers to a technique which is used to access data from higher to lower forms of a database. It helps the database managers to increase the performance of the entire infrastructure as it introduces redundancy into a table. It adds the redundant data into a table by incorporating database queries that combine data from various tables into a single table.