oumahexi
Free Range Witch
- Local time
- Today, 15:21
- Joined
- Aug 10, 2006
- Messages
- 1,998
Hi, I just sent the following to a friend and wondered if it might be helpful to others, it's just a brief overview of Normalisation. I'm sure there are some far more experienced people out there who can expand on this to help novices.
The aim of normalising a database is to both eliminate redundant data, such as data stored in more than one table, and to make sure that dependencies make sense in as much as only related data in a table is stored. This approach not only saves on the amount of space your database uses, but will make sure your data is stored logically.
There are guidelines to making sure your database is normalised. The accepted guidelines are known as Normal Forms and these are numbered one to five, with four and five being rarely used. Remember that these are guidelines, they are not written in stone and from time to time the more confident developer may choose not to follow these guidelines. Written reference to Normal Forms is as follows: 1NF (first normal form) 2NF (second Normal Form), 3NF (third Normal Form), 4NF (fourth Normal Form), 5NF (fifth Normal Form)
1NF sets the basic rules for a well organised database which are to eliminate duplicate columns from the same table and create separate tables for each group of related data and identify each row with a unique identifier known as the primary key.
So, the first rule is not to duplicate data in the same row of a table.
2NF is based on 1NF, in addition it elects to remove subsets of data which apply to multiple rows in a table and put them in separate tables. It then creates relationships between these newly formed tables and the ones they are based on using foreign keys.
3NF is based on 2NF, incorporating the fundamentals of 1NF, a 3NF database removes columns that are not dependent on the primary key.
Remember that normalisation is not a magical button on your software, it is the concept with which you initially design your database.
The aim of normalising a database is to both eliminate redundant data, such as data stored in more than one table, and to make sure that dependencies make sense in as much as only related data in a table is stored. This approach not only saves on the amount of space your database uses, but will make sure your data is stored logically.
There are guidelines to making sure your database is normalised. The accepted guidelines are known as Normal Forms and these are numbered one to five, with four and five being rarely used. Remember that these are guidelines, they are not written in stone and from time to time the more confident developer may choose not to follow these guidelines. Written reference to Normal Forms is as follows: 1NF (first normal form) 2NF (second Normal Form), 3NF (third Normal Form), 4NF (fourth Normal Form), 5NF (fifth Normal Form)
1NF sets the basic rules for a well organised database which are to eliminate duplicate columns from the same table and create separate tables for each group of related data and identify each row with a unique identifier known as the primary key.
So, the first rule is not to duplicate data in the same row of a table.
2NF is based on 1NF, in addition it elects to remove subsets of data which apply to multiple rows in a table and put them in separate tables. It then creates relationships between these newly formed tables and the ones they are based on using foreign keys.
3NF is based on 2NF, incorporating the fundamentals of 1NF, a 3NF database removes columns that are not dependent on the primary key.
Remember that normalisation is not a magical button on your software, it is the concept with which you initially design your database.