Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Inheritance ER模型:子实体可以相互关联的模型_Inheritance_Entity Relationship Model - Fatal编程技术网

Inheritance ER模型:子实体可以相互关联的模型

Inheritance ER模型:子实体可以相互关联的模型,inheritance,entity-relationship-model,Inheritance,Entity Relationship Model,我对ER模型中的继承有一个问题: 给出了一个简化的继承示例: 我如何证明学生可以是工人,反之亦然 在DB设计中,没有继承概念。我们通过外键实现IS-A(继承)和HAS-A(组合) 汽车有发动机 cars表使用外键参考发动机表 学生是一个人 students表使用foregin键引用person表 现在,你想要实现的是一个学生应该成为一名工人 很简单。基本上,学生就是一个人。所以那个特定的人也可以 做一名工人 一个人既可以是学生也可以是工人,这符合您的要求 If both Student a

我对ER模型中的继承有一个问题:

给出了一个简化的继承示例:


我如何证明学生可以是工人,反之亦然

在DB设计中,没有继承概念。我们通过外键实现IS-A(继承)和HAS-A(组合)

汽车有发动机 cars表使用外键参考发动机表

学生是一个人 students表使用foregin键引用person表

现在,你想要实现的是一个学生应该成为一名工人

很简单。基本上,学生就是一个人。所以那个特定的人也可以 做一名工人

一个人既可以是学生也可以是工人,这符合您的要求

If both Student and Worker are referring a same foreign key person_id i.e
That implies the person is both a Student and Worker.