mysql - Online Gadget Retail Management System -
i designing online gadget retail system. have different gadgets categorized mobiles, laptops, accessories etc. have 2 questions:
1) have single table named "products" or have multiple tables such mobiles, laptops, accessories etc ?
2) how choose product id?
thank in advance.
it's not seperate products in several tables - you'll have union 3 tables select products, not convenient.
you should have 2 tables - products , categories. in products you'll store information on products foreign key - category_id. in categories you'll store, well, categories of products - laptop, mobile etc.
now can work 1 table instead of 3 , distinct product categories.
"how choose product id" - simplest solution create integer product_id autoincrement in products table.
Comments
Post a Comment