如何在关系数据库中继承建模? [英] How to do Inheritance Modeling in Relational Databases?

查看:323
本文介绍了如何在关系数据库中继承建模?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关系数据库系统中的继承建模。我有规范的数据模型,我有一些字段相关的产品定价从产品表继承某些属性,我想建立这个继承在MySQL关系数据库,因此,

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 ?"

谢谢。

推荐答案

Martin Fowler在他的企业应用程序架构模式一书中进行了广泛讨论。获取此书并查看:

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


  1. 单一表格继承

  2. 类表继承

  3. 混凝土表继承

  1. Single Table Inheritance
  2. Class Table Inheritance
  3. Concrete Table Inheritance

网站应该给你一些想法。您可能还希望阅读的章节在继承映射器。每种不同的方法都有其优点和缺点,所以选择明智。

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.

这篇关于如何在关系数据库中继承建模?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆