Professional Documents
Culture Documents
W13 - Lecture 25 - ER Diagram
W13 - Lecture 25 - ER Diagram
Concepts
Lecture 25
Entity/Relationship
Modelling
5/18/2023 CSC291 - Software Engineering Concepts 2
Lecture Outline
• Entity/Relationship models
• Entities and Attributes
• Relationships
• E/R Diagrams
5/18/2023 CSC291 - Software Engineering Concepts 3
Entity/Relationship Modelling
• ERD is a data modeling technique used in software
engineering to produce a conceptual data model of an
information system.
Entity/Relationship Modelling
5/18/2023 CSC291 - Software Engineering Concepts 5
Entity/Relationship Modelling
Entity/Relationship Diagrams
E/R Models are often
Lecturer ID
represented as E/R
diagrams Name Ph#
teaches Student
Course Register
5/18/2023 CSC291 - Software Engineering Concepts 7
Entities
• Entities represent objects • Entities have
or things of interest • A general type or class, such
as Lecturer or Module
• Physical things like students,
lecturers, employees.. • Instances of that particular
• More abstract things like type, such as Steve Mills,
modules, orders, courses, Natasha are instances of
projects Lecturer
Entities
Lecturer ID
• In an E/R Diagram, an
entity is usually drawn as a Name PH#
box with rounded corners
or Rectangle teaches Student
Attributes
Diagramming Attributes
• In an E/R Diagram
Lecturer ID
attributes may be drawn as
ovals Name Ph#
Types of Attributes
• Composite attributes
Attributes can also have their own specific attributes. For
example, the attribute “customer address” can have the
attributes “number, street, city, and state”.
5/18/2023 CSC291 - Software Engineering Concepts 12
Types of Attributes
• Multivalued Attribute
If an attribute can have more than one value it is called
an multivalued attribute.
For example a teacher entity can have multiple subject
values.
5/18/2023 CSC291 - Software Engineering Concepts 13
Types of Attributes
• Derived Attribute
An attribute based on another attribute. This is found
rarely in ER diagrams. For example for a circle the area
can be derived from the radius.
5/18/2023 CSC291 - Software Engineering Concepts 14
Relationships
• Relationships are an
association between two • Relationships have
or more entities • A name
• A set of entities that
• Each Student takes several participate in them
Courses • A degree - the number of
entities that participate (most
• Each Course is taught by a have degree 2)
Lecturer • A cardinality ratio
Cardinality Ratios
Diagramming Relationships
Lecturer ID
• Relationships are links
between two entities Name Ph#
Example
We want to represent information about products in a
database. Each product has a Product id, description, and
price. Supplier supply the products.
Supplier have address, phone numbers, and name. Each
address is made up of a street address, a city, and a
postcode.
5/18/2023 CSC291 - Software Engineering Concepts 19
Chapter Reading
• Chapter 5, System Modeling,
Software Engineering by Ian Sommerville