Sign in

Ask a multi role database design problem

Venthought edited in Fri, 25 Nov 2022

present situation

Now I'm working on a teaching assistant system, which has both teachers and students. I developed it together. When designing the database, the user, teacher and student tables are designed as follows:

In the design of other tables, I design them in this way (for example, courses), and other assignments are designed in this way:

My question:

  1. Students in the table_ id, teacher_ Is ID associated with a user table or a specific student or teacher table, that is to say, is user the main body or a specific student or teacher? I am associated with the specific student and teacher tables for convenience.
  2. Taking courses as an example, the relationship between users and courses is many to many. A user can select multiple courses, and a course can be selected by multiple users. But this is only for the role of students. The user also includes teachers. For teachers, the relationship between teachers and courses is that a teacher can evaluate multiple student courses, and a student course can be evaluated by multiple teachers (the consideration of being evaluated by multiple teachers here is that if other teachers modify the scores given by the current teacher to students, the last teacher will evaluate them Will be covered...). What I want to ask is how to deal with this kind of entity when there are multiple relationships between entities? And the teacher has a relationship with the middle table, and then produces the middle table. Is that ok? What's the impact?
0 Replies