I've already read these posts:
Storing whether a user is a student or teacher? Is a lookup table necessary?
Creating a database for a scenario involving students, teachers and courses
In a school database, do I need to have repeating data when a student can also be a teacher?
All of them were close, but none are exactly what I want. A few points:
- This app will be used by Grade School teachers.
- A student will never be a teacher, and a teacher will never be a student.
- In addition to Students and Teachers, there will also be contact info for Admins who are neither students nor teachers.
- Teachers will always be Users. Admins may or may not be users. (We may store an Admin's name and contact info, but that admin may never have a reason or need to log into the app.)
My thought is to create a "Person" table:
- PersonId
- FirstName
- LastName
- Email (NULL if student)
- PersonType (Enum: 1 = Admin/Teacher, 2 = Student)
- Other Columns as needed
And another table "Passwords":
- PasswordId
- PersonId
- PasswordHash
- Other Columns as needed
If a Person is also a user, they will have a value for 'Email' and also a record in the Password table.
Am I on the right track?