0
Hello I’m doing a college project, it’s an internship site project, it has to be developed in Java WEB with database. It has three types of user, the student, the company and the administrator. I wonder if there is any way at the time of logging in I do not have to search the three tables.
I was thinking of making a user table, in which you have the email, the password, his type (1-Adm, 2-student...) and finally a field of the user id in your table. Then I would do the query in the user table, and from the type of it, I would discover the table in which it meets and with the id found it.
So I’m doing two searches. there’s another way to do it with just one?
Thank you!
This may be an acceptable alternative if there are no different specific fields for each user type, or if the number of specific fields is small enough; for more complex situations, the use of multiple tables may become a better alternative. As always, it depends heavily on the situation.
– Haroldo_OK