Sei sulla pagina 1di 3

Before we begin our discussion of the normal forms, it's important to point out that they are guidelines

and guidelines only. Occasionally, it becomes necessary to stray from them to meet practical business requirements. However, when variations take place, it's extremely important to evaluate any possible ramifications they could have on your system and account for possible inconsistencies. That said, let's explore the normal forms. First Normal Form (1NF) First normal form (1NF) sets the very basic rules for an organized database:

Eliminate duplicative 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). For more details, read Putting your Database in First Normal Form Second Normal Form (2NF) Second normal form (2NF) further addresses the concept of removing duplicative data: Meet all the requirements of the first normal form. Remove subsets of data that apply to multiple rows of a table and place them in separate tables. Create relationships between these new tables and their predecessors through the use of foreign keys. For more details, read Putting your Database in Second Normal Form Third Normal Form (3NF) Third normal form (3NF) goes one large step further: Meet all the requirements of the second normal form. Remove columns that are not dependent upon the primary key. For more details, read Putting your Database in Third Normal Form Boyce-Codd Normal Form (BCNF or 3.5NF) The Boyce-Codd Normal Form, also referred to as the "third and half (3.5) normal form", adds one more requirement: Meet all the requirements of the third normal form. Every determinant must be a candidate key. For more details, read Putting your Database in Boyce Codd Normal Form Fourth Normal Form (4NF) Finally, fourth normal form (4NF) has one additional requirement: Meet all the requirements of the third normal form. A relation is in 4NF if it has no multi-valued dependencies. Remember, these normalization guidelines are cumulative. For a database to be in 2NF, it must first fulfill all the criteria of a 1NF database. First Normal Form A relational table is considered to be in the first normal form from the start. All values of the column are atomic, which means it contains no repeating values. Second Normal Form The second normal form means that only tables with composite primary keys can be in the first normal form, but not in the second normal form. A relational table is considered in the second normal form if it is in the first normal form and that every non-key column is fully dependent upon the primary key. The process of moving from a first normal form into the second normal form consists of five steps which include: 1. Identify any determinants other than the composite key, and the columns they determine. 2. Create and name a new table for each determinant and the unique columns it determines.

3. Move the determined columns from the original table to the new table. The determinate becomes the primary key of the new table. 4. Delete the columns you just moved from the original table except for the determinate which will serve as a foreign key. 5. The original table may be renamed to maintain semantic meaning. Third Normal Form A relational table is considered in the third normal form if all columns in the table are dependent only upon the primary key. The five step process for transforming into a third normal form are as follows: 1. Identify any determinants, primary key, and the columns they determine. 2. Create and name a new table for each determinant and the unique columns it determines. 3. Move the determined columns from the original table to the new table. The determinate becomes the primary key of the new table. 4. Delete the columns you just moved from the original table except for the determinate which will serve as a foreign key. 5. The original table may be renamed to maintain semantic meaning. The third normal form is where the relational tables should be because they have the advantage of eliminating redundant data which saves space and reduces manipulation anomalies. Advanced Normalization Edit Most experts agree that normalization past 3NF is a waste of resources because it yields few tangible benefits, but it is important to understand the problems presented past 3NF because they do occasionally occur in real life situations. Boyce-Codd Normal Form (BCNF) This is a more robust version of 3NF that occurs only under specific circumstances. There must be multiple candidate keys, one of the keys must be composite, and the candidate keys must overlap. In order to normalize the relation the developer must pick a determinant in which one column is fully functionally dependent upon. Then he must create a second relation so that every determinant is a candidate key. Fourth Normal Form (4NF) Issues with 4NF occur when a relation is in BCNF and all multi-valued dependences are also functional dependencies. For example, Suppose that employees can be assigned to multiple projects. Also suppose that employees can have multiple job skills. If we record this information in a single table, all three attributes must be used as the key since no single attribute can uniquely identify an instance (UTA). This would create anomalies that would fit under update, insert, and delete functions. In order to solve this problem, simply move each multivalued dependency to its own table. Fifth Normal Form (5NF) 5NF addresses project-join dependency issues within tables that have been decomposed. During the normalization process large tables are broken into smaller cohesive tables. Usually a table in 4NF is considered to be in 5NF, but sometimes abstract insertion anomalies may hinder the join process of a decomposed table. If a table cannot be decomposed further, it is said to be in 5NF. Domain Key Normal Form (DKNF) Of all the advanced normalization forms, this one is by far the most academic. It was created as a catch-all to stop all critics of normalization of picking apart the system. Originally, 3NF was the final step to normalization, but others began trying to break it. Each form past 3NF is another one of these attempts. Finally Ron Fagan published a paper about basing normalization on domains and keys. His conclusion was that if one carefully creates tables so all domains and keys are of logical consequence, it should be fully normalized (Database Debunks). It cannot, however, really be proven that a table is in DKNF, while a table can always be tested to be

in 5NF. Normalization Example :Table 1 is in a database contains these attributes (A-O) and the dependencies are listed below. Table 1 (A,B,C,D,{E,F},{G,H,I,J},K,L,M,N,O) Dependencies: AB,C,D,E,F,K,L CD EF GH,I,J IJ KL MN,O First Normal Form Removing Repeating Groups.Repeating groups are defined by {XXX} Table 1 (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) Transitive Dependencies The repeating groups are removed by making the determinate a primary key Second Normal Form Remove Partial Functional Dependencies Table 1 (A,B,C,D,K,L,M,N,O) Table 2 (E,F) Table 3 (G,H,I,J) The Partial Functional Dependencies are removed by splitting the table into 3 different tables making the newly created primary keys the first attribute in the table Third Normal Form Removing Transitive Dependencies Table 1 (A,B,C,D,K,M) Table 2 (K,L) Table 3 (M,N,O) Table 4 (E,F) Table 5 (G,H,I,J) The transitive dependencies are removed by taking the transitive dependencies determinates in table 1 (K & M) and making them a foreign key in Table 1 and then creating two more table with those determinates as the primary keys. Normalized through Boyce-Codd Normal Form** It is generally not required to normalize the database tables past Boyce-Codd Normal Form because the database is required to have some redundancy to properly connect the tables through referencing.This is called controlled redundancy.

Potrebbero piacerti anche