I have 3 entities: Tutors, Students, Courses
Tutors teach many courses
Students can be assigned to many courses that are taught by many tutors
Tutors and students need to be able to log into the system
I would like to represent this design using the following tables:
users
- id
- username
- password
- first_name
- last_name
- email
- password
- phone
- role_id (Student or Tutor or Admin)
- created
- modified
roles (Student, Tutor)
- id
- name
- created
- modified
courses (The courses that Tutors can teach and that Students can be assigned to)
- id
- name
- created
- modified
users_courses
- id
- user_id
- course_id
- created
- modified
The problem I have with the above design (users_courses table) is that, let's say we have Tutor A and Tutor B that teach Math. If student X is registered to that math course we can't know if student X is being tutored by Tutor A or Tutor B.
I would really like to be able to use a single users table to keep all the users to make things simple.
Any advice please?