0% found this document useful (0 votes)
28 views20 pages

DB 05

The document discusses entity relationship (ER) modeling. It provides an overview of ER components like entities, attributes, relationships and ER diagrams. It explains key ER concepts such as entity types, relationship types, attributes and their properties. Examples of ER diagrams are included that illustrate different relationship types like one-to-one, one-to-many and many-to-many relationships. The advantages of ER modeling for conceptual database design are discussed along with some limitations.

Uploaded by

yangkunbao666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views20 pages

DB 05

The document discusses entity relationship (ER) modeling. It provides an overview of ER components like entities, attributes, relationships and ER diagrams. It explains key ER concepts such as entity types, relationship types, attributes and their properties. Examples of ER diagrams are included that illustrate different relationship types like one-to-one, one-to-many and many-to-many relationships. The advantages of ER modeling for conceptual database design are discussed along with some limitations.

Uploaded by

yangkunbao666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Entity Relationship (ER)

Modeling
• Entity relationship components
• Developing ER Diagram

Database Management –
COMP3140
Billy Yu

1
The Entity Relationship Model
• Graphical representation of entities and
their relationships in a database structure
• Entity relationship diagram (ERD)
– Uses graphic representations to model
database components
• Entity instance or entity occurrence
– Rows in the relational table
• Connectivity: Term used to label the
relationship types

2
Introduction to ER modeling
Video
• https://www.youtube.com/watch?v=QpdhBUYk7Kk&t=193s

3
Attributes
• Characteristics of entities
• Required attribute: Must have a value,
cannot be left empty
• Optional attribute: Does not require a
value, can be left empty
• Domain - Set of possible values for a
given attribute
• Identifiers: One or more attributes that
uniquely identify each entity instance
4
Attributes

• Composite identifier: Primary key


composed of more than one attribute
• Composite attribute: Attribute that
can be subdivided to yield additional
attributes
• Simple attribute: Attribute that
cannot be subdivided
• Single-valued attribute: Attribute
that has only a single value
• Multivalued attributes: Attributes
that have many values

5
Figure 2.3 - The ER Model
Notations

6
More example

https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model
7
Figure 2.4 - A Comparison of
OO, UML and ER Models

• invoices are generated by customers,


• each invoice references one or more lines, and
• each line represents an item (or items) purchased by a customer.

8
Figure 4.1 - The Attributes of
the Student Entity: Chen and
Crow’s Foot

9
Figure 4.3 - A Multivalued
Attribute in an Entity

10
Figure 4.8 - A Weak (Non-
Identifying) Relationship
between COURSE and CLASS

11
Figure 4.9 - A Strong
(Identifying) Relationship
between COURSE and CLASS

12
Figure 4.13 - CLASS is Optional
to COURSE

13
Figure 4.14 - COURSE and CLASS
in a Mandatory Relationship

14
Special relationships….
• Rare they are, but still possible

15
Relationship Degree
• Indicates the number of entities or
participants associated with a relationship
• Unary relationship: Association is
maintained within a single entity
– Recursive relationship: Relationship exists
between occurrences of the same entity set
• Binary relationship: Two entities are
associated
• Ternary relationship: Three entities are
associated
16
Figure 4.15 -
Three Types
of
Relationship
Degree

17
Entity Relationship Model
Advantages Disadvantages
• Visual modeling yields • Limited constraint
conceptual simplicity representation
• Visual representation • Limited relationship
makes it an effective representation
communication tool • No data manipulation
• Is integrated with the language
dominant relational model • Loss of information
content occurs when
attributes are removed
from entities to avoid
crowded displays

18
Figure 4.17 - An ER
Representation of Recursive
Relationships

19
Database Design Challenges:
Conflicting Goals

Database design must conform to design standards

Need for high processing speed may limit the


number and complexity of logically desirable
relationships

Need for maximum information generation may lead


to loss of clean design structures and high
transaction speed

20

You might also like