|
I've got tables:
Lessons:
id int (PK)
dayNumber int
lessonNumber int
classTeacherSubjectId int (FK)
ClassTeacherSubject:
id int (PK)
classId int (FK)
teacherSubjectId int (FK)
TeacherSubject
id int (PK)
teacherId int (FK)
subjectId int (FK)
I want to create Constraint or whatever works so for each record in [Lessons] any combination of dayNumber, lessonNumber and classId is UNIQUE as well as any combination of dayNumber, lessonNumber and teacherId, so no class or teacher has two different lessons at the same time.
How to do that?
|