Normalization and its types
Normalization is the process of organizing data into a related table to eliminate data redundancy, insertion anomaly, update anomaly & deletion anomaly and increase the integrity which improves performance of the query are known as Normalization.
Here are the types of Normalization
- First normal form(1NF)
- Second normal form(2NF)
- Third normal form(3NF)
- Boyce & Codd normal form (BCNF)
First normal form (1NF)-:
In 1st NF:
• The table cells should be of single value.
• Eliminate repetition groups in individual tables.
• Create a separate table for every set of related data.
• Identify every set of related data with a primary key.
• No repetition columns and teams.
• The values in every column of a table are atomic.
Definition: An entity is in the 1st normal form if it contains no repetition groups. In relational terms, a table is in the 1st normal form if it contains no repetition columns. Repetition columns build your information less versatile, wasting space, complicated and make it more difficult to search for data.
NOTE: In 1NF relation the order of tuples (rows) and attributes (columns) does not matter.
Example:
Order |
Name |
product |
Total Price |
1 |
Neetu |
Paste |
34.23 |
2 |
Rohan |
oil |
15.00 |
3 |
Neetu |
paste |
42.00 |
4 |
Jay |
Milk |
5.00 |
Second normal form (2NF)-:
In 2nd NF:
- It helps to eliminate Partial Dependencies.
- Functional Dependency: The value of one attribute in a table is determined entirely by the value of another.
- Partial Dependency: A kind of functional dependency where an attribute is functionally dependent on only part of the primary key (primary key must be a composite key).
- Create separate table with the functionally dependent data
Definition: One attribute is functionally hooked into one another. A table should be in 1st Normal Form. It Create separate table with the functionally dependent on second table. No partial dependencies on a concatenated key
Example:
Order |
Name |
product |
Total Price |
1 |
Neetu |
Paste |
34.23 |
2 |
Rohan |
oil |
15.00 |
3 |
Neetu |
paste |
42.00 |
4 |
Jay |
Milk |
5.00 |
Name |
product |
Neetu |
Paste |
Rohan |
oil |
Neetu |
paste |
Jay |
Milk |
Order |
Name |
Total Price |
1 |
Neetu |
34.23 |
2 |
Rohan |
15.00 |
3 |
Neetu |
42.00 |
4 |
Jay |
5.00 |
Third normal form (3NF)-:
In third normal form there should be no transitive dependency between a non-key attribute and a Key attribute. A table contain in 2 normal form and Transitive functional dependency of non-prime attribute on any super key should be removed.
Tournament Winners |
|||
Tournament |
Year |
Winner |
Winner Date of Birth |
Indiana Invitational |
1998 |
Al Fredrickson |
21 July 1975 |
Cleveland Open |
1999 |
Bob Albertson |
28 September 1968 |
Des Moines Masters |
1999 |
Al Fredrickson |
21 July 1975 |
Indiana Invitational |
1999 |
Chip Masterson |
14 March 1977 |
|
|