Re: 3NF question

From: -CELKO- <jcelko212_at_earthlink.net>
Date: 12 Jan 2005 09:07:47 -0800
Message-ID: <1105549667.023167.81360_at_f14g2000cwb.googlegroups.com>


>>[data integrity? Validation? Verification?] OK. So I am stupid.
Please point me to references that discuss these problems (I didn't see much about this in SQL for Smarties). I would appreciate that very much. <<

I will cover it in my next book, SQL PROGRAMMING STYLE, but you can find my rants in newsgroups. Basically, when you have two keys you have to make sure they reference the same entity. Since an auto-number is really a physical position inside the hardware and has nothing to do with the data model, there is no way to have data integrity because there is no validation.

Example: enter a row with only IDENTITY declared as the key. Repeat this operation 1000 times. Opps!

Enter a row with both IDENTITY and a natural key. Build PK-FK references on just the IDENTITY. Delete the row and re-insert it in one transaction. It gets a new IDENTITY, but by definition has its natural key. Your database is now screwed.

>> Sir, what is the check digit? <<

A check digit is an extra character in an encoding that can be used to verify that this is a possible value. They are used to prevent input errors.

Look at the back of a book for the ISBN. It is ten digits long. The first group of 1-2 digits is the language, the next group is the publisher, the third is the book within publisher and the last is a Mod 11 chck digit which assumes the values (0-9,X). You multiple all the digits by their ordinal position from left to right, sum those nine figures and apply Mod 11 to it. The reminder is the last position, and X is the Roman numercal for Ten. Received on Wed Jan 12 2005 - 18:07:47 CET

Original text of this message