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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:48:26+00:00 2026-05-23T13:48:26+00:00

Foreword: Although I don’t think it’s exactly a duplicate, feel free to close if

  • 0

Foreword: Although I don’t think it’s exactly a duplicate, feel free to close if you think this is too similiar to this previous question from me.

I am re-factoring a database design where I have four superclass tables from which some others must derive. Now, I am facing the doubt as to if should include (four) “type-identifying” tables and join them to each of the superclasses, so as to identify the sub-type of each record. The problem is that, without them, the design is already pretty big (14 tables) and since one of the requirements is that is must be easily expansible, I fear ending up with a 30-or-more table design. In short… can/may this type of tables be left out of the design?

PS: The goal is to have a highly and easily extensible design. For example, one of the tables represents a message, whose sub-types can be an SMS, an MMS, an e-mail, a twit, a post on Facebook and so on. Of course, common information goes on the superclass, and the remaining information goes into the other several tables as needed.

  • 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-23T13:48:27+00:00Added an answer on May 23, 2026 at 1:48 pm

    It’s easier to understand 30 tables than 30,000 lines of code. I’ve worked with databases that have over 100 tables in them. I wouldn’t worry about 30.

    The design of tables to capture entities grouped into a superclass and several subclasses is an example of the gen-spec design pattern. Gen-spec is familiar to object oriented programmers via class inheritance. But the design of relational tables to reflect the gen-spec pattern is often omitted from introductory texts to database design.

    Fortunately, it’s well understood. A web search on “generalization specialization relational modeling” will yield lots of articles on the subject, including several previous SO discussions.

    As you stated, data common to all the specialized entities goes in the general (superclass) table, while data peculiar to a given specialized entity goes in the appropriate specialized (subclass) table.

    The trick in the design is the way the subclass tables get a primary key. The primary key for the subclass tables is not an autoincremented number. It’s a copy of the PK from the superclass table. This makes it real easy to get all the data regarding a given specialty by just doing a join. It also makes it unnecessary to include type fields, since each specialized table covers its own subclass.

    This is a little difficult to set up and to update, but it pays for itself at retrieval time.

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

Sidebar

Related Questions

Foreword tl;wr: This is a discussion. I am aware that this question is more
foreword: I have a component, lets call it IView. This component is implemented by
Foreword Before asking a question that probably will pretend to downvoting (as it seems
Just a foreword: I'm not exactly clear on how a RNG actually works. If
Edit: Updated code. Now works well enough. Foreword. I am an OpenGL newb tasked
Foreword: I am not trying to write an alternative either to Subversion or to
Foreword: I want to allow users to define high quality document templates and then
I am publishing a free book online in HTML5 format and i said it
Good morning, afternoon or night, Foreword: The code below does nothing really useful. It
Foreword: Okay I've used APIs in the past such as TwitterAPI but I always

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.