Answer the question
In order to leave comments, you need to log in
Database how to design?
Kind everyone!
Tell me how to do it better.
For example, there is a Mysql database
There are 3 types of posts
1 table (post1) - 5 columns 2 table (
post2
) - 5 columns + 3 columns
3 table (post3) - 5 columns + 4 columns
5-columns (same) in all three
they will be the same, the only difference is that in some more data is added, i.e. columns.
What's the right way to do it?
1) Leave 3 tables, each type of material has its own table. And then sort by material type
2) Make one post table connect all columns and add a checkbox to the post with a choice of 3, and then sort by the checkbox?
Which is better in terms of performance? And in general from the point of view of "Correctness".
Immediately forgive me for the maybe not correctly posed question and my inaccuracies. Thank you.
Answer the question
In order to leave comments, you need to log in
If you choose from 2 options, then option 2.
+ in the simplicity of future requests
Do for all 12 columns (unnecessary left empty) + column per record type.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question