I am developing a school management system with multiple user types/levels; teachers, students, parents etc.
They all have common data such as name, email, telephone, gender etc. Each user type has its own table (tbl_students
, tbl_teachers
etc) for other data that is not common.
Should I include these fields in the tbl_users
table which will be used to handle the login and subsequent redirection to a relevant part of the site (based on user type), OR have a very minimal tbl_users
table with only user id and password?
If the tbl_users
is minimal, would it be ok when it comes to performance to have two MySQL statements to insert data into two tables on new user registration?
This is my main doubt/question:
Would it be a drain on MySQL performance to constantly have to do joins when displaying simple things like user profiles, contact details etc if the common data is stored in the tbl_users
field itself? Or would it be worse in performance if all the basic data is in the other tables such as tbl_teachers
would have firstnames
, telephone
etc?