Database Reference
In-Depth Information
EmployeeName
EmployeeNumber
EMPLOYEE
Phone
EmployeeNumber
EmployeeName
Phone
Email
HireDate
ReviewDate
EMPLOYEE
Email
Figure 5-2
Variations on Entity
Diagram Attribute
Displays in
E-R Models
ReviewDate
HireDate
(a) Attributes in Ellipses
(b) Attributes in Rectangle
The identifier of an entity instance consists of one or more of the entity's attributes.
Identifiers that consist of two or more attributes are called composite identifiers . Examples are
(AreaCode, LocalNumber), (ProjectName, TaskName), and (FirstName, LastName, DateOfHire).
By ThE Way Notice the correspondence of identifiers and keys. The term identifier is
used in a data model, and the term key (which we have already introduced
in our discussion of relational databases in Chapter 3) is used in a database design.
Thus, entities have identifiers, and tables (or relations) have keys. Identifiers serve the
same role for entities that keys serve for tables.
As shown in Figure 5-3, entities are portrayed in three levels of detail in a data model. As
shown in Figure 5-3(a), sometimes the entity and all of its attributes are displayed. In such cases,
the identifier of the attribute is shown at the top of the entity and a horizontal line is drawn after
the identifier. However, in a large data model, so much detail can make the data model diagrams
unwieldy. In those cases, the entity diagram is abbreviated by showing just the identifier, as in
Figure 5-3(b), or by showing just the name of the entity in a rectangle, as shown in Figure 5-3(c).
All three techniques are used in practice; the more abbreviated form in Figure 5-3(c) is used to
show the big picture and overall entity relationships. The more detailed view in Figure 5-3(a) is
frequently used during database design. Most data modeling software products have the ability
to show all three displays.
Relationships
Entities can be associated with one another in relationships . The E-R model contains both
relationship classes and relationship instances. 3 Relationship classes are associations
among entity classes, and relationship instances are associations among entity instances.
EMPLOYEE
Figure 5-3
Variations on Level of Entity
Attribute Displays
EmployeeNumber
EMPLOYEE
EmployeeNumber
EmployeeName
Phone
Email
HireDate
ReviewDate
EMPLOYEE
(a) Entity with All
Attributes
(b) Entity with Identifier
Attribute Only
(c) Entity with No
Attributes
3 For brevity, we sometimes drop the word instance when the context makes it clear that an instance rather
than an entity class is involved.
 
Search WWH ::




Custom Search