Database Reference
In-Depth Information
Entities
An entity is something that users want to track. It is something that is readily identified in
the users' work environment. Example entities are EMPLOYEE Mary Lai, CUSTOMER 12345,
SALES-ORDER 1000, SALESPERSON Wally Smith, and PRODUCT A4200. Entities of a given
type are grouped into an entity class . Thus, the EMPLOYEE entity class is the collection of all
EMPLOYEE entities. In this text, entity classes are shown in capital letters.
It is important to understand the differences between an entity class and an entity in-
stance. An entity class is a collection of entities and is described by the structure of the entities
in that class. An entity instance of an entity class is the occurrence of a particular entity, such
as CUSTOMER 12345. An entity class usually has many instances of an entity. For example, the
entity class CUSTOMER has many instances—one for each customer represented in the data-
base. The CUSTOMER entity class and two of its instances are shown in Figure 5-1.
attributes
Entities have attributes that describe their characteristics. Examples of attributes are
EmployeeNumber, EmployeeName, Phone, and Email. In this text, attributes are written in both
uppercase and lowercase letters. The E-R model assumes that all instances of a given entity
class have the same attributes.
Figure 5-2 shows two different ways of displaying the attributes of an entity. Figure 5-2(a)
shows attributes in ellipses that are connected to the entity. This style was used in the original
E-R model, prior to the advent of data modeling software products. Figure 5-2(b) shows the
rectangle style that is commonly used by data modeling software products today.
Identifiers
Entity instances have identifiers , which are attributes that name, or identify, en-
tity instances. For example, EMPLOYEE instances can be identified by EmployeeNumber,
SocialSecurityNumber, or EmployeeName. EMPLOYEE instances are not likely to be identified
by attributes such as Salary or HireDate because these attributes are not normally used in a
naming role. Similarly, customers can be identified by CustomerNumber or CustomerName,
and sales orders can be identified by OrderNumber.
CUSTOMER Entity
Figure 5-1
CUSTOMER Entity and Two
Entity Instances
CUSTOMER
CustomerNumber
CustomerName
Street
City
State
Zip
ContactName
Email
Two CUSTOMER Instances
1234
Ajax Manufacturing
123 Elm Street
Memphis
TN
32455
Peter Schwartz
Peter@ajax.com
99890
Jones Brothers
434 10th Street
Boston
MA
01234
Fritz Billingsley
Fritz@JB.com
 
Search WWH ::




Custom Search