Re: Question about modeling
From: Alexandr Savinov <savinov_at_ais.fhg.de>
Date: Thu, 27 Jan 2005 11:43:23 +0100
Message-ID: <41f8c5d8$1_at_news.fhg.de>
Date: Thu, 27 Jan 2005 11:43:23 +0100
Message-ID: <41f8c5d8$1_at_news.fhg.de>
Here the second field is a reference to a single CLIENT.
Then you remove this reference from Departments so you get:
-- http://conceptoriented.com "Mathieu Pagé" <informatique_remove_this__at_csfinc.com> schrieb im Newsbeitrag news:CZtJd.30725$Qb.29245_at_edtnps89...Received on Thu Jan 27 2005 - 11:43:23 CET
> Hi, I have this model:
>
> DEPARTMENTS (dp_id, cl_id, dp_otherStuff)
> CLIENT (cl_id, cl_otherStuff)
> CONTRACT (cn_id, cn_details)
>
> Then I want to link DEPARTMENTS to CLIENT as each department can have 0..N
> contracts and each contract can be associated to 1..N departments, so I
> created this table:
>
> DEPTS_CONTRACT_LINK (dp_id, cn_id)
>
> So, it works :)
>
> Now I want to add this constraint : As I have said each contract can be
> associated with one or more departments, but I want that all those
> departments belongs to the same client. In other words, departments can
> share contract, but clients can not.
>
> How can I do this ?
>
> Mathieu Pagé
>
> PS : I will eventually use Ms access as a RDBS, so the solution can not
> use trigger to verify the constraint.
>
