开发者

EER : Superclass/subclass Entity relationship, primary key mapping

开发者 https://www.devze.com 2023-04-07 04:35 出处:网络
Here is the scenario. STUDENT, FACULTY are sub-classes ofPERSON entity, and they have specialized attributes.

Here is the scenario.

STUDENT, FACULTY are sub-classes of PERSON entity, and they have specialized attributes.

Normally, we store common attributes in PERSON table (with p_id as pk) and store specialized in the subclasses. We map the subclass to the superclass using p_id by creating a column in the subclass.

However, is it acceptable to do something like following.

Instead of p_id as the mapping attribute in subclass, can we use something else belonging to the superclass which is unique but not pk.

NOTE: The EER Diagram (conceptual desig开发者_运维百科n) still remains same!


It's just a foreign key, even for supertype/subtype schemas. You can reference any column that's declared UNIQUE.

I'm pretty sleepy, so I'm not sure how that would affect the updatable views. I don't think it would affect them, though. (Assuming you're using them. Some don't bother.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号