How to efficiently create dynamic hierarchies in a data schema model?

To clarify, let's say I have users and user preferences in my database, and I also have information, such as city, state, county and region, associated with these two tables. In this case, I can effectively collapse my user settings to the level of the city, state, county and region using the night or incremental process.

An alternative scenario in which I do not have fixed groups, such as city, state, county, but I want some superusers to have the flexibility to create their own groups and manually bind users in the following form:

User1|
User2| - group1
User3|
                 -> group3
User4|
User5| - group2
User6|

In addition, I can still have my city, state, district groups:

User1|
User4| - city1
User3|
                 -> county1
User4|
User5| - city2

, ? - ?

, . , .

:

, 2 .

, ( ), , . , , ( ). , , avgs .

0
3

( ). ....

+3

, , .

0

. , , - ..

0

All Articles