I am creating a simple user management system database design.
Each is user belongs to a user group. There are two main user groups; admin and users.
The part im finding differcult is the users group can also split into sub user groups. So a user can belong to a admin, user, sub user group.
How do i design my tables to accommodate that?
What i got so far:
USER
pkuserid
fkadminid (nullable)
fkusergroup (nullable)
fksubusergroup (nullable)
ADMINGROUP
pkadminid
name
USERGROUP
pkusergroup
name
SUBUSERGROUP
pksubuserid
fkpkusergroup (nullable)
name
Is there a better way to store the information?
Each is user belongs to a user group. There are two main user groups; admin and users.
The part im finding differcult is the users group can also split into sub user groups. So a user can belong to a admin, user, sub user group.
How do i design my tables to accommodate that?
What i got so far:
USER
pkuserid
fkadminid (nullable)
fkusergroup (nullable)
fksubusergroup (nullable)
ADMINGROUP
pkadminid
name
USERGROUP
pkusergroup
name
SUBUSERGROUP
pksubuserid
fkpkusergroup (nullable)
name
Is there a better way to store the information?