K
K
kamisarlapsha2019-07-02 15:03:35
Database design
kamisarlapsha, 2019-07-02 15:03:35

What is the best for DB?

It is necessary to store a photo for each option of the product. The table productcurrently has 40 columns. The question is, is it possible to add 7 more columns to this table or make a separate table? Does the number of columns in a table matter?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2019-07-02
@sergey-gornostaev

If the table has more than a dozen columns, this is often a signal that the author of the schema has a poor understanding of the relational model and the principles of relational databases.

I
Ivan Melnikov, 2019-07-02
@immelnikoff

First of all, it's not about the number of fields in the table, but about the levels of normalization.
It is usually sufficient for the tables to be in 3NF or BCNF. If the level of normalization of your table is lower, then it needs to be decomposed.
There are other considerations in favor of table decomposition. For example, you need to raise vertical partitioning for a table, but your DBMS (in particular MySQL) does not support this. Then you have to divide the table into two or more (the main thing is that later you don’t have to join them every time).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question