Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do Inheritance Modeling in Relational Databases?

My question is regarding Inheritance modeling in Relational Database Systems. I have canonical data model and in that I have some fields related to pricing of product inheriting certain attributes from product table and I want to model this inheritance in MySQL relational database and so,

"How can we do Inheritance Modeling in Relational Databases ?"

Thanks.

like image 955
Rachel Avatar asked Oct 14 '09 17:10

Rachel


People also ask

How do you show inheritance in ERD?

ER modeling (or, more precisely, EER modeling) has a way to represent inheritance in the diagram. It goes by the name "generalization/specialization". You can find a number of good articles on the web by searching on this.

What is inheritance modeling?

Inheritance in the object model is a means of defining one class in terms of another. This is common usage for most of us. For example, a conifer is a type of tree. There are certain characteristics that are true for all trees, yet there are specific characteristics for conifers.

What data model uses inheritance?

Inheritance is a common modeling technique used in modern software development. In data modeling, you can use inheritance in the logical model creation process.


1 Answers

Martin Fowler discusses this extensively in his book Patterns of Enterprise Application Architecture book. Get this book and look into:

  1. Single Table Inheritance

Blockquote

  1. Class Table Inheritance

enter image description here

  1. Concrete Table Inheritance

Blockquote

The Website should give you some idea. You might also want to read the section on inheritance mappers. Each of the different approaches have their pros and cons so choose wisely.

like image 118
RichardOD Avatar answered Sep 27 '22 21:09

RichardOD