Re: Question about modeling

From: Mathieu Pagé <informatique_remove_this__at_csfinc.com>
Date: Wed, 26 Jan 2005 14:59:41 GMT
Message-ID: <xfOJd.15938$Ob.1556_at_edtnps84>


guntermann_at_verizon.net a écrit :
> The constraint you mention can be structurally enforced with the use of
> superkeys as alternative keys.
>
> The following is a possibility in abbreviated notation. There is
> another, possibly more efficient way to model it as well, but I'll
> forego that for now. I am also explicitly not addressing referential
> integrity rules (ON UPDATE, DELETE, etc.).
>
> Let me know if you need clarification.
> CLIENTS(cl_id PK);
>
> DEPTS(d_id PK, cl_id FK references CLIENTS, AK (d_id, cl_Id));
>
> CONTRACTS(cn_id PK, cl_id FK references CLIENTS, AK(cn_id, cl_id));
>
> DEPTS_CONTRACTS(d_id, cn_id, cl_id, PK (d_pd, cn_id), FK (d_id, cl_id)
> REFERENCES DEPTS, FK (cn_id, cl_id) REFERENCES CONTRACTS));
>
> ** Example Implementation Follows**

<snip a detailed example, btw thanks>

>
> HTH,
>
> - Dan
>

Hi Dan,

Thanks for your detailed explanation, it seem that it is what I was looking for. I prefer to enforce referential integrity rules than to use constraint, it seem more efficient to me, or a least less error prone.

You mention that there was a more efficient way to model it. Can I ask what is it ?

Again, thanks for youre answer. It really do help.

Mathieu Pagé Received on Wed Jan 26 2005 - 15:59:41 CET

Original text of this message