B
B
bismoney2015-10-23 01:42:56
MySQL
bismoney, 2015-10-23 01:42:56

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

2 answer(s)
V
Vyacheslav Barsukov, 2015-10-23
@bismoney

If you choose from 2 options, then option 2.
+ in the simplicity of future requests

A
Alexander Taratin, 2015-10-23
@Taraflex

Do for all 12 columns (unnecessary left empty) + column per record type.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question