Re: Question about modeling
From: Mathieu Pagé <informatique_remove_this__at_csfinc.com>
Date: Wed, 26 Jan 2005 14:48:36 GMT
Message-ID: <85OJd.363$FD5.7_at_clgrps12>
>
> departments, but I want that all those departments belongs to the same
> client. In other words, departments can share contracts, but clients
> can not. <<
>
> It sounds like a client should be modeled as an attribute of a
> contract.
>
> CREATE TABLE Contracts
> (contract_id INTEGER NOT NULL PRIMARY KEY,
> client_id INTEGER NOT NULL
> REFERENCES Clients(client_id)
> ON DELETE CASCADE
> ON UPDATE CASCADE,
> ..);
>
Date: Wed, 26 Jan 2005 14:48:36 GMT
Message-ID: <85OJd.363$FD5.7_at_clgrps12>
-CELKO- a écrit :
>>>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 contracts, but clients
> can not. <<
>
> It sounds like a client should be modeled as an attribute of a
> contract.
>
> CREATE TABLE Contracts
> (contract_id INTEGER NOT NULL PRIMARY KEY,
> client_id INTEGER NOT NULL
> REFERENCES Clients(client_id)
> ON DELETE CASCADE
> ON UPDATE CASCADE,
> ..);
>
Hi CELKO,
Thanks for your answer, your help is appreciated.
If I create the table as you suggest, it wont tell wich departments share the contract. For a client that have (as an example) four departments, maybe only one, or two of them share the contract.
I think that what Tony Adrews suggest in another post of this thread is the right thing to do. What do you think about it ?
Mathieu Pagé Received on Wed Jan 26 2005 - 15:48:36 CET