sql server programming:
I am working on a database that is going to store contact information. I am
trying to normalize this area quite a bit because I want multiple object
types to be able to have the same address.
I have built a Company Entity and a Employee Entity. I also have
ElectronicAddress and PhysicalAddress Entities. These are related with a
Object_has_ContactInformation Relationship.
Company
=======
1 Microsoft
2 Apple
Employees
=========
23 BillG
2 SteveJ
PhysicalAddress
===============
8 1 Apple Way
99 56 Microsoft Lane
Object_has_ContactInformation
=============================
Object, AddressId
2 8
The problem is that this table has duplicates are we using a company (Apple)
or an Employee (steveJ). How should I best handle this? Do I add a key
ObjectType into Object_has_ContactInformation?
Object_has_ContactInformation
=============================
ObjectId, ObjectType, AddressId
2 Company 8
That would help. Or do I create a table that handles the Keys
ContactInformationRegistry? Then use these keys to associate with the
ContactInformation.
ContactInformationRegistry
==========================
Key, ObjectId, ObjectType(?)
1 2 Company
Registry_has_ContactInformation
=============================
RegistryId, AddressId
2 8
I am sure that I am way off base, but I would love to hear more ideas on the