Groups in shared database

Hi there,
I am wondering whether I can access the grouos in the shared database other than extracting all the fields of all the entris and then performing a string search. are the grouos modelled as an extra table in the db that explains the hierarchy?
Cheers, Maria