Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Databases: Topic 3: Entity Relationship Modelling 1

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 33

Databases

Topic 3:
Entity Relationship Modelling 1

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.2

Scope and Coverage


This topic will cover:
Entity Relationship Modelling
Types of Notation
Basic concepts
Entities
Relationships
Attributes
Identifying Entities

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.3

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

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.4

The Goal of Entity Relationship


Modelling
To produce a model of data and data use that is
non-technical and free of ambiguities

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.5

Notations 1 - UML Module


Attributes:
Module Code(PK)
Module Name
1

0...*
Student Attributes:
on Module Code (FK)
Module Student No (FK)

0...*

1
Attributes:
Student Student No(PK)
Student Name

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.6

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

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.7

Notations 3 -
CHEN Module Module Code

Takes

M
Student No
Student

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.8

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.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.9

Entity Occurrence
A unique instance of an entity

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.10

Activity
Identify entity types that might exist in a LIBRARY
SYSTEM.
Can you also think of some entity occurrences?

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.11

Library System ER

Author
Book

Borrower

Subject
Loan

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.12

Occurrences of Entity Types in a


Library System
Book:
Lord of the Rings
Introduction to Databases
How to Win friends and Influence people
Subject:
History
Fiction

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.13

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

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.14

Relationship Types
The meaningful associations between entity types

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.15

Relationship Occurrence
The concrete instance of a relationship type

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.16

Activity - What Relationships Exist


between these Entities? - 1

Book Author

Borrower

Subject Loan

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.17

Activity - What Relationships Exist


between these Entities? - 2
Author
Book

Borrower

Subject

Loan

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.18

Organising it Better
Author

Book Loan Borrower

Subject

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.19

Relationship Names
Author

Writes

Taken out on Takes out


Book Loan Borrower

Classifies

Subject

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.20

Multiplicity - 1
Number or range of possible occurrences of an
entity type in relation to another entity type

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.21

Multiplicity - 2
Author
Writes

Book Loan Borrower


Taken out on Takes out
Classifies

Subject

A Book is Classified by ONE Subject. But ONE


Subject could classify many Books.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.22

Multiplicity - 3
Book
0..*

Classifies

Subject

A Book is Classified by ONE subject. But ONE


Subject could classify none or many Books.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.23

Author
Multiplicity - 4 1..*
Writes

1..*
Book
0..*
Classifies
1
Subject

A Book is Written by ONE or more Authors. An


Author writes one or more Books.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.24

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.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.25

Attributes - 1
A property of an entity type.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.26

Attributes - 2
Attribute Domain
Simple Attribute
Composite Attribute
Single-valued attribute
Multi-valued attribute

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.27

Activity
What are the attributes for the entities we identified
as part of the library system?:
Book
Author
Borrower
Lon

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.28

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.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.29

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.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.30

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.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.31

Learning Outcomes Revisited


Have we met them?
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

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.32

References
Connolly, T. & Begg, C. (2004). Database Systems:
A Practical Approach to Design, Implementation,
and Management, 4th Edition. Addison Wesley.
Chapter 11.

V1.0 NCC Education Limited


Entity Relationship Modelling 1 Topic 3 - 3.33

Topic 3 Entity Relationship Modelling 1

Any Questions?

V1.0 NCC Education Limited

You might also like