How is it better for mysql to imitate the design of QQ group chat?

how is it better for mysql to imitate the design of QQ group chat?

the following is my younger brother"s pedantic design is similar, but also hope everyone to give a different opinion

user table

id name
1 Zhang San
2 Li Si
3 Wang Wu
4 Zhao Liu

Intergroup correlation table

id group name administrator ID
1 Happy group 1
2 sad group 1
3 sad group 3

list of group chatters

people in id group id group id
111
212
314
531
and so on.

Php
Mar.28,2021

Yes, one-to-many, many-to-many groups and the like are generally implemented in this way, three tables.


give me a design, welcome to communicate:

user_account
id,userid,...

chat_group
id,groupid,groupname,level,current,status,founder?...

chat_member
id,userid,level,status,...
The level in

member mainly needs to be used to determine the identity of the user in the group. You can only write it as an administrator, which is more similar to the role of the creator, so using level will be more general.

Menu