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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:23:51+00:00 2026-06-11T21:23:51+00:00

Sorry if this sounds noob, this is something related to database design for inherited

  • 0

Sorry if this sounds noob, this is something related to database design for inherited classes.

I have currently 2 type of user for registration on my system, member and staff. They both share some same property (i.e. name, dob, contact no) while possessing some unique property for their own usage (i.e. membership no for member, staff position for staff). Currently they both are stored as 2 different tables in the database and have no relation with each others.

I’m thinking now to create a entity called Person with all the common property while having a class call Member and another Staff that both extends the Person class in the system. However i’m having problem designing the database. Should there be a table called Person with a type property to denote the type of the person, or i should stick with the existing design where 2 tables that separate them?

  • 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-06-11T21:23:53+00:00Added an answer on June 11, 2026 at 9:23 pm

    It depends.

    If you’re not going to do polymorphic queries, I’d stick to the design you have right now.

    This sort of design is called in literature “table per concrete class”

    On the other hand if most of your queries are going to be like “give me all the people in the system regardless of whether they’re a member or staff” you might want to put them all together into a single table called Person.

    This sort of design is called “table per class hierarchy”

    Obviously this mandates that all columns corresponding to properties of your inherited classes would have to be nullable in the database.

    If that is not acceptable (I’m finding it hard to believe it would, but…) and for completeness you may end up with a three-class, three-table structure, which is unsurprisingly called “table per class”

    There’s no hard and fast rule for this, and while I generally tend to work with systems where table per class hierarchy makes the most sense, it may or may not be the case for you.

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

Sidebar

Related Questions

I'm working rearchitecting a reporting/data warehouse type database. We currently have a table that
Sorry if this sounds silly, I am still learning server-side Javascript. I have this
Sorry if this sounds childish. I have been trying to manipulate a canvas element
Sorry if this sounds like a noob question. I downloaded this asp.net project from
Sorry if this question sounds a little silly, but I am not sure what
Sorry if the title sounds confusing - but this is what I am trying
Sorry if this sounds like a really silly question. But I Googled the web
I am sorry if this is a dumb question (cause it sounds unlikely). I
Sorry if this sounds like a newbie question, but the other day a Java
I'm sorry, but I'm sure this sounds like a stupid question but could someone

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.