Normalization in databases
Normalization is the process of transforming database relationships to a normal form (a step-by-step, reversible process of replacing the original schema with another schema in which the datasets have a simpler and more logical structure).
Normalization is intended to bring the database structure to a form that provides minimal logical redundancy, and is not intended to decrease or increase the performance or decrease or increase the physical volume of the database. The ultimate goal of normalization is to reduce the potential inconsistency of information stored in the database.
Normal forms
First Normal Form (1NF) - relationship is in 1NF if the values of all its attributes are atomic (indivisible).
Second normal form (2NF) - relationship is in 2NF if it is in 1NF, and all non-key attributes depend only on the whole key, and not on any part of it.
Third normal form (3NF) - relationship is in 3NF if it is in 2NF and all non-key attributes are independent of each other.
Fourth normal form (4NF) - relationship is in 4NF if it is in 3NF and does not contain independent attribute groups between which there is a many-to-many relationship.
Fifth Normal Form (5NF) - relationship is in 5NF when each nontrivial join dependency in it is determined by the potential key(s) of that relationship.
Sixth Normal Form (6NF) - relation is in 6NF when it satisfies all non-trivial join dependencies, i.e. when it is irreducible, that is, it cannot be subjected to further decomposition without loss. Every relational variable that is in 6NF is also in 5NF. Introduced as a generalization of the fifth normal form for a chronological database.
Boyes-Codd normal form, enhanced 3 normal form (BCNF) - relation is in BCNF when each of its nontrivial and left-irreducible functional dependencies has a potential key as its determinant.
Domain Key Normal Form (DKNF) - relation is in DKNF when each constraint imposed on it is a logical consequence of the domain constraints and key constraints imposed on the relation.
Denormalizing
Denormalizing database is the process of deliberately converting database to a form that does not conform to normalization rules. This is usually necessary to improve the performance and speed of data retrieval by increasing data redundancy.
Read also:
- Common tasks performed in servlet container in Java
- Database and keys
- Transaction isolation levels in database
Comments
Post a Comment