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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:05:39+00:00 2026-05-11T12:05:39+00:00

Say we have this scenario: Artist ==< Album ==< Track //ie, One Artist can

  • 0

Say we have this scenario:

Artist ==< Album ==< Track //ie, One Artist can have many albums, and one album can have many tracks 

In this case, all 3 entities have basically the same fields:

  • ID
  • Name
  • A foreign of the one-many relationship to the corresponding children (Artist to Album and Album to Track

A typical solution to the provided solution would be three tables, with the same fields (ArtistID, AlbumID etc…) and foreign key constraints in the one-many relationship field.

But, can we in this case, incorporate a form of inheritance to avoid the repetition of the same field ? I’m talking something of the sort:

Table: EntityType(EntityTypeID, EntityName)        This table would hold 3 entities (1. Artist, 2. Album, 3. Track)  Table: Entities(EntityID, Name, RelField, EntityTypeID)        This table will hold the name of the entity (like the name of         an artist for example), the one-many field (foreign-key        of EntityID) and EntityTypeID holding 1 for Artist, 2 for Album         and so on.  

What do you think about the above design? Does it make sense to incorporate ‘OOP concepts’ in this DB scenario?

And finally, would you prefer having the foreign-key constraints of the first scenario or the more generic (with the risk of linking an artist with a Track for example, since there is no check to see the inputter foreign-key value is really of an album) approach?

..btw, come to think of it, I think you can actually check if an inputted value of the RelField of an Artist corresponds to an Album, with triggers maybe?

  • 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. 2026-05-11T12:05:40+00:00Added an answer on May 11, 2026 at 12:05 pm

    I have recently seen this very idea of abstraction implemented consistenly, and the application and its database became a monster to maintain and troubleshoot. I will stay away from this technique. The simpler, the better, is my mantra.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer In a lot of scenarios, procedural programming is just fine.… May 11, 2026 at 2:01 pm
  • added an answer try this, i assume your Enabled/Disabled is a bit value… May 11, 2026 at 2:01 pm
  • added an answer I was wondering about the basis of the question because… May 11, 2026 at 2:00 pm

Related Questions

Say we have the following method: private MyObject foo = new MyObject(); // and
Say we have realized a value of TDD too late. Project is already matured,
Say we have: class Base { virtual void f() {g();}; virtual void g(){//Do some
Say we have a TestClass with the 2 methods, -getSomeString and -getAnotherString , and
Lets say we have something like: <div class=row> <div class=box> <a class=more href=#more/> </div>
I ran into this problem at my old job, and now again at my
I'm using RSA to encrypt communication between a server and a client. Lets say
Surprisingly I was only able to find one previous question on SO about this
I want to ask a question about how you would approach a simple object-oriented

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.