Database design help!

Associate
Joined
6 Jan 2006
Posts
1,024
Location
Midlands
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?
 
that would work, but there are different fields related to different groups. I might able to combine main and sub user groups into one table.
 
Back
Top Bottom