How to create this mysql database

there are 2 million users, each user has 4 tables. data in 4 tables will not be added and will remain corrected.

the structure of each user table will be the same.

To store the data of these users in mysql, I need to create a database.

Do I need to create 2 million databases with 4 tables?

any help appreciated

4 tables are

  • record incoming calls of the user for 1 month
  • inclusion of user sms records for 1 month
  • record outgoing calls of the user for 1 month
  • outgoing sms-records of the user within 1 month

call tables will have the following structure

timeout timeout

incoming sms will have the following structure

date of time

outgoing sms will have the following structure

+3
6

antipattern SQL, Metadata Tribbles. , - .

, " ..." " ...", , , Tribbles.

user_id .

, , . , , , , .

+9

( ) , . , , . .

+4

, 2 4 . 1 , 4 .

- :

users table:
| user_id (primary key) | username |

address table
| user_id (foreign key) | address  |

whatever table
| user_id (foreign key) | whatever |

, 4 ? , , .

+3

- - . , .

telecom_model_01

+1

, table1, table2, table3, table4. , 1, users_id 1

TABLE 1                              USERS

ID   usersID     amount   quantity   ID   Name
1       1           200      2        1   John
2       1           400      3      

, INNER JOIN 1.usersID = users.ID usersID ( , )

,

0

, 2 !

2 4 .

Of course, you must create a relational database so that each table has a relational attribute for the other tables.

0
source

Source: https://habr.com/ru/post/1723186/