If you have two tables (course and teacher)
- table course contains: C#, course_name, teacher, supervisor
- table teacher contains:T#, teacher_name, department
Teacher and supervisor are foreign keys meaning they contain T#.
Now i want to make a trigger that checks if teacher and supervisor are both from the same department (mathematics, programming etc.), if not then an error should show. It should be an "insert" of a new course trigger.