Database Reference
In-Depth Information
attribute name in a data model diagram indicates that the attribute is the primary
key. Here is a brief summary of the main points:
Candidate key. One or more attributes whose values uniquely identify individual
entities.
Primary key. One of the candidate keys selected to serve as the unique identifier
for the entity type.
Composite key. A candidate key that consists of two or more attributes.
Considerations for Choosing Primary Key
Attribute length. Choose the shortest of the candidate keys.
Number of attributes. Prefer a key with a single attribute to a composite key.
Certainty of uniqueness. From the candidate keys, select the one that is more likely
to contain unique values during the life of the database system.
Built-in meanings. Avoid any candidate key where values of parts of the attribute
have built-in meanings, e.g., the attribute ProductNumber, where the values of part
number indicate the production batch in the manufacturing plant.
RELATIONSHIPS
Let us reconsider information requirements for a university. Note the obvious fact
that students register for courses. You observe that a particular student registers for
several courses. Student Karolyn Stone registers for the courses Database Design,
Data Warehousing, and Web Page Design. This is a relationship of that particular
student Karolyn Stone with the three courses.
On the flip side of the relationship, you also note that many students register for
one particular course. You find that for the course on Database Design, other stu-
dents such as Samuel Wang, Tabitha Peters, and Monika Gonzales have also regis-
tered. So you notice the relationship between the course Database Design and the
four students.
We have been through relationships and their features in sufficient detail while
discussing the object-based data model. You know how instances of one object set
may have relationships with instances of one or more object sets. Now let us high-
light some key points in the way the E-R data model deals with relationships. Note
the slight differences in the notations used in the E-R data model.
Association Between Entities
Go back to the above example of students and course. Let us review the
example in the context of the E-R data model and use the terms that apply to this
model.
Search WWH ::




Custom Search