title: Tutors, Students, Courses database design
body: <p>I have 3 entities: Tutors, Students, Courses</p>
  
  <p>Tutors teach many courses</p>
  
  <p>Students can be assigned to many courses that are taught by many tutors</p>
  
  <p>Tutors and students need to be able to log into the system</p>
  
  <p>I would like to represent this design using the following tables:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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.</p>
  
  <p>I would really like to be able to use a single users table to keep all the users to make things simple.</p>
  
  <p>Any advice please? </p>