Database question with storing data

Hello Everyone,

I have a question, I am creating a application that will have several entities. For example purposes, lets say I have a Customer, Partner and Employee entities. I did not add the address or phone number to these entities so I created two other entities named, Phone and Address. I did it this way so I would be able to capture previous phone and address for these entities if my use case needed identify this past data. 

Would it be better to create say a Customer_Phone, Customer_Address, Employee_Phone and Employee_Address and so forth for each of these Entities? Or..would it be better to keep the Address and Phone number entities and store all the addresses in the 1 Address entity and phone number in 1 Phone Number entity and relate them to the Customer, Partner and Employee entities.


Thanks in advance. 

Hi, 

I think, It is better to have single entity Let suppose Users that have different Role like Customer , Partner and   Employee. And Users Table have different fields (i mean attributes) Like Name, Email, Gender,Phone,Address, etc.  


Thanks.

Thanks Rahul for the response. Question... Lets say the Customer entity, lets say Customer A changed their physical mailing address 3 time and phone number cell phone twice.. what would be a good way to capture the previous phone numbers and mailing addresses? Separate entities? Like Phone Number Entity and Mailing Address Entity and just associate it with the User table with foreign key to create a 1 to Many relationship?

Solution

Otis Brown wrote:

Hello Everyone,

I have a question, I am creating a application that will have several entities. For example purposes, lets say I have a Customer, Partner and Employee entities. I did not add the address or phone number to these entities so I created two other entities named, Phone and Address. I did it this way so I would be able to capture previous phone and address for these entities if my use case needed identify this past data. 

Would it be better to create say a Customer_Phone, Customer_Address, Employee_Phone and Employee_Address and so forth for each of these Entities? Or..would it be better to keep the Address and Phone number entities and store all the addresses in the 1 Address entity and phone number in 1 Phone Number entity and relate them to the Customer, Partner and Employee entities.


Thanks in advance. 


Hi,


would be good if you create one entity for additional info like phone & address.


create new static entity for type of data like customer/employee.

also create new junction entity for mapping between info table, static and main tables.

i hope that will help u.


otherwise create audit table for maintain history of the records

Solution