I'm just search for advice. I have . Every Product type has its own set of characteristics. The Big problem is when someone add new Product type, aslo need create new table with product characteristics. I can see only one solution without DBA, saving all products characteristics in one table but this is not good.
Schema – DB Schema for Online Market
schema
Related Question
- Database Design – Schema for Storing Historical Data on Shared Identifiers
- Database Design – Storing Personal Data on Invoices
- Database Design – Schema for Job Offers with Common Attributes
- PostgreSQL – Best Practices for Storing Many Iterations of a Product
- PostgreSQL – Single-Entry Accounting Schema Design
Best Answer
"Entity-Attribute-Value" or EAV design pattern allows you to create new attributes for products without modifying the database structure.
Aaron Bertrand has an excellent article on the advantages and pitfalls of this design over on SQLBlog.org.
A simplified example, based on your requirements:
This will insert some sample data:
This shows how we get desired output: