Extended E-R Features:
The basic
E-R concepts can model most database features. But, some aspects of a database
may be better expressed by certain extensions to the basic E-R model.
1. Specialization:
An entity set may include subgroupings of entities that are
distinct in some way from other entities in the set. For ex: a subset of
entities within an entity set may have attributes that are not shared by all
the entities in the entity set. The E-R model provides a means for representing
these distinctive entity groupings.
Consider an entity set person, with attributes name, street,
and city. A person may be further classified as one of the following:
• customer
• employee
Each of these person types is described by a set of attributes
that includes all the attributes of entity set person plus possibly additional
attributes. For ex: customer entities may be described further by the attribute
customer-id, whereas employee entities may be described further by the
attributes employee-id and salary.
The process of designating subgroupings within an entity set
is called specialization. The
specialization of a person allows us to distinguish among persons according to
whether they are employees or customers.
Consider another ex: suppose the bank wishes to divide
accounts into two categories viz. checking account and savings account. Savings
accounts need a minimum balance, but the bank may set interest rates
differently for different customers, offering better rates to favored
customers. Checking accounts have a fixed interest rate, but offer an overdraft
facility; the overdraft amount on a checking account must be recorded.
The bank could then create two specializations of account,
namely savings-account and checking-account. The account entities are described
by the attributes account-number and balance. The entity set savings-account
would have all the attributes of account and an additional attribute
interest-rate. The entity set checking-account would have all the attributes of
the account, and an additional attribute overdraft amount.
The
specialization can be applied repeatedly to refine a design scheme. For ex: bank
employees may be further classified as one of the following:
• officer
• teller
• secretary
Each of these employee types is described by a set of
attributes that includes all the attributes of entity set employee plus
additional attributes. For ex: officer entities may be described further by the
attribute office-number, teller entities by the attributes station-number and
hours-per-week, and secretary entities by the attribute hours-per-week.
Further, secretary entities may participate in a relationship secretary-for,
which identifies which employees are assisted by a secretary.
An entity set may be specialized by more than one
distinguishing feature. In the above example, the distinguishing feature among
employee entities is the job the employee performs. Another form of
specialization that could exist can be based on whether the person is a
temporary or a permanent employee. This results in the entity sets
temporary-employee and permanent-employee.
When more than one specialization is formed on an entity set,
a particular entity may belong to multiple specializations. For ex: a given
employee may be a temporary employee who is a secretary.
In the E-R diagram, specialization is depicted by a triangle component labeled ISA. The
label ISA stands for “is a” and represents, for ex: that a
customer “is a” person. The ISA
relationship may also be referred to as a superclass-subclass relationship.
Higher- and lower-level entity sets are depicted as regular entity a set—that
is, as rectangles containing the name of the entity set.
No comments:
Post a Comment