How to keep the chronology of the event?

Good evening. I have such a problem, and I don't know how to solve it:
We have 3 different tables: information on depositing of money, information about money withdrawal, information about the use of promo codes. All of them have different fields, all have the Date field but no Description field (description). I need to make the chronology of events.

So, my question is: how to make this timeline?
I had 3 options:
  1. Generate all the information from a query with subqueries/unions etc. (but is this possible and how to implement?)
  2. Unload all tables in a PHP script and process them are already there, generating the necessary information. But for large tables, you can load the database, and a request for a script like this can expensive cost.
  3. Make certain triggers to add records in the database that they would put a Description and Date in a pre-created table. And if you need to do SELECT description, date FROM history?

I hope I clearly explained my problem... And asking for help from experts.
July 2nd 19 at 18:11
2 answers
July 2nd 19 at 18:13
Solution
Max says, but if the structure does not change, can not stand such operations on the client - very will shrink in speed.
Make a view that unites all tables with the minimum data as required and sort by date.
Description is added like this:
select date, price, 'table 1' as desc from table1
UNION ALL
select date, price, 'table 2' as desc from table2
UNION ALL
select date, price, 'table 3' as desc from table3


Make it a view and sort as you like
I not really understand about the description. - Ida_Connel commented on July 2nd 19 at 18:16
I understand you have 3 tables, and with the Union it becomes unclear where the line is. This technique with anionami and adding a column allows the total sample to show to which table belonged to this line of Association that allows to handle correctly the desired data. - Jeanne_Konopelski5 commented on July 2nd 19 at 18:19
: okay, I see, didn't first read request. Thank you :) - Ida_Connel commented on July 2nd 19 at 18:22
: NSC - Jeanne_Konopelski5 commented on July 2nd 19 at 18:25
July 2nd 19 at 18:15
anyway, I would wrote it in 1 table "finasovo transactions", selecting the event type (debit-completion). Promotional codes the essence of the same Deposit, but a special type. But the promotional codes, they are "nominal", duration, deistvuet\redeemed store stands alone
to store and process everything in the database - by far. And choose only what you need.
The problem is that Deposit and withdrawal will have to be stored in different tables - there are a lot of different options. Promotional codes the same, and they may not have any relation to Finance. - Ida_Connel commented on July 2nd 19 at 18:18

Find more questions by tags DatabasesMySQLSQL