K
K
Konstantin Khairov2018-11-09 03:15:13
MySQL
Konstantin Khairov, 2018-11-09 03:15:13

How to organize mysql database statistics structure?

Hello . I just can not think of a better way to make the structure for storing advertising statistics.
There is a site where advertising is laid out. Website advertisers have their own interface where statistics of views and clicks by dates are available.
That is, you need to store the following data
id_advertiser
id_ad block
date
number of views
number of transitions
I can’t figure out how to put it all down yet. Either all dates on the same day (make an index) and store them in lists, and from there already parse how and what you need, for example

date(index) | id_ads_block | views_ads_block | click_ads_block
09-11-18           2||3||6||13             326||59||94||26         36||26||9||2
               (Список активных)  (Одинаковая последовательность)

from this data, already parse the necessary information and plus update it with a new view and click, but I’m sure it’s not the best structure, how can I optimally solve such a question (WITHOUT third-party services)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Neverov, 2018-11-09
@TTATPuOT

Well, in general, I would simply log every action to the database.
My suggestion:
Or a slightly different variation
Next, just make a selection with COUNT(*).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question