M
M
Maxim2019-04-27 01:30:07
MySQL
Maxim, 2019-04-27 01:30:07

MYSQL - Where to place additional fields?

Hello!
How can I not deal with the questions tormenting me. Never thought about such things before. Perhaps the question will seem trivial to you. However, please help!
The essence is the following... There are not so many tables in the project, which indicate the basic information. For example, the user table and the fields in it: last name, name, phone.... These are the main fields of the Table. In addition to them, there are auxiliary fields, most often counters: number of views, number of ratings, last visit (unixtime)
Now fields of the type: views_count, rating_count are located directly in the table that needs them. In this case user. And I had doubts about the correctness of their placement. It is quite possible that they need to be allocated to a separate table: user_counter. Especially if there will be much more user counters, which is quite possible.
Tell me, how much is it right? To what extent is it expedient? And in general, according to what principle should fields be separated into separate tables or into separate auxiliary tables?
I would like to fully clarify these issues and understand them. On the Internet, I did not find anything sensible. If I missed something, I will link again!
Thanks to!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Sokolov, 2019-04-27
@myks92

Bring the table in 3NF and then it will become clear what is superfluous and what is not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question