Professional Documents
Culture Documents
Database Normalization
Database normalization is the process of removing redundant data from your tables in to improve storage efficiency, data integrity, and scalability. In the relational model, methods exist for quantifying how efficient a database is. These classifications are called normal forms (or NF), and there are algorithms for converting a given database between them. Normalization generally involves splitting existing tables into multiple ones, which must be re-joined or linked each time a query is issued.
History
Edgar F. Codd first proposed the process of normalization and what came to be known as the 1st normal form in his paper A Relational Model of Data for Large Shared Data Banks Codd stated: There is, in fact, a very simple elimination procedure which we shall call normalization. Through decomposition non simple domains are replaced by domains whose elements are atomic (non decomposable) values.
Normal Form
Edgar F. Codd originally established three normal forms: 1NF, 2NF and 3NF. There are now others that are generally accepted, but 3NF is widely considered to be sufficient for most applications. Most tables when reaching 3NF are also in BCNF (Boyce-Codd Normal Form).
All values in the columns are atomic. This is, they contain no repeating values. There are no repeating groups: two columns do not store similar information in the same table. Basically: 1 NF is to eliminate duplicate columns
A relation is in 2 NF if it is in 1 NF and every non-key attribute is fully functionally dependant on the primary key
A relation is in 3 NF if it is 2 NF and no transitive dependencies exist. Transitive dependency is a functional dependency between non-key attribute Basically: 3 NF is to eliminate column not depend upon the primary key.
Transitive Dependency
transitive dependency
Cust_ID
Name
Salesperson
Region
Cust_ID
Name
Salesperson
Region
Salesperson
Region
Cust_ID
Name
Salesperson
A relation is in BCNF if it is in 3 NF and every determinant is a candidate key; in other words, each determinant can be used as a primary key. Determinant: an attribute on which some other attribute is fully functionally dependent
BCNF Example
Determinants:
A, B, C, and D A, B, C, and D
Candidate keys:
Thank You !!