This is my db model in terms of users
It turns out that I need the user to be able to log in with the same credentials, the intention is to create a procedure where the server returns its user data, and the teacher and administrative data if it is, the dilemma is that a user can be a teacher in several institutions, or administrative in several, or be a teacher and administrative in different institutions. What would be your solution? What language would the procedure be in? It doesn't matter what type of data it returns, as long as it can be used on the server.
You should use two query