Say that I have the following one-to-many relationship:
If I don't want to store any information about the relationship, I can simply put the primary key of School
as foreign key in the Student
table.
But let's say that I want to store the date on which a student has registered in a school. In this case, can I still put the primary key of School
as foreign key in the Student
table alongside the date_of_registration
attribute? or should I create a new table that contains school_id
and student_id
as foreign keys alongside the date_of_registration
attribute?
If I can use both either approach, what are the advantages and disadvantages of each approach?
student has registered in a school
You already answered your self.Register
seems a legit entity for me. Anyways, it depends whether you need to keep certain traceability between students and schools. Or students-schools-somethingElse