Best Practices In Database Designing and Normal Forms:
Naming Convention:
1. It’s bad idea to use dashes, spaces, digits and special characters in the names
2. Use CamelCase all names
3. Employee table primary key is ID,In other table foreign key is EmployeeID (FK), Salary table primary key is ID->In other table foreign key is SalaryID(FK)...etc
4. Check your spellings with meanings
5. Its god idea to not delete physically use isDeleted /cancelYN to true or isActive to false
6. Add createdOn , createdBy , modifiedOn , modifiedBy , Remarks to transaction tables
7. Add isActive or CancelYN fields in master tables
First Normal Form (1NF)
First normal form (1NF) says that:
• Eliminate duplicative or redundant columns from the same table.
• Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key or composite key).
Second Normal Form (2NF)
Second normal form (2NF) enforces the concept of removing redundant data:
• Satisfy the first normal form.
• Take off subsets of data that apply to multiple rows of a table and put them in separate tables.
• Build relationships among these new tables and their predecessors by using foreign keys.
Third Normal Form (3NF)
Third normal form (3NF) further explains:
• Satisfy all the requirements of the second normal form.
• Get rid of columns that are not dependent upon the primary key.
Fourth Normal Form (4NF)
At last, fourth normal form (4NF) adds one more requirement:
• Satisfy all the requirements of the third normal form.
• A relation is in 4NF if it has no multi-valued dependencies.
Naming Convention:
1. It’s bad idea to use dashes, spaces, digits and special characters in the names
2. Use CamelCase all names
3. Employee table primary key is ID,In other table foreign key is EmployeeID (FK), Salary table primary key is ID->In other table foreign key is SalaryID(FK)...etc
4. Check your spellings with meanings
5. Its god idea to not delete physically use isDeleted /cancelYN to true or isActive to false
6. Add createdOn , createdBy , modifiedOn , modifiedBy , Remarks to transaction tables
7. Add isActive or CancelYN fields in master tables
First Normal Form (1NF)
First normal form (1NF) says that:
• Eliminate duplicative or redundant columns from the same table.
• Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key or composite key).
Second Normal Form (2NF)
Second normal form (2NF) enforces the concept of removing redundant data:
• Satisfy the first normal form.
• Take off subsets of data that apply to multiple rows of a table and put them in separate tables.
• Build relationships among these new tables and their predecessors by using foreign keys.
Third Normal Form (3NF)
Third normal form (3NF) further explains:
• Satisfy all the requirements of the second normal form.
• Get rid of columns that are not dependent upon the primary key.
Fourth Normal Form (4NF)
At last, fourth normal form (4NF) adds one more requirement:
• Satisfy all the requirements of the third normal form.
• A relation is in 4NF if it has no multi-valued dependencies.
Comments