Hello all,
I am having a difficult time deciding how to handle a business requirement in my database schema. I have a lot of tables in the database, but there are only three I need to deal with for this problem: Courses, PersonnelCourses, and Personnel.
- Courses is a list of Courses
- Personel is a list of Personnel
- PersonnelCourses is a list of Courses that Personnel have taken.
In courses there is a column called Universal. If a course is universal, that means all Personnel must take that course.
I need to generate a list of all the universal courses that Personnel must take, but the only way I am able to generate this list is with a cross join / cartesian join:
select P.LastName, C.Name from Courses C, Personnel P where Universal = 1
From that I want to do a left join onto PersonnelCourses so that I can have a list of all the Personnel and the Courses they must take as well as the courses they have taken. I'm thinking this would all be easier if there was a many to many table between Personnel and Courses. But if all Personnel are going to be in this middle table anyway, isn't that a bit redundant?
Is there a better way to handle this?
Much appreciated,
-Matt