You are on page 1of 18

MIS 403 – Database Management Systems -II

Dr Mohamed A Sheriff

Pearson Education © 2009


MIS403 – Lecture 4

Structural Constraints and Problems with


ER Models

2
Chapter 12 - Objectives

 Basic concepts associated with ER model.

 How to identify and resolve problems with ER


models called connection traps.

 How to build an ER model from a requirements


specification.
3
Pearson Education © 2009
Structural Constraints
 Multiplicity is made up of two types of
restrictions on relationships: cardinality and
participation.

4
Pearson Education © 2009
Structural Constraints

 Cardinality
– Describes maximum number of possible
relationship occurrences for an entity
participating in a given relationship type.

 Participation
– Determines whether all or only some entity
occurrences participate in a relationship.
5
Pearson Education © 2009
Multiplicity as cardinality and participation
constraints

6
Pearson Education © 2009
Problems with ER Models
 Problems may arise when designing a
conceptual data model called connection traps.
 Often due to a misinterpretation of the
meaning of certain relationships.
 Two main types of connection traps are called
fan traps and chasm traps.

7
Pearson Education © 2009
Problems with ER Models
 Fan Trap
– Where a model represents a relationship
between entity types, but pathway between
certain entity occurrences is ambiguous.

 Chasm Trap
– Where a model suggests the existence of a
relationship between entity types, but pathway
does not exist between certain entity
occurrences.
8
Pearson Education © 2009
An Example of a Fan Trap

9
Pearson Education © 2009
Semantic Net of ER Model with Fan Trap

 At which branch office does staff number SG37


work?

10
Pearson Education © 2009
Restructuring ER model to remove Fan Trap

11
Pearson Education © 2009
Semantic Net of Restructured ER Model
with Fan Trap Removed

 SG37 works at branch B003.

12
Pearson Education © 2009
An Example of a Chasm Trap

13
Pearson Education © 2009
Semantic Net of ER Model with Chasm Trap

 At which branch office is property PA14


available?

14
Pearson Education © 2009
ER Model restructured to remove Chasm Trap

15
Pearson Education © 2009
Semantic Net of Restructured ER Model
with Chasm Trap Removed

16
Pearson Education © 2009
Class Exercise - Entity Relationship Modelling

A university library keeps information on books held, students who borrow the books,
and the (book)loans which the students take. In addition, information is held about
the authors and the library cards the students use to borrow the books. A book can be
written by many authors and one author can write several books. Also a book(copy)
can be borrowed by many students and a student can borrow many books.
Each student is given one library card with a unique number. The card number and
date
of allocation of each card are recorded. A database designer has identified the following
entities and attributes for the library system.

Book_Title(ISBN, Title, Price)


Book_Copy(BookCopyNo, DateAcquired, DateDestroyed)
Student(StudentNo, StudentName, Course)
Author(AuthorNo, AuthorName)
Library_Card(CardNo, DateAllocated)

Develop an ER diagram for the proposed library database system clearly indicating the
ER Diagram – Library Database using UML notation

BookCopy Loan Student


1..1 0..* 0..* 1..1
BookCopyNo StudentNo StudentNo
DateAcquired For BookCopyNo Takes StudentName
Date Destroyed DateOut Course
DateDue
1..* DateBack 1..`1
AllocatedTo
Has
1..1 1..1

BookTitle Author LibraryCard


1..* 1..*
ISBN AuthorNo CardNo
Title Writes AuthorName DateAllocated
Price

Identify all primary (PK) and Foreign(FK) keys and decomposed any many-to-many
relationships

You might also like