1) Explain the distinctions among the terms primary key, candidate key, and super key .
Answer:
2) Construct an E-R diagram for a car-insurance company whose customers own one or more cars each. Each car has associated with it zero to any number of recorded accidents.Answer:
- A super key is a set of one or more attributes that, taken collectively, allows us to identify uniquely an entity in the entity set. A super key may contain extraneous attributes. If K is a super key, then so is any superset of K.
- A super key for which no proper subset is also a super key is called a candidate key. It is possible that several distinct sets of attributes could serve as candidate keys.
- The primary key is one of the candidate keys that is chosen by the database designer as the principal means of identifying entities within an entity set.
Answer:
3) Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors. Associate with each patient a log of the various tests and examinations conducted.
Answer:
4) We can convert any weak entity set to a strong entity set by simply adding appropriate attributes. Why, then, do we have weak entity sets?
Answer: We have weak entities for several reasons.
- We want to avoid the data duplication and consequent possible inconsistencies caused by duplicating the key of the strong entity.
- Weak entities reflect the logical structure of an entity being dependent on
another entity. - Weak entities can be deleted automatically when their strong entity is deleted.
- Weak entities can be stored physically with their strong entities.
Comments
Post a Comment