Hi i have been working on a online shopping project for gifts .
My Navigation menu has 3 Levels like this :
Parent Menu ==> Child Menu ==> Child Sub Menu .
Reference Image Attached.
i have to get all these values from the database table in a hierarchy, i was thinking to design the database table in such a way that request time for fetching menu data from table is minimal.
my idea is to design a table name navigation_menu with following parameters : id(as menu id),Menu_Name,Parent_id
id(Parent Menu id) | Menu_Name | Parent_id |
0 | BIRTHDAY | - |
1 | OCASSIONS | - |
2 | GIFTS | - |
3 | SPECIAL | - |
4 | CAKES | 0 |
5 | OFFERS | 1 |
6 | GIFTS | 0 |
7 | SPECIAL CAKE | 4 |
8 | PHOTO CAKE | 4 |
Or can i design the database in a better way to fetch the data more faster (Suggestions required).