I have created a table called "users" which is having
so now scenario is each user can have n-number of categories which mean userID=1 may have category1, category2, category3 so on and again each categories may have n-number of sub categories. So how can I design my tables? Any suggestions ?
Simple, the proposed DB Design could be like the following
1. tbl_users(uid, uname, password, Name, ...)
2. tbl_categories(cid, cname, parent_category_id ...) -- self join
3. tbl_user_categories (uid, cid) -- Mapping table
Some Notes:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.