I am rethinking my design of my Addressbook database:
Tables:
Customer (users that have an account)
Person (persons that are a contact)
Address
Group
Relationships:
A customer is a person itself and will have his own address.
Customer 1:1 Person 1:1 Address
The customer as a Person will also have family members living on the same address:
Address 1:N Person
The only thing that I am missing above is that the customer as a person itself cant have more addressess then one.
Now of to the addressbook:
A customer will have severall contacts as in Persons and those persons will have 1 or more addressess.
Customer 1:N Person N:N Address
The above relationships do work, but what about grouping a bunch of Persons to 1 address? I could do that within code ofcourse, but I could also make it in table design. So an Address should have 1 or more persons, so then you would turn the Person and Address
around, but still the person is the contact to the Customer and not the address.
I also want to group some amount of Persons or Addressess to a group. So for example when there are Colleagues then I would like to make a group of the company with a list of Persons that belong to that Group. Ofcourse the address will hang below it and
the Persons that live with those Collegeagues will be there also.
So what is a good way to do this? What am I doing wrong? Please give me some good examples were I can work with.
SpaceLama
Member
171 Points
136 Posts
Architecture Database
Dec 05, 2012 06:51 PM|LINK
Hello everyone,
I am rethinking my design of my Addressbook database:
Tables:
Customer (users that have an account)
Person (persons that are a contact)
Address
Group
Relationships:
A customer is a person itself and will have his own address.
Customer 1:1 Person 1:1 Address
The customer as a Person will also have family members living on the same address:
Address 1:N Person
The only thing that I am missing above is that the customer as a person itself cant have more addressess then one.
Now of to the addressbook:
A customer will have severall contacts as in Persons and those persons will have 1 or more addressess.
Customer 1:N Person N:N Address
The above relationships do work, but what about grouping a bunch of Persons to 1 address? I could do that within code ofcourse, but I could also make it in table design. So an Address should have 1 or more persons, so then you would turn the Person and Address around, but still the person is the contact to the Customer and not the address.
I also want to group some amount of Persons or Addressess to a group. So for example when there are Colleagues then I would like to make a group of the company with a list of Persons that belong to that Group. Ofcourse the address will hang below it and the Persons that live with those Collegeagues will be there also.
So what is a good way to do this? What am I doing wrong? Please give me some good examples were I can work with.
Greetings,
Spacelama