Database normalization is consist of a set of normalization rules derived from recognized good practices. It ensures that the database is structured to store data in a possible efficient way. It also helps to reduce the amount of duplicate data from the database.
First Normal Form(1NF)
A table is in 1NF if there is all columns contain single values i.e. no repeating groups. In simple words, the table should not have any column that stores more than one value. Even columns containing similar values are not allowed for example Mobile_Number1,
Mobile_Number12 etc. If you need more than one column to store similar data then put this data into its own table and link it back to the parent table.
Second Normal Form(2NF)
A table is in 2NF if it is already in 1NF and all non-key attributes should depend on the primary key attribute. If any attribute can be identified via another attribute then those attribute should go in their own table (in our case RoleId and RoleName) For example, let say we have a Contacts table with ContactsId as the primary key. Then columns like FirstName, LastName, DateOfBirth can be derived or identified using ContactId as the primary key but if we have columns like RoleId, RoleName in the same table then these columns should not be identified by ContactId. These should be in their own table separately.
Third Normal Form(3NF)
A table is in 3NF if its already in 2NF and all attributes in the table should depend on primary key attribute ONLY. This sounds similar to 2NF but the difference is we’ll eliminate the columns that do not depend upon the primary key attribute. So all attributes should be identifiable via primary key column/attribute ONLY.
There are other forms of normalisation as well but these three forms are mostly enough for almost all scenarios.