Databases Reference
In-Depth Information
The cardinality of a relationship pertains to the maximum number of rela-
tionship instances that an entity can be involved in. The different levels of
cardinality are: one to one (1:1), one to many (1:N), or many to many (M:N).
Relationships also use the concept of participation. Participation specifies
the minimum cardinality. The minimum cardinality specifies whether any
instance of one entity can exist without being associated with at least one
member of another entity set. If it can, the participation is optional or partial;
if it cannot, it is mandatory or total. In Exhibit 1, optional participation is rep-
resented by an open circle and mandatory is represented by a closed circle.
Another important concept in the ER model is the weak entity type. It is
an entity that does not have its own unique identifier. The weak entity is
depicted as a rectangle with double lines (see Exhibit 1). The relationship
that associates the weak entity to its parent entity is called an identifying
relationship and is modeled as a diamond with double lines (see Exhibit 1).
An example of a weak entity type is an employee's dependents; a depen-
dent cannot be identified without knowing the associated employee.
If entities have additional subgroups with important characteristics that
require modeling, then a generalization/specialization structure is used.
This structure is often known as a is-a relationship. An example of this
structure is that an engineer entity is an employee entity. The employee
entity is called a superclass and the other entities are referred to assub-
classes. The subclasses have their own attributes plus they inherit all the
attributes from their superclass.
The difference between generalization and specialization concerns how
the structure is developed. Specialization is developed top-down whereas
generalization is developed bottom-up. In specialization, an employee
entity would be broken down into engineer, manager, and secretary enti-
ties. Using generalization, an analyst first develops engineer, manager, and
secretary entities and then creates the employee entity. For ease of nota-
tion the term generalization is used in this article to refer to both special-
ization and generalization.
A constraint on the generalization structure is whether the entities are
disjoint or if they can overlap. If the structure is disjoint, then an entity can
only be a member of one subclass. If an entity can be a member of more than
one subclass, then the structure is overlapping. The employee structure is
disjoint because an employee is exactly an engineer, manager, or secretary.
Exhibit 3 presents an ER diagram of an accounting system. The diagram
shows a Supplier, Account and Payment, Pay_Method, Check, Credit Card,
and Cash entities. The Account has a single Supplier with total participation
meaning that every account should have a responsible supplier. The Supplier
entity charges many Accounts, with total participation. The Account has
many Payment with partial participation. This means that an Account can
Search WWH ::




Custom Search