In my database, I have a Categories table. Categories can have parent categories, making it a recursive relationship
I also have a products table. Each product falls
you better use nested sets models. you should use this data structure due to get fastest way to query in mysql with a simple way. with just a parent_id attribute,you don't know how deep your tree is and this make problem in knowing how many join you need. I offer you this excellent article. managing-hierarchical-data-in-mysql
for those who use laravel framework, I prefer to suggest this amazing package:Baum