Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Company Person Realationship

$
0
0
I have a schema question about a database I am putting together. The database will be used to track the contact information and dialogs we have with people at the various companies we work with. These people may leave a company to work somewhere else but I want the relationships that the letter creates, both to the company and person to be preserved in the DB. In the future I can call a company, and in the past I spoke with so and so, or call the person and see that while there were at the previous company we discusses this and that. What is the best way to set this up in the DB?

1. have a table that has a primary key of say "PersonCompany" and then foreign key of "Company" and foreign key of "Person". So if I want to log a letter to a person at a company I would just use the PersonCompany PK and the letter would always have association with both entities (person and company)

2. Instead of a single value (PK) to capture the relationship between a person and company. Should I use two foreign keys, one for the person and one for the company, to indicate the letter has a relationship to both entities.

Both methods seem to work, but I'm wondering what is the most appropriate way to set up this relationship.

Thanks,
Dave

Viewing all articles
Browse latest Browse all 13329

Trending Articles