The work of Dr. Codd as published in A Relational Model of Data for Large Shared Data Bank by E.F. Codd provides the detailed and comprehensive explanation of Relational Model and Normalization.
I just want my blog to be short and sweet each day. So, over the next 3 days, I shall blog on a normalization rule. I learn by example so I shall discuss the rules through examples.
Normalization helps eliminate the problems of redundancy in database design. It reinforces referential integrity in the database and provides a way to index. A highly normalized design may need a large number of joins. Hence, there is a need to carefully review the degree of normalization in a database design. One must consider the database’s intended use.
The First 3 Rules of Normalization are:
Part 1 of my blog will be about 1NF.
Thursday evening till morn, I worked trying to finish as much work as I can to meet deadlines due before 2005 knocks at the door. If some people are stressed with holiday shopping, you can say I am overwhelmed by the amount of work that needs to be done by the end of the year.
Anyway, yesterday morning, Friday, with only an hour of sleep, our project team was conducting a proof of concept run. I wrote a script that had the object of producing a flat file with one record with fields placed in an exact postion for upload to the mainframe. The script extracts data from an Oracle table. Simple right? We ran the script and viola... the script produced the flat file but the field positions were off by 1. The script goes:
set termout off
set hea off
set pagesize 0
spool H:\BART_LBS\pclink32\UpLoads\k4201.PRN
select CORP||'|',ITMNBR||'|',WHSE||'|',PRIMBNLOC||'|',SECBNLOC
from k42
where ITMNBR like '62-40-00200%' AND WHSE like 'WS%';spool off
I scratched my sleepy head kept awake by coffee
. I checked the field lengths of the columns of my table and they were correct. So, field length inaccuracy was not the cause... Darn, don't you hate it when the simplest of things don't work right?
Here's the corrected SQL statement. The bright-eyed and
alert, Lee, found the culprit.
select CORP||'|'||ITMNBR||'|'||WHSE||'|'||PRIMBNLOC||'|'||SECBNLOC||'|'
from k42
where ITMNBR like '62-40-00200%' AND WHSE like 'WS%';
Yes, the culprit was the " , " that produced the extra space. Toast to you, Lee. This blog entry is for you. 