Re: Question about modeling

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Wed, 26 Jan 2005 09:18:08 -0800
Message-ID: <1106759733.295242_at_yasure>


Mathieu Pagé wrote:
> 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é

You can but since you snipped the example I'm not sure what the original suggestion was I made. If you contact me off-line at the email address below I'll do so.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Jan 26 2005 - 18:18:08 CET

Original text of this message