Database Normalisation (Making Sense of Data) - 1NF First Normal Form
I need to catch up on the three Normal Forms.
For a given data table (somewhere we are planning to store information) it can be classified into one of the following Normal Forms, and then refined towards the 3NF. The idea is to make the most sensible use of data by arranging it appropriately.
1NF or First Normal Form
1NF ensures there will be no repetition of similar information within a record (one set of data). It also states there must be a valid Primary Key (a unique Index - or a non-repeating field or group of fields that has a one to one relationship with the rest of the information).
So a proposed data table for users with up to 3 home computers might look like:
Username,Fullname,Computer1,Computer2,Computer3
This could contain 1 record that looks something like:
jbloggs,Joe Bloggs,laptop,pc,mac
It’s quite apparent that the three field Computer1,Computer2, and Computer 3 all describe similar information and 1NF tells us it can’t. So we change the table to look like this
Username,Fullname,Computer
And to show the three computers now we would have 3 records
jbloggs,Joe Bloggs,laptop
jbloggs,Joe Bloggs,pc
jbloggs,Joe Bloggs,mac
To be fully 1NF we must also make sure we have a valid Primary Key. We can’t use the Username or Fullname field on its own because a Primary Key can only appear once (ie a Unique Index). This means the primary key could now be:
(Username,Computer)
I suppose it could also be (Fullname,Computer) or (Username,Fullname,Computer) for that matter but we need to pick one so we’ll use the (Username,Computer) form.
The data table is now First Normal Form.
But, you ask, isn’t that wasteful? Now you have much more data than you started with as both Username and Fullname are repeated over and over. Yes, you would be right about that and that’s where 2NF or Second Normal Form comes in.
















Leave a comment!