This is my current database design, for the moment just look the student, teacher and classes tables.
I'm trying to convert some tables into news using TPH Inheritance. For example.
Create a new table called Person where contains:
- Id,
- FullName,
- EnrollmentDate (for student),
- Email (for student),
- HireDate (for teacher)
But is there remaining one field called ClassId
, where it's contained in Student
table. At this momment I don't know if should I create a join table to store the ClassId
and PersonId
, or just put the ClassId
into the Person
table. That's my big doubt.
Where do I have to put the ClassId
field?
I have to mention that each student can only be in one class, not many. Teachers can have many classes as they want.