Hello,
I'd advise against using direct database queries / access for most use cases, and yours - as far as I know it from the post - would be one of them. Based on your description, you have a hierarchial set of data, e.g. players by type of sport. Depending on what other data you want to have associated, this sounds like a use case for a category tree in Alfresco data model. This would allow you to use a standard category control and save you the development effort (and maintenance issues) associated with a custom database access layer / operation.
Regards
Axel