Hello.
I realise that the answer to these types of questions are often "it depends" but still I wondering what the general consensus might be.
I am dealing with multiple entities such as
- Company
- Charity
- Auditor
- Stocktaker
etc etc...
Which all have contact information such as e-mail, telephone and address.
The two design methods I was thinking to store the contact info were
Method 1) create role tables between the contact tables and company, charity, auditor and stocktaker.
- dbo.Company -> dbo.CompanyAddress <- dbo.Address
- dbo.Company -> dbo.Companytelephone <- dbo.telephone
dbo.Company -> dbo.Companyaddress <- dbo.email
dbo.Auditor-> dbo.AuditorAddress <- dbo.Address
- dbo.Auditor-> dbo.Auditortelephone <- dbo.telephone
- dbo.Auditor-> dbo.Auditoraddress <- dbo.email
Advantages, there only needs to be one address, telephone and email table in database and all telephone numbers, addresses and emails for each entity type are stored in one place Disadvantages are it creates a lot of associative tables
Method 2) Create a separate contact table per company, charity, auditor and stocktaker
- dbo.Company -> dbo.CompanyContactAddress
- dbo.Company -> dbo.CompanyContacttelephone
dbo.Company -> dbo.CompanyContactaddress
dbo.Auditor -> dbo.AuditorContactAddress
- dbo.Auditor -> dbo.AuditorContacttelephone
- dbo.Auditor -> dbo.AuditorContactaddress
Advantages of this are easier to implement and maintain Disadvantages are contact details are stored in multiple locations across the database.
If anyone has any other ideas it would be much appreciated.
Many thanks