Precaution upfront: Do not think in terms of database: This will lead you to manipulating the database sooner or later, which is a recipe for disaster. Never manipulate the database.
That being said, you can use GroupLocalService (or GroupService) to obtain a Group object that has the method you're looking for. If you have a themeDisplay object where you are, e.g. in a portlet request handler, you can obtain the current group from it as well.
Precaution upfront: Do not think in terms of database: This will lead you to manipulating the database sooner or later, which is a recipe for disaster. Never manipulate the database.
That being said, you can use
GroupLocalService(orGroupService) to obtain aGroupobject that has the method you're looking for. If you have athemeDisplayobject where you are, e.g. in a portlet request handler, you can obtain the current group from it as well.