The Entity-Relationship Model Defining the Entity-Relationship Model Examples Defining the Entity-Relationship Model • Entity classes can be persons, objects, or events which we intend to describe.

Download Report

Transcript The Entity-Relationship Model Defining the Entity-Relationship Model Examples Defining the Entity-Relationship Model • Entity classes can be persons, objects, or events which we intend to describe.

The Entity-Relationship Model
Defining the Entity-Relationship Model
Examples
Defining the Entity-Relationship
Model
• Entity classes can be persons, objects, or
events which we intend to describe in our
database e.g. CUSTOMER, INVOICE,
REGISTRATION, etc.
• Entities or instances of entities e.g.
CUSTOMER 12345 or EMPLOYEE John
Doe, etc. (Fig. 3-1)
There are usually many instances of an entity
in an entity class though the two terms are often
used interchangeably.
• Attributes or properties are used to describe
an entity’s characteristics e.g.
EMPLOYEE(EmployeeName, DateOfHire,
JobSkillCode).
Single, multiple valued (multivalued), and
composite attributes
• Identifiers of entity instances are one or
more of its attributes which can be used to
identify it (key) e.g.
CUSTOMER: Customer Number
Relationships associate different entities.
Degree of a relationship is the number of entities in it.
(Fig. 3-2)
Relationships of degree 2 are called binary relationships.
Unary, Ternary etc.
Maximum cardinality represents the maximum number of
entities that can occur on one side of the relationship, i.e.,
1:1, 1:N, N:1, N:M. (Fig. 3-3)
Minimum cardinality (must and may) (Fig. 3-4)
Recursive relationships exist among entities of
a single class. (Fig. 3-5)
Attributes in E-R diagrams (Fig. 3-6)
Weak Entities. Their presence depends on
the presence of another entity.
Example:PATIENT and APPOINTMENT
Weak Vs. ID-dependent Entities (Fig. 3-7)
• Subtype Entities e.g. CLIENT and
INDIVIDUAL-CLIENT, PARTNERSHIPCLIENT, CORPORATE-CLIENT
supertype; generalization hierarchies; IS-A
relationships; inheritance. (Fig. 3-8)
• Example of an Entity-Relationship Diagram
in Fig. 3-9
Examples of E-R diagrams
• The Jefferson Dance Club (Fig. 3-10,11,12)
• San Juan Sailboat Charters (Fig. 3-13,14)