The Most Active and Friendliest
Affiliate Marketing Community Online!

“Propeller”/  Direct Affiliate

Into Databases Part III - Normalisation

lala56

New Member
affiliate
It is called normalisation when you efficiently organise tables in a database and use as little disk space as possible. Redundant data and integrity issues through unsynchronised data are avoided as much as possible. The process of normalising starts off with the least restrictive through to the most restrictive rule. There are several steps in the process, which are called forms. Each form needs to meet the requirements from the previous form plus its own set of rules.

The first normal form (1NF) is achieved when there are no repeating groups, so you have to create a separate table for each set of related attributes. Furthermore, each cell in the table is single-valued, entries in a column are of the same kind, each row contains the same columns and there are no duplicated rows. As there are no duplicated rows the table has a primary key.

The second normal form (2NF) has its emphasis on the elimination of redundant data. Each non-key attribute must be directly dependent on the primary key. If an attribute is dependent only on a part of a multi-valued key it must be moved to another table. Also, all the requirements for the first normal form must be met.

The third normal form (3NF) involves the removing of all non-key attributes, which are only necessary to describe other non-key attributes in the same table. 1NF and 2NF must also be met. Once you achieve the third normal form you eliminate the possibility of unsynchronised data as each attribute exists only once in database.

If a table is in 3NF and a combination of attributes can be used to uniquely identify a record (called candidate key) then it is in Boyce-Codd normal form (BCNF). In contrary to 3NF those candidate keys cannot be composite keys (with a composite key you need more than one attribute to uniquely describe a record). Also, if there is more than one candidate key in table and some attributes in the keys are common, this is no BCNF.

4NF requires firstly BCNF and a given relation should not have more than one multi-valued attribute (two or more 1:M or M:M relationships per table, which are not directly related, are prohibited).

The goal of the fifth normal form (5NF) is to continue to split the tables until a split would make it impossible to join the tables to recreate the flat view of the data (starting point) or the splits left are trivial (for example for “yes/no-answers” it would be ludicrous to have a separate table with yes and no to eliminate repeats in the given table).

A table is in domain/key normal form (DKNF) if you strictly enforce key and domain constraints (description of allowed values for a given attribute). Through DKNF modification anomalies are eliminated.

Please let me know if this is too theoretical to understand. I am more than happy to provide examples for each step. Otherwise, you can expect part IV in due course. In this part we will shift away from theoretical aspect and actually get our hands dirty…
 
Want to apologise as I still have not had a chance to compile the next article in this series...

Am very busy, but will continue as soon as I have a little gap:)

lala
 
Apologies

Have to apologise that I have not delivered the promised article yet (and I have not been around for a while)... Hopefully my life gets a bit more organised soon...

lala
 
Yes, sometimes it all goes crazy, especially when you discover what it means when they say "the terrible twos". The tandrums of my little boy reaching extreme levels right now. Feel like I have to go alone on a holiday or so...;)

lala
 
I know what you mean, been there 4 times :( but thank god no more children ever. But just stick with it and you will have a fine young prince in the next few year. And they revert back to frogs when the are teens :(
 
MI
Back