I've the following category structure:
- Transport (10)
- Cars (5)
- Audi (2)
- BMW (3)
- ...
- Spare Parts (5)
- Audi (5)
- Audi glass (1)
- Carburetors (4)
- Mirrors
- ...
- Buses
- Spare Parts (5)
- Audi (5)
- Audi glass (1)
- Carburetors (4)
- Mirrors
- ...
- BMW
- Audi glass
- Carburetors
- Mirrors
- ...
- ...
What is the best way to store such data structure? I've tried tree, but it's a big duplication and counters doesn't work properly.
What I need is a way to store such structure in DB. To place item under each category. And have working items counters.