Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2013
    Posts
    2

    Unanswered: database design issue

    There are three types of users. Admin, student and supervisor.
    Admin has LoginId and password.
    student has LoginId, password, email and enrolID
    Supervisor has name, LoginId and password.
    Now the following DB Schema I have designed.

    Role (Id, Name)
    User (id, RoleId)
    Supervisor (Name,UserId)
    Student(Id,UserId, enrolId, email)
    Credential(Id,UserId, LoginId,Password)

    Is the above Schema is correct or not?? Plz help me thank you

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Correct?
    Not in my opinion.
    Avoid creating separate tables for each role. That's not scalable.

    You should be able to satisfy business requirements with three tables"
    Users
    Roles
    UserRoles

    ...or if Users can have only one role at a time, two tables:
    Users
    Roles
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Mar 2013
    Posts
    2
    roles table have only 3 items
    1. admin
    2. student
    3. supervisor

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    My question was whether a person can be both a student and an administrator, or a an admin and a supervisor, or a supervisor and a student, simultaneously.
    For instance, if an administrator decides to enroll in a class, would they have both roles?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •