AccessJunkie33
Registered User.
- Local time
- Yesterday, 19:13
- Joined
- Oct 11, 2010
- Messages
- 16
Is the three way association table necessary?
Hi guys.
Attached is the basic database for reference.
Here is an interesting problem that I've run into at my internship.
Currently, I'm working on a database for a compliance audit on a bunch of construction companies. Since they're going to do city work, they must contract out 30% of construction revenue to sub-contractors, creating a relationship between the prime and subs.
Here are the tables:
Packages (lists of contracts given to 'Prime' contractors)
Contractors
Prime
Sub
Package-Contractor Association Table
Everything would've been fine and dandy if a Prime could only be a Prime and a Sub only a Sub, but that's not how it goes. : |
If a business is considered a small business, they can be a Prime or Sub-contractor at the same time. This is what's kicking my ass.
My question is, since the prime and sub ids won't make sense as a foreign key in the contractor table due to a duplication of data, how should I link them through the association table so that the database is normalized, without violating REA?
Thank you for your time.
Hi guys.
Attached is the basic database for reference.
Here is an interesting problem that I've run into at my internship.
Currently, I'm working on a database for a compliance audit on a bunch of construction companies. Since they're going to do city work, they must contract out 30% of construction revenue to sub-contractors, creating a relationship between the prime and subs.
Here are the tables:
Packages (lists of contracts given to 'Prime' contractors)
Contractors
Prime
Sub
Package-Contractor Association Table
Everything would've been fine and dandy if a Prime could only be a Prime and a Sub only a Sub, but that's not how it goes. : |
If a business is considered a small business, they can be a Prime or Sub-contractor at the same time. This is what's kicking my ass.
My question is, since the prime and sub ids won't make sense as a foreign key in the contractor table due to a duplication of data, how should I link them through the association table so that the database is normalized, without violating REA?
Thank you for your time.
Attachments
Last edited: