Design a way for multiple and single group mapped to a Role?

by shaselai   Last Updated May 15, 2019 19:05 PM

Currently I am trying to setup a relationship between user groups and roles.

I am trying to satisfy:

  1. Multiple roles apply to single group
  2. multiple groups can have same role
  3. multiple groups with single role.

I have a Group Table with RoleID and GroupName and a Role table with RoleID and RoleName. I am able to satisfy 1 and 2 fine but I am stuck on 3. Say currently i have Group 1 mapped to Roles 1&2. Group 2 mapped to Roles 2. Now lets say i have Role 3 which is ONLY available if i have Group 1and 2 together.

Is there some SQL i can do or some way to construct the tables?

Thanks!



Related Questions


Updated April 10, 2018 12:05 PM

Updated October 26, 2018 10:05 AM

Updated October 09, 2018 13:05 PM

Updated May 09, 2017 22:05 PM

Updated July 23, 2017 20:05 PM