This question already has an answer here:
I am designing a web site for online shopping and I have a question related to that. As you know that shopping website may have different product with different statistic/specification. What is the best way to design a database? Below are the thoughts which comes to my mind
- Creating different tables for different product type. Ex. Phone, Tv, Video Games, Watches, Clothes, Computer etc.
but let's say a to show mobile specification [just like this example] I need to have around 40-50 columns to store a mobile specification. And let's say tomorrow one new feature comes to mobile then I probably have to add one more column which will hold the value for that specific model and for every other mobile that column will be NULL.
2: Having major product tables ex. Electronics, clothing and accessories, health etc.. and a separate specification table for each table. Ex. Electronics table will hold the master details for tablets, mobile, land line etc. and Electronics_Spec will contains the columns with related specification.
There are many characteristic between products which does not match with others. Ex. land line phone will have a specification about wire length while as tablets won't.
There are certain products which has quite less specifications. Ex: bed, toys , footwear.
Is there any other better way to design a database to hold huge specifications related to multiple products?
My intention is to save database space to the best. I sincerely apologize for my bad English.