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 268545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:42:41+00:00 2026-05-11T23:42:41+00:00

I am pretty new to database design. I am building a small asp.net mvc

  • 0

I am pretty new to database design.
I am building a small asp.net mvc web application in which there are are various type of users who can login to the website.

So the table structure is,

Users table
userid(PK), username , password , email , role, etc

Employees table:
Eid(PK), userid(FK), firstname, joining date, etc

Clients table:
Cid(PK), userid(FK), firstname, company name, etc

There is one to one relation between the users – employees table
and users – clients table.

The general users , only have the details present in Users table.

Is this a right design?

  • 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-11T23:42:41+00:00Added an answer on May 11, 2026 at 11:42 pm

    If users can be only one type…

    Users -> UserTypes

    Users table would have a type_id, which would be the PK of a field in the UserTypes table.

    Users

    • userid 1
    • name Jonathan Sampson
    • email foo@bar.com
    • typeid 1

    UserTypes

    • id 1
    • type Unregistered

      SELECT users.name, users.email, users.typeid, usertypes.type
      FROM users LEFT JOIN usertypes ON (usertypes.id = users.typeid)
      WHERE (users.id = 1)
      

    Returns: Jonathan Sampson, foo@bar.com, 1, Unregistered

    If Users can be multiple types…

    Users -> UsersToTypes -> UserTypes

    If a user needs to have the capacity to be more than one type, you’ll introduce a third type:

    UsersToTypes

    • userid
    • typeid

    So if a user is both type1 (Customer), and type2 (President) you would have two records in UsersToTypes:

    • userid (1 id for Jonathan Sampson)
    • typeid (2 id for President)
    • userid (1)
    • typeid (1 id for Customer)

    Extra Comments…

    I wouldn’t place the company-name in the users/clients table. You’ll end up with that name existing numerous times if you have many of their reps in your database. Instead, create a Companies table that stores the following:

    • CompanyID
    • CompanyName
    • ContactNumber
    • StreetAddress
    • City
    • State
    • Zipcode

    This way, if a company ever goes through changes, you don’t need to edit the clients table to update its name. You update its details in the proper table, and they are then globally updated.

    Of course if you have multiple reps for each company, you’ll need to create a RepsToCompanies table, similar to our UsersToTypes.

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

Sidebar

Related Questions

I'm working on a large scale performance critical asp web application with a pretty
I'm a pretty new C# and .NET developer. I recently created an MMC snapin
I am pretty new to VB.NET - and I'm struggling to convert the signature
I'm pretty new to JSF and the many many related technologies out there. I'm
I am pretty new to the Unity Application Block and am a little stuck
I have a legacy database with a pretty evil design that I need to
I'm pretty new to java, and using netbeans for design a UI. What I
I'm pretty new to my company (2 weeks) and we're starting a new platform
I'm pretty new to the idea of recursion and this is actually my first
I am pretty new to php, but I am learning! I have a simple

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.