Design Database table for Product with Variable number of Attributes
Hi,
Hi,
Well, if you want to store every information about a product in a single table there is only one way, that your table should have common attributes for all products. However, you can add the attributes in the table through programming at run time, but the records in this type of table will occupy more space in your table and the extra space is a wastage for the table. This type of table causes many errors about data retrievals.
For example
If you store information about your product A which has 10 attributes and product B which has 15 attributes in a single table then 5 attributes for product A will be empty.
So you have to think about the common attributes for every product, if you want to store information about your product in a single table.
Besides this I want to give you one more suggestion, that you should use two or more tables for storing information. There are several techniques available to retrieve data from different tables at the same time. Like you can join records from different tables as a query.
Hope this helps you.
Â