If you do something like a questionnaire, which will then filter (search), how best to store information?
age town rost ves cvet_volos razmer_obuvi etc. 22 1 154 45 2 36 ...
Or write somewhere the order of the columns and store everything in a row
id data 1 22-1-154-45-2-36
Columns will increase over time, that is, the items in the questionnaire will become more and more. Is there any column limit? And on request?
If you use the first option, the query will be:
ла ла ла WHERE ... AND... AND... AND... AND...
What is the limit here? And even if there is no limit, it will be very heavy requests? Or is MySQL fast and it will not be difficult for it to process a request with 100 conditions?
And in general, how best to do? What other ways are there? Right, so to speak :)
AND...AND...AND
? Are you going to select rows by the totality of all columns? Strange occupation. If one row is needed, there is a surrogate keyid
for this. And if not one - how do you imagine an analogue ofWHERE town = 1 AND cvet_volos = 2
for the format'22-1-154-45-2-36'
?LIKE '%-1-%-%-2-%'
very unfortunate idea. AndWHERE town = 1 AND ves > 120
is generally a dead number. Indices to help. - drdaeman