I am not sure if this is possible in mySQL. Here are my tables:-
Categories table:
One way is to maintain a table that contains the ancestor to descendant relationships. You can query this particular table and get the list of all dependents.