Vous êtes sur la page 1sur 22

Data Modeling

With Entity
Relationship
Diagram
PART 2
Data Modeling with
Entity Relationship Diagrams

Relationship Strength
Weak Entities
Relationship Participation
Relationship Degree
Recursive Relationship
Develop ER Diagram
Data
Modeling ERD
with
ERD Relationship Strength

Weak (non-identifying) relationships


- Exists if PK of related entity does not contain PK component
of parent entity

Strong (identifying) relationships


- Exists when PK of related entity contains PK component of
parent entity
Data
Modeling ERD
with !
ERD Relationship Strength
Data
Modeling ERD
with !
ERD Relationship Strength
Data
Modeling ERD
with !
ERD
Weak Entities

Weak entity meets two conditions


- Existence-dependent
- Primary key partially or totally derived from parent
entity in relationship
Database designer determines whether an entity is
weak based on business rules
Data
Modeling ERD
with !
ERD strong entity / weak entity

Strong entity sets have a primary key; weak entity sets have no primary key.
Weak entities rely on strong entities for their existence in the data model.
E.g. the next-of-kin of an employee are irrelevant if the employee leaves.

In ER diagrams:
weak entities are denoted by
double-boxes
strong/weak entity relationships
are denoted by double- name phone
diamonds
discriminators are denoted by
dotted underline
Data
Modeling ERD
with !
ERD
Weak Entities
Data
Modeling ERD
with !
ERD
Weak Entities
Data
Modeling
with !
ERD
ERD Relationship Participation

Optional participation
- One entity occurrence does not require
corresponding entity occurrence in particular
relationship

Mandatory participation
- One entity occurrence requires corresponding entity
occurrence in particular relationship
Data
Modeling
with !
ERD
ERD Relationship Participation
Data
Modeling
with !
ERD
ERD Relationship Participation
Data
Modeling
with !
ERD
ERD Relationship Degree

Indicates number of entities or participants


associated with a relationship
Unary relationship
- Association is maintained within single entity
Binary relationship
- Two entities are associated
Ternary relationship
- Three entities are associated
Data
Modeling ERD
with !
ERD Relationship Degree
Data
Modeling
with !
ERD
ERD Relationship Degree
Data
Modeling
with !
ERD
ERD Recursive Relationship

Relationship can exist between occurrences of the


same entity set
- Naturally found within unary relationship
Data
Modeling
with !
ERD
ERD Relationship Degree
Data
Modeling
with !
ERD
ERD Relationship Degree
SUMMARY
Entity relationship (ER) model
- Uses ERD to represent conceptual database as
viewed by end user
- ERMs main components:
Entities
Relationships
Attributes
- Includes connectivity and cardinality notations as
well as relationship participation, recursive
relationships and bridge entities.

2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
DISCUSSION
Exercise 1
Each company operates four departments, and each department
belongs to one company.
Each department in employs one or more employees, and each
employee works for one department.
Each of the employees may or may not have one or more
dependents, and each dependent belongs to one employee.
Each employee may or may not have an employment history.

Note : Provide any assumptions necessary to support your model.


DISCUSSION
Exercise 2
A large organization has several parking lots, which are used by staff.
Each parking lot has a unique name, location, capacity, and number of
floors.
Each parking lot has parking spaces, which are uniquely identified using
a space number.
Members of staff can request the use of a parking space. Each member
of staff has a unique number, name, telephone extension number, and
vehicle license number.

Note : Provide any assumptions necessary to support your model.


DISCUSSION
Exercise 3

You are required to create an ER model of data requirements for a company


that specializes in IT training. The company has 30 instructors and can
handle up to 100 trainees per training session. The company offers five
advanced technology courses, each of which is taught by a teaching team of
two or more instructors. Each instructor is assigned to a maximum of two
teaching teams or may be assigned to do research. Each trainee undertakes
one advanced technology course per training session.

a. Identify the main entity types for the company


b. Identify the main relationship types and specify the multiplicity for each
relationship. State any assumptions that you make about the data.

Vous aimerez peut-être aussi