Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 977073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:50:43+00:00 2026-05-16T03:50:43+00:00

I have a table of Users, Each USR_ID can have multiple Roles,Views,Brands and Units.

  • 0

I have a table of Users,

Each USR_ID can have multiple Roles,Views,Brands and Units.

So the optimal design I thought of is this:

Users
USR_ID    USR_Username    USR_Password

Matrix
M_ID    M_USR_ID    M_ROLE_ID    M_VIEW_ID    M_BRAND_ID    M_UNIT_ID

_ROLES
ROLE_ID    ROLE_Name    ROLE_Active

_VIEWS
VIEW_ID    VIEW_Name    VIEW_Active

_BRANDS
BRAND_ID    BRAND_Name    BRAND_Active

_UNITS
UNIT_ID    UNIT_Name    UNIT_Active

So basically in the Matrix table I keep all data regarding which user does what.

My question is, is that the optimal structure and design? further to that, how do the rows in the Matrix table will look like?
This is an example of someone that is has ROLE_ID = 1

Matrix
1    30    1    4    7    2    4

Now that I want to add another ROLE to that person, what will the next row look like? Do I keep the values of all other definitions (brand,unit,view…)? Or do I just insert everything with NULL except the ROLE_ID?

Your assistance is much appreciated,

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:50:44+00:00Added an answer on May 16, 2026 at 3:50 am

    I would not use your matrix table. Instead, use cross reference tables.

    To link Users and Roles:

    User_Roles
    USR_ID    ROLE_ID
    

    Create across reference table for each table: Roles, Views, Brands, Units. This way you can have multiple units, for example, for a user without tying each to a particular role. And you can have three units and three roles and three brands without creating 27 matrix records.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called users and each user can belong to one group,
I have a table users with primary index userId . Currently, each user has
I have 200 users each user will eventually have a reviewINFO table with certain
I have about 1 million data in users table. Now I want each user
I have a table named users and each row (user) has an image. The
I have a table of users where each row contains their names, e-mail address,
I'm building a social networking website. I have a table of Users. Each user
So I have my table users and each record has a username field and
if i have this table: users ----- id_users (pk) age name gender salary it
Lets say that I have a table containing users . Each row in that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.