Weak-Entities-Strong-Relationships - Database Systems:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Database Systems: Design, Implementation and Management, Rob/Coronel Existence-Dependency and Weak-Entities 1 Q&A Question On page 135 (5 th edition) you state: "In any case, CLASS is always existence-dependent on COURSE, whether or not it is defined to be weak." Is this statement always true? Answer This statement is always true. Consider the definition of COURSE as COURSE( CRS_CODE , CRS_DESCRIPTION, CRS_CREDIT) and CLASS as CLASS( CRS_CODE, CLASS_SECTION , CLASS_TIME, ROOM_CODE, PROF_NUM) Given the definitions of COURSE and CLASS in this example, a CLASS cannot exist unless it has a FK CRS_CODE that points to an existing COURSE row. But this condition means that CLASS is existence- dependent on COURSE. Incidentally, in this example CLASS is also a weak ENTITY to COURSE. That’s because a weak entity is defined as one that inherits at least part of its PK from the (parent) COURSE entity and it is existence-dependent on the (parent) COURSE entity. (Note that there are two requirements that must be met before an entity can be classified as weak.) Question An example of a CLASS that is not weak to COURSE is defined by CLASS ( CLASS_CODE , CRS_CODE, CLASS_SECTION, CLASS_TIME, ROOM_CODE, PROF_NUM Why can you say that this entity may not be classified as weak by definition, but that it is existence- dependent on COURSE? Answer The CLASS_CODE attribute was added for the sole purpose of uniquely identifying each CLASS table row, that is, to be the PK. Note that this CLASS table also has a candidate key (CRS_CODE+CLASS_SECTION). But especially note that CLASS is still existence dependent on COURSE because its CRS_CODE FK must point to an existing COURSE – but it is no longer a weak ENTITY. (That’s because the PK of CLASS does not contain the related COURSE entity’s CRS_CODE primary key. In other words, the CRS_CODE FK in CLASS is not part of the PK.) In any case, make sure that you know the difference between a weak entity and a weak (non-identifying) relationship . (Incidentally, database terminology does not include the term strong entity . If an entity is not weak, it is assumed to be strong.) To understand the differences between various types of entities and relationships, let’s review the three
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Weak-Entities-Strong-Relationships - Database Systems:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online