EER : Superclass/subclass Entity relationship, primary key mapping
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.)
精彩评论