Consultes per els metodes esAdministrador(), esUsuari() i esClient() (tots retornen boolean).
Si les consultes retornen un resultat o mes, es que es d'aquest tipus (pot ser de mes d'un tipus alhora):


'PER SABER SI ES ADMIN:
SELECT * FROM comptes AS a JOIN entitats AS b ON a.id_entitat = b.id_entitat WHERE a.nom LIKE 'admin' AND a.id_entitat = [ficar_id_entitat]

'Per saber si es un usuari:
SELECT * FROM usuaris AS a JOIN persones AS b ON a.id_persona = b.id_persona JOIN entitats AS c ON b.id_entitat = c.id_entitat WHERE c.id_entitat = [ficar_id_entitat]

'PER SABER SI ES un client:
SELECT * FROM clients AS a JOIN entitats AS b ON a.id_entitat = b.id_entitat WHERE a.id_entitat = [ficar_id_entitat]



'Per saber quins locals te un llogater:
SELECT * FROM llogaters AS a JOIN contractes AS b ON a.id_llogater = b.id_llogater JOIN locals AS c ON b.id_local = c.id_local WHERE a.id_llogater = [ficar_id_llogater]