I think it s best to ask based on an example: There are people, customers and projects.
People to customers is a n:m relationship. People can work for multiple customers.
Projects to customers is a 1:n relationship. One project always belongs to a certain customers, but a customer of course can have multiple active projects.
People to customers is a n:m relationship, but restricted by project to customer and people to customer assignments.
More details: Some of our people work for multiple customers, but only for a few projects of those customers.
Say customer A has projects 1,2,3 and customer B has projects 4,5,6.
Now Fred works for customer A on project 1 and for customer B on projects 5 and 6. Tim, instead, works for customer A on project 2,3 and for customer B on project 6. Our special guy Nick works only for customer B, but is currently NOT assigned to any project. The customer can assign him to a project later on.
Now, how can I ensure, using a good relational database design, that I can assign people to customers (like Nick) without a project, AND, later on, can assign them to projects of any customer - restricted to those that they are assigned to.
So do I need to design my tables so that the database model ensures that it is not possible to assign Nick to project 1,2 or 3 without first assigning him to customer A?
Thanks for any ideas :)