SQL Server Interview Question - What is Normalization and its different forms?
Shivprasad Koirala
Normalization have 3 different forms namely 1Normal Form,2Normal Form,3Normal Form.
1Normal Form: A table is said to be in 1NF if it satisfies the following rules. • The table must not contain any redundant groups of data • data must be broken up into the smallest units possible. In addition to breaking data up into the smallest meaningful values.
2Normal Form: A table is said to be in 2NF if it satisfies the following rules. • The table must be in 1NF • All the non-key column must depend on primary key.
3Normal Form: A table is said to be in 3NF if it satisfies the following rules. • The table must be in 2NF • A non-key field should not depend on another Non-key field. • The data should not be derived further.
For ex:Below table is in denormalize format:
Applying Normalization on this table.1NF:After applying 1NF the table look like
2NF:After applying 2NF the table look like
CountryTable
ProductTable
For avoiding duplication Create a new master table of Country and Product.
3NF:After applying 3NF the table look like
A non key field Total is removed from the table.
Regards,
Please click here to see more SQL Server interview questions