Monday, 4 February 2013

Why is allowing this redundancy a bad practice that one should avoid whenever possible?

Q) Consider an E-R diagram in which the same entity set appears several times. Why is allowing this redundancy a bad practice that one should avoid whenever possible?


Answer: By using one entity set many times we are missing relationships in the model.

E-R-diagram-with-entity-duplicationE-R diagram with entity duplication


For example, in the E-R diagram in above Figure : the students taking classes are the same students who are athletes, but this model will not show that.


Q) Consider a university database for the scheduling of classrooms for final exams.
This database could be modeled as the single entity set exam, with attributes course-name, section-number, room-number, and time. Alternatively, one or more additional entity sets could be defined, along with relationship sets to replace some of the attributes of the exam entity set, as


• course with attributes name, department, and c-number
• section with attributes s-number and enrollment, and dependent as a weak entity set on course
• room with attributes r-number, capacity, and building


a. Show an E-R diagram illustrating the use of all three additional entity sets listed.


Answer:


E-R-diagram-for-exam-schedulingE-R diagram for exam scheduling


b. Explain what application characteristics would influence a decision to include or not to include each of the additional entity sets.


Answer:


The additional entity sets are useful if we wish to store their attributes as part of the database. For the course entity set, we have chosen to include three attributes. If only the primary key (c-number) were included, and if courses have only one section, then it would be appropriate to replace the course (and section) entity sets by an attribute (c-number) of exam. The reason it is undesirable to have multiple attributes of course as attributes of exam is that it would then be difficult to maintain data on the courses, particularly if a course has no exam or several exams. Similar remarks apply to the room entity set.


Related Topics : E-R diagram for favourite sports team statistics

E-R diagram for marks database

E-R diagram for a university

Explain the distinctions among the terms primary key, candidate key, and superkey.

List six major steps that you would take in setting up a database for a particular enterprise.

Explain the difference between a weak and a strong entity set.

Define the concept of aggregation. Give two examples of where this concept is useful.

No comments:

Post a Comment