计划联接多个表 [英] schedule join multiple tables

查看:82
本文介绍了计划联接多个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我需要一种可伸缩的高效方式来选择所有计划的项目,因此将主表作为计划是有意义的.问题是所有操作表的属性都不同

Basically I need an scalable efficient way to select all scheduled items so it made sense that the main table is the schedule. The problem is that all the operation tables have different properties

我创建了一个图表,这显然是错误的,但是演示了我要实现的目标.

I created a diagram which is obviously wrong but demonstrates what I am trying to achieve.

我当时正在考虑在另一侧进行联接,以便所有三个操作都指向计划表,但是如果我这样做了,那么要获得完整的计划表,我必须汇总所有操作表.如果将来我有更多负载怎么办?

I was thinking about having the join on the other side so that all three operations pointed to the schedule, but if I do that then to get a complete schedule I have to aggregate all the operation tables. What if I have loads more in the future?

另一种选择是在计划表中具有交付",维护",装载"列,但同样可以装载更多的操作.我只是想知道我是否缺少某些东西,或者这是最好的选择吗?

Another option was to have the delivery, maintenance, loading columns in the schedule table but again there could be loads more operations. I'm just wondering if I am missing something or is this the best option?

推荐答案

您的问题是对象建模人员将其称为超类/子类的模式的情况,在(扩展的)实体关系建模中称为泛化/专业化.

Your question is a case of a pattern called superclass/subclass by object modelers, and called generalization/specialization in (extended) Entity Relationship Modeling.

有人不时问类似的问题.

Similar questions have been asked about different cases from time to time. A longer answer is available here

这篇关于计划联接多个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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