I have a products table that contains a FK for a category, the Categories table is created in a way that each category can have a parent category, example:
Compu
I have done similar things in the past, first querying for the category ids, then querying for the products "IN" those categories. Getting the categories is the hard bit, and you have a few options:
Stored procedures can help if you don't want to do this app-side.