Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail
From: "Mark D Powell" <Mark.Powell@eds.com>
Newsgroups: comp.databases.theory
Subject: Re: Do you have any sugestion of a good book about modeling ?
Date: 4 Feb 2005 07:23:04 -0800
Organization: http://groups.google.com
Lines: 24
Message-ID: <1107530584.631925.309620@z14g2000cwz.googlegroups.com>
References: <1107464366.129950.75360@g14g2000cwa.googlegroups.com>
NNTP-Posting-Host: 192.85.50.1
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1107530588 4223 127.0.0.1 (4 Feb 2005 15:23:08 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 4 Feb 2005 15:23:08 +0000 (UTC)
In-Reply-To: <1107464366.129950.75360@g14g2000cwa.googlegroups.com>
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: z14g2000cwz.googlegroups.com; posting-host=192.85.50.1;
   posting-account=J7QqBQwAAABTieek3RP_669Gs2iATWzr
Xref: dp-news.maxwell.syr.edu comp.databases.theory:29748

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 --

