M
M
Mois2016-11-06 01:30:51
MySQL
Mois, 2016-11-06 01:30:51

Design a database, one that would leave the opportunity to make selections according to the characteristics of the object?

I am doing something like a catalog with various goods (but not goods, but simply objects with a description).
So these objects have something like characteristics, according to which I want to leave myself the ability to sort / select / select in the future .. There are a
lot of characteristics , and at first I just thought to put all the characteristics for each object in a separate cell "line", but this makes it impossible for me to select them later, because you will have to take the entire table and deal with the strings already in the body of the program. Now I'm thinking about how to create a separate column for each characteristic (a lot of columns), and write true / false values ​​\u200b\u200bto it, and directly in this way, when requesting a specific object, display the available characteristics ..
Is there any better way?
Because I don't really like the second one. long to create and not sure of the effectiveness.
And the first one, although it will be easy to implement, and the speed is acceptable, but no matter how it turns out to be a bearish job!
Thanks for the help and advice!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2016-11-06
@Mois

You need to create
1) a table of objects
2) a table of characteristics
3) an object-characteristic table (object_id , characteristic_id)
so in the future you can add new characteristics and make selections of objects with the desired characteristics

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question