Re: Implementing complicated constraints

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Wed, 29 Sep 2004 07:30:20 -0400
Message-ID: <e5CdnaeKxf1tAcfcRVn-rw_at_comcast.com>


"Agoston Bejo" <gusz1_at_freemail.hu> wrote in message news:cjdr0n$vr4$1_at_news.caesar.elte.hu...
| I would like to do this so that the structure of the tables remain the
same.
| (Since in the real-life analogue of this example it is important that the
| structures reflect the real-life concepts.)
|
| Anyway, the question is rather about the implementation of more
complicated
| constraints on tables than this specific example (which actually led me to
| pose this question in the newsgroup).
|
|
| "wario" <wario_spam_at_insightbb.com> wrote in message
| news:962c6d85.0409280619.395fb2_at_posting.google.com...
| > --Table A(AID, BID ref. B.BID, CID ref. C.CID, ATXT)
| > --Table B(BID, CID ref. C.CID)
| > --Table C(CID)
| >
| > 1. Add CID key to table A.
| > 2. Create unique index on CID and ATXT.
| >
| > Wario
|
|

Typically, the conceptual data model should accurately reflect the business reality -- but the actual table structure that implements the model will usually be compromised (denormalized) to accommodate technology

keep in mind that if these are dependent tables, the natural key structure would be:

C
CID
PK (CID ) B
CID
BID
FK(CID) ref C
PK(CID, BID) A
CID
BID
AID
TXT
FK(CID, BID) ref B
PK(CID, BID, AID) which then give you the option of adding the UK to table A -- but again, it depends on factors that you've not yet stated

++ mcs Received on Wed Sep 29 2004 - 13:30:20 CEST

Original text of this message