Answer the question
In order to leave comments, you need to log in
How to make a database with the technical characteristics of different products?
there are three tables:
Answer the question
In order to leave comments, you need to log in
Easy way - visual editor and one field DESCRIPTION - very bad solution
Another - Create another table with all possible fields for characteristics and fill in one or another field depending on the product category, and NULL default is a convenient way to filter the product.
Another way - several tables for each product category - in my opinion, also a bad solution
If you need to be able to set a different set of characteristics for different product categories and these categories are added dynamically (for example, in the admin panel), then you can look at EAV . However, in this case, it is likely that using NoSQL would make more sense.
- Non-relational DBMS would allow you to do this, but in return you will have to pay by the inability to use foreign keys, integrity control and other features of relational DBMS.
- Postrelational DBMS (OrientDB, say) can do this and have integrity control, but they still need to be dealt with. The community is not that big.
- In my opinion, the best solution at the moment is to use PostgreSQL, keep all types of products in one table, and for specialized attributes specific to categories, create one data column of the HStore type, which stores an array of the key-value type.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question