My tables look like this:
What is the best schema ?
Users_Addresses (UserAddressId, UserId, AddressId)
Companies_Addresses (CompanyAddressId, CompanyId, AddressId)
I can link UserAddressId or CompanyAddressId to another table.
Group_Addresses (GroupId, UserId, CompanyId, AddressId) with CHECK constraint
CHECK(UserId IS NOT NULL AND CompanyId IS NULL OR UserId IS NULL AND CompanyId IS NOT NULL)
I can link GroupId to another table.
Or any other schema ?
In any case, I need to link the user address or the company address to another table.
Thanks in advance for your help.