Firefox
Firefox

Reputation: 951

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 design) still remains same!

Upvotes: 0

Views: 4177

Answers (1)

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.)

Upvotes: 2

Related Questions