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

  • Home
  • SEARCH
  • 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 196911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:48:28+00:00 2026-05-11T16:48:28+00:00

My data, IF it would be represented by objects, it would look like: abstract

  • 0

My data, IF it would be represented by objects, it would look like:

abstract class A{
   int a;
   int b;
   string c;
}

class B inherits A{
  string D;
}

class C inherits A{
  int e;
  int f;
}

My question: Do I create a separate table for entities B and C,
Or do I create one main table, and for each entity type I do different joins to fetch the data.
In the real world, I will have around 15 similar fields for all entities, and about 1-3 unique field for each entity.
I expect a max of 100K records.

Any insights?

  • 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-11T16:48:28+00:00Added an answer on May 11, 2026 at 4:48 pm

    You’ll find no shortage of opinions on this topic. Many people advocate concrete table inheritance, where (as you describe in your first option) you define the data explicitly in each table.

    Given your second statement, I would not recommend this pattern. I would go with the idea of having a “main” table representing your parent and auxiliary tables representing the children. You may want to include a type identifier of some kind in your main table in order to indicate what sort of entity it is, but this may or may not be necessary. At a minimum, you need something like…

    tableA
    (
        ID (primary),
        A,
        B,
        C
    )
    
    tableB
    (
        ID (primary and foreign->table_A),
        D
    )
    
    tableC
    (
        ID (primary and foreign->table_A),
        E,
        F
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 178k
  • Answers 178k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Using the ToList() extension method is your best option: someValues.ToList().ForEach(x… May 12, 2026 at 3:36 pm
  • Editorial Team
    Editorial Team added an answer The workaround you found is for a UNIX system; the… May 12, 2026 at 3:36 pm
  • Editorial Team
    Editorial Team added an answer If someone will have the same problem: Replace @Persistent(mappedBy =… May 12, 2026 at 3:36 pm

Related Questions

I'm currently learning functional programming in my spare time with Scala, and I have
EDIT Thanks for the prompt responses. Please see what the real question is. I
You can pass a function pointer, function object (or boost lambda) to std::sort to
I've been lately trying to learn more and generally test Java's serialization for both

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.