I have three tables in my database : 1) Teacher 2) Course 3) Timetable
(我的数据库中有三个表格:1)老师2)课程3)时间表)
Teacher and Course tables are connected through many to many relationship as each teacher can teach many courses and each course can have many teachers:
(教师和课程表之间通过多对多的关系联系在一起,因为每个老师可以教很多课程,并且每个课程可以有很多老师:)
----------------- ------------------------ ----------------
Teacher CourseTeacher Course
----------------- ------------------------- ----------------
id name id course_id teacher_id id name
1 John 1 1 1 1 English
Teacher -> ManyToMany -> Course
(老师 -> ManyToMany-> 课程)
Now foreach course , a teacher can have a many days with time on which he teaches that specific course,so there would be another table named timetable which has the following structure:
(现在,对于每门课程,一位老师可以花很多时间来教授该特定课程,因此将有另一个名为时间表的表格,其结构如下:)
---------------------------------------------------
TimeTable
----------------------------------------------------
id day time teacher_id course_id
1 monday 10:00 pm 1 1
2 tuesday 10:00 pm 1 1
Now the question is how can i connect the timetable table with CourseStudent relation through one to many relationship .
(现在的问题是,如何通过一对多关系将时间表与CourseStudent关系连接起来。)
For each teacher teaching the course i need to save the timetable of teacher for that specific course . (对于每位教这门课程的老师,我需要保存该课程的时间表。)
Teacher -> ManyToMany -> Course
|
|
One to Many
|
TimeTable
ask by MSD translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…