Just beginning to learn about SQL and had a question I couldn't figure out.I have a setup based on the following tables and their primary keys, the columns with the same name between tables are constrained by foreign keys:\[quote\] Company:
- CompanyId
- CompanyId
- DivisionId
- CompanyId
- ResourceId
- CompanyId
- DivisionId
- ResourceId
- DivisionResource is used to create a many to many relation between division and resource and constrain them so that divisions can only be linked to resources of the same company.
- Without the DivisionResource, Division and Resource wouldn't need the CompanyId as a primary key to contain unique records.