category->sub category->product
category table will use category_id (an auto increase number) as primary key.
product table will use product_id (an auto increase number) as primary key.
We will assign an unique product code for each product, but do you think we need also assign an unique category code for each category too?
My past practice is assiging product code to product and category code to category.
But I saw some popular e-commerce systems, they didn't assign category code to category, and some of them even didn't assign product code to product.
Category code is only used for the merchant (categoryid doesn't make English sense.), but they may live without the category code. Add a category code to help the merchant manage their categories is not difficult. But I also don't know exactly how much it will help the merchant. Do you think category code is necessary?
Product code is necessary in real life, just some e-commerce web sites doesn't show it to the end-user (shoppers), but I still think they use the product code in the back office for the merchant. But I still think we should show end user (shoppers) product code. That is authoritative number to avoid confusion between shopper and merchant (just by product name is not authoritative enough)?