Re: Do you have any sugestion of a good book about modeling ?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 4 Feb 2005 07:23:04 -0800
Message-ID: <1107530584.631925.309620_at_z14g2000cwz.googlegroups.com>


To enforce data integrity you define constraints on your tables that reflect the data relationships between the tables. Namely most every table in your application should have a declared PK and child tables should reference the PK of parent tables via a FK. Some UK definitions will also likely be in order.

Note in theory every table should have a PK but most real world applications will perform a couple of tasks often creating holding tables for extraction where the data in the table consists of transactions with no unique identifier. Because the data is just processed sequentially and because the data is overlaid on every run the overhead of a surrogate key that will not be used in the processing is not added. These work tables are just interface areas and are not part of the proper design.

Back to the main point you use PK, UK, and FK to enforce the relational integrity rules between the data. You may also need to use table triggers to enforce more complex relationships. If you do not get your desing into at least third normal form you may run into situations where the standard PK, UK, and FK constraints cannot be used to enforce integrity.

HTH -- Mark D Powell -- Received on Fri Feb 04 2005 - 16:23:04 CET

Original text of this message