I am in the process of building out a website and though for years I have organized data a certain way I wanted to see if there was a more efficient way of doing it.
For this project I have (book) genres, sub genres and sub-sub genres. I was, and usually with three tiered categories do, going to build one genre table with the fields
id(int primary AI), genre(Varchar 255), subgenre(int default 0),subsubgenre(int default 0)
With this if subgenre and subsubgenre were 0 then its a genre ( top tier, parent whatever you want to call it ) if subgenre has a number in it then it is the number of the parent genre and this would be a sub genre of that parent, if subgenre and subsubgenre have numbers then its a sub genre of that sub genre and a subsub genre of that genre, confused yet?
So Im wondering if I should just make a genre table, (id, genre) and a reference table to organize it. This way if they ever want to make a subgenre appear as also a genre the option is there ( right now they say no but I have been doing this too long to think that theres no way they will change their mind ).