I am creating a database to track training for my company. We use outside facilitators to teach these classes. There are some instances where a facilitator (partner) works for more than one company (vendor). The second vendor is usually the partner working as a sole proprietor. My table structure for this relationship is pretty sound:
tblCompany
CompanyID (PK)
CompanyName
...more data
tblPartner
PartnerID (PK)
PFName
PLName
...more data
tblPartnerCompany
PartnerCompanyID (PK)
PartnerID (FK)
CompanyID (FK)
There is also a contract table, detailing pay rates, etc. As these rates are associated with the Vendor and not the Partner, a Partner who works for two Vendors will have different pay rates.
tblContracts
ContractID (PK)
...contract data
CompanyID (FK)
My question revolves around the Class table (tblClass). Because a Partner may work for more than one Vendor, there is a need to capture the CompanyID as well as the PartnerID when it comes to who taught the class. So, should tblClass be structured as such:
tblClass
ClassID (PK)
CourseID (FK) <---Course data
StartDate
EndDate
...more class data
CompanyID (FK)
PartnerID (FK)
And, if so, do I connect CompanyID from tblCompany or tblPartnerCompany? Same goes for PartnerID.
Thanks.
tblCompany
CompanyID (PK)
CompanyName
...more data
tblPartner
PartnerID (PK)
PFName
PLName
...more data
tblPartnerCompany
PartnerCompanyID (PK)
PartnerID (FK)
CompanyID (FK)
There is also a contract table, detailing pay rates, etc. As these rates are associated with the Vendor and not the Partner, a Partner who works for two Vendors will have different pay rates.
tblContracts
ContractID (PK)
...contract data
CompanyID (FK)
My question revolves around the Class table (tblClass). Because a Partner may work for more than one Vendor, there is a need to capture the CompanyID as well as the PartnerID when it comes to who taught the class. So, should tblClass be structured as such:
tblClass
ClassID (PK)
CourseID (FK) <---Course data
StartDate
EndDate
...more class data
CompanyID (FK)
PartnerID (FK)
And, if so, do I connect CompanyID from tblCompany or tblPartnerCompany? Same goes for PartnerID.
Thanks.