Tuesday, August 24, 2010

In relation to entity relationships, can a sub-entity exist if its super-entity is deleted?

Also, can a weak entity exist if its base table is deleted?In relation to entity relationships, can a sub-entity exist if its super-entity is deleted?
According to the model rules, NO.





However, when you implement the ERD it depends if you enforce referential integrity. If you add the ';On Delete CASCADE'; rule to the database relationship, then sub and weak entities will be cleared out when their ';owning'; entities are deleted.





However, if you don't design it correctly, then the entities can be left behind.





You may not be allowed to drop a base table until you delete dependant tables if the constraints are properly enforced.

No comments:

Post a Comment