Re: Many to Many design help
From: larzeb (larzeb_at_community.nospam)
Date: 11/11/04
- Next message: Peter: "Re: Passing table and column names as parameters"
- Previous message: johndoe_at_driver.net: "Full Text Indexing on Microsoft SQL Server 2000 with Windows XP Pro"
- In reply to: larzeb: "Re: Many to Many design help"
- Next in thread: Hugo Kornelis: "Re: Many to Many design help"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 18:39:21 -0800
Thanks so much to you all for taking the time on this. It's given me a
lot to think about.
On Wed, 10 Nov 2004 16:48:15 -0800, larzeb <larzeb@community.nospam>
wrote:
>Hugo,
>
>Thanks for your help; you can see I'm struggling.
>
>Your assumptions were correct except for #3, Each house is inhabited
>by only one person.
>
>>ASSUMING THAT
>>1. Each person lives in exactly one house,
>>2. Each person owns 0, 1, or more houses,
>>3. Each house is inhabited by 1 or more persons, and
>>4. Each house is owned by exactly one person,
>>
>
>I can't understand how your suggestion might work in the situation
>where I am living in house A and you own house A. In that case I will
>need 2 Persons associated with the same house (A). In that case it is
>a one to many (House to Person) relationship.
>
>Where the owner lives in the house himself, it is a one to one
>relationship.
>
>Thanks again, Larzeb
>
>>CREATE TABLE Persons (PersonID int NOT NULL,
>> LivesInHouse int NOT NULL,
>> PRIMARY KEY (PersonID),
>> FOREIGN KEY (LivesInHouse) REFERENCES Houses
>> )
>>CREATE TABLE Houses (HouseID int NOT NULL,
>> OwnedBy int NOT NULL,
>> PRIMARY KEY (HouseID),
>> FOREIGN KEY (OwnedBy) REFERENCES Persons
>> )
>>
>>Of course, if my assumptions are wrong, the model has to change.
>>
>>Best, Hugo
- Next message: Peter: "Re: Passing table and column names as parameters"
- Previous message: johndoe_at_driver.net: "Full Text Indexing on Microsoft SQL Server 2000 with Windows XP Pro"
- In reply to: larzeb: "Re: Many to Many design help"
- Next in thread: Hugo Kornelis: "Re: Many to Many design help"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|