I'm fairly new to database design. Starting a new application that has four tables:
Staff
Vendors
Projects
ProjectSchedules
ProjectSchedules
is a table where we will assign people to projects. Sometimes the people are staff, sometimes they are vendors. How can I have relationships for both staff and vendors in the ProjectSchedules table using one (or less?) columns?
It's important to note that vendors are usually a company (think staffing company).
I have done a similar thing in the past, but manually handled the non keyed relationships:
SELECT ISNULL(Vendor.Name, Staff.FullName) AS Staff
FROM ProjectStaffing INNER JOIN Vendors, Staff, etc.
Could you tell me if there is a better way?