Hi
I’ve been searching for awhile but not sure which way is the best to set up relations between tables who has two primary keys.
I’ve designed the app so it allows multiple companies within the same database. Each company has its own set of data. I.e each company its set of country and zip codes.
4045
I have the following tables (also see the image)
SysCompany - Holds all companies
AddressCountry - Holds all the countries for that company. PK => CountryId & CompanyId
AddressZipCode - Holds all the zip codes for that company. PK => ZipCodeId & CompanyId, FK => CountryId
Any suggestions to the best way to build the relations?
Its important that the users are only able to read the data within their own company.
Hope someone can point me in the right direction