I am going to put up a short series of posts on normalization. It is based on an exercise I found in a textbook, long since forgotten. But it is an interesting and clear example nonetheless. The goal will be to take an Excel spreadsheet and convert it to 3rd normal form. Later I may extend it to Boyce-Codd, which I consider a variation on 3rd normal, and 4th normal.
When designing a database from scratch one would, of course, aim for a properly designed database free from anomalies. Nevertheless, it is very helpful to understand the basics of normalization so that problems can be avoided. Plus, in today's environment much data exists in Excel spreadsheets. These must be normalized as they are imported into a relational database.
Business case
Tracking of large industrial equipment such as boilers, feed heaters, etc. in chemical plants in the South. Each piece of equipment has a composite primary key consisting of the plant name and equipment type. In other words something like styrene feed heater.
Normal forms
There are five normal forms, three of which we will consider in this series. They are cumulative in the sense that a table that satisfies 2nd normal form also satisfies 1st and so on. I will cover 1st in this post. 2nd and 3rd in future posts.
1st normal form
To be in 1st normal form a table must meet the following conditions:
All rows are unique
All cells are atomic
There are no repeating groups
The order of rows and columns does not matter
Original spreadsheet
Below is the original spreadsheet. Plant name and eqpt name form a composite identifier for each row. This spreadsheet contains a violation of the 1st normal form rules.
I will cover what the problem is in my next post. A succeeding post will then introduce 2nd normal form.
Regards,
Dan D'Urso
Laguna Niguel, CA
No comments:
Post a Comment