Databases: Topic 3: Entity Relationship Modelling 1
Databases: Topic 3: Entity Relationship Modelling 1
Databases: Topic 3: Entity Relationship Modelling 1
Topic 3:
Entity Relationship Modelling 1
Learning Outcomes
By the end of this topic, students will be able to:
Understand the goal of ER modelling
Recognise different types of notation
Understand the concepts of an entity type,
relationships and attributes
Begin to develop an approach to identifying entities
0...*
Student Attributes:
on Module Code (FK)
Module Student No (FK)
0...*
1
Attributes:
Student Student No(PK)
Student Name
Notations 2 - Attributes:
Module Module Code(PK)
CROWS FEET Module Name
Attributes:
Student on
Module Code(PK)(FK)
Module
Student No (PK) (FK)
Attributes:
Student Student No(PK)
Student Name
Notations 3 -
CHEN Module Module Code
Takes
M
Student No
Student
Entity Type
A group of objects, people, types, concepts or other
items that have the same set of properties (known
as attributes).
Must be of interest to whoever is building the new
information system.
Entity Occurrence
A unique instance of an entity
Activity
Identify entity types that might exist in a LIBRARY
SYSTEM.
Can you also think of some entity occurrences?
Library System ER
Author
Book
Borrower
Subject
Loan
Diagrammatic Representation of
Entity Types
Each entity type is shown as a rectangle labeled with the name of the entity,
which is normally a singular noun.
In UML, the name of an entity should begin with an upper case letter.
Book
Relationship Types
The meaningful associations between entity types
Relationship Occurrence
The concrete instance of a relationship type
Book Author
Borrower
Subject Loan
Borrower
Subject
Loan
Organising it Better
Author
Subject
Relationship Names
Author
Writes
Classifies
Subject
Multiplicity - 1
Number or range of possible occurrences of an
entity type in relation to another entity type
Multiplicity - 2
Author
Writes
Subject
Multiplicity - 3
Book
0..*
Classifies
Subject
Author
Multiplicity - 4 1..*
Writes
1..*
Book
0..*
Classifies
1
Subject
Self-Study
Author
Writes
Taken out on Takes out
Book Loan Borrower
Classifies
Subject
A Book is Classified by ONE subject. But ONE
Subject could classify many Books.
Attributes - 1
A property of an entity type.
Attributes - 2
Attribute Domain
Simple Attribute
Composite Attribute
Single-valued attribute
Multi-valued attribute
Activity
What are the attributes for the entities we identified
as part of the library system?:
Book
Author
Borrower
Lon
Identifying Entities - 1
Look for nouns.
Example:
A student record system is used to allocate
students to modules. Each module is part of a
course. Each module has one or more
assessments attached to it.
Identifying Entities - 2
Look for nouns.
Example:
A student record system is used to allocate
students to modules. Each module is part of a
course. Each module has one or more
assessments attached to it.
Identifying Entities - 3
This can also be done with a bottom up approach
using normalisation which we will look at later.
For now we are using a top-down approach.
There will be an exercise as part of the self-study.
References
Connolly, T. & Begg, C. (2004). Database Systems:
A Practical Approach to Design, Implementation,
and Management, 4th Edition. Addison Wesley.
Chapter 11.
Any Questions?