我在数据库关系中有点混淆。我使用laravel并且需要良好的关系实践。我有四个表教师,班级,部分和科目。所以老师在多个部分教授多个科目的多个班级。 e.g
teacher1 teaches class9 of subject English in section A and B
teacher1 teaches class9 of subject Math in section A
teacher1 teaches class9 of subject Chemistry in section A and b
teacher2 teaches class9 of subject English in section A and B
teacher2 teaches class9 of subject Math in section A
teacher2 teaches class9 of subject Chemistry in section A and b
teacher2 teaches class10 of subject English in section A and B
teacher2 teaches class10 of subject Math in section A
teacher2 teaches class10 of subject chemistry in section A and c
所以这就是我的情景我有四张没有关系的表,比如有老师记录的老师,有第10,第9等记录课的班级,有英语,数学等记录的科目,以及A,B,C等科目。 那么在这些表之间创建关系的最佳实践是什么?如何在laravel中使用雄辩的关系。
这是我的ER图。如果是,那么设计是否正确那么如何在laravel中建立雄辩的关系呢?