A user can have many categories. Categories have one parent category. For example user X can have a parent category Science and a subcategory Biology. How would I check if the subcategory Biology exists in the parent category Science, while at the same time ensuring that both categories belong to user X? Because another user Y might also have Science and Biology in parent-subcategory relationship, and I wish to avoid false positives.
Been tinkering with this for a while, with no luck.