Hi to all,
I have a scenario like this:
School
(SchoolName, etc, etc...)
Teacher
(SchoolName,TeacherName, etc, etc...)
ForeignKey: [School.SchoolName]
Student
(SchoolName,StudentName, etc, etc...)
ForeignKey: [School.SchoolName]
Lesson
(SchoolName, TeacherName, StudentName, etc, etc...)
ForeignKey: [Teacher.SchoolName,Teacher.TeacherName] + [Student.SchoolName,Student.StudentName]
I would like to change the name of the school by updating the School table which updates all other tables using foreign key 'On UPDATE CASCADE', however, a foreign key constraints was violated at Lesson table. I'm currently using MySQL. I have heard that some database have "defered" checks for constraints which might solve this problem.
Or can this problem be solved by changing the foreign key structure?
Thanks for the advice.