You are on page 1of 10

Database Design

Matrix Diagrams

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

Matrix Diagrams

Objectives
This lesson covers the following objectives:
Identify relationships using a matrix diagram
Draw an ERD from a matrix diagram

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

Matrix Diagrams

Purpose
TEACHER

It is useful to know
more than one
way to discover
relationships.

COURSE

CLASS

TEACHER

COURSE

STUDENT

CLASS

EXAM

SEMESTER

CAFETERIA

GRADE

CLASSROOM

SCHOOL

etc.

It may be simple enough


to identify relationships
given three entities.

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

CLUB

SCHOOL
EQUIPMENT

MAINTENANCE
STAFF

But what about finding


relationships when you
have thirteen or more
entities?

Matrix Diagrams

Purpose (cont.)
TEACHER

Using a matrix
diagram,
especially when
you are dealing
with many entities,
is a good way to
make sure that
you havent
missed any
relationships.

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

COURSE

CLASS

TEACHER

COURSE

STUDENT

CLASS

EXAM

SEMESTER

CAFETERIA

GRADE

CLASSROOM

SCHOOL

etc.

It may be simple enough


to identify relationships
given three entities.

CLUB

SCHOOL
EQUIPMENT

MAINTENANCE
STAFF

But what about finding


relationships when you
have thirteen or more
entities?

Matrix Diagrams

Business Scenario
"I work for a travel agency.
I keep a record of the
countries that our
customers have visited
and the landmarks theyve
seen in each country. It
helps us customize tours
for them."

TRAVELER

COUNTRY
LANDMARK

TRAVELER

COUNTRY

TRAVELER

COUNTRY

We can use the matrix


diagram to uncover
relationships.
5

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

LANDMARK

MATRIX DIAGRAM

LANDMARK

Matrix Diagrams

Matrix Diagrams
TRAVELER

Relationships
discovered via the
matrix diagram are
drawn on the ERD.

TRAVELER
COUNTRY
LANDMARK

COUNTRY

visit
visited by
seen by

located in

incorrect: TRAVELER visited by COUNTRY


Copyright 2013, Oracle and/or its affiliates. All rights
reserved.

have seen
the location of

To avoid confusion, be
consistent in writing to
and reading from the
matrix only in one
correct: COUNTRY visited by TRAVELER
direction.

LANDMARK

Matrix Diagrams

Matrix Diagrams (cont.)


Relationships
discovered via the
matrix diagram are
drawn on the ERD.
Matrix diagrams do
not show optionality
and cardinality.

TRAVELER
TRAVELER
COUNTRY
LANDMARK

TRAVELER

COUNTRY

visit

seen by

the location of

located in

visit

COUNTRY
visited by
the location of

located in
Seen by

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

have seen

visited by

have seen

LANDMARK

LANDMARK

Matrix Diagrams

Matrix Diagrams (cont.)


Each COUNTRY
may be visited by one
or more
TRAVELERs.

TRAVELER
TRAVELER
COUNTRY
LANDMARK

TRAVELER

COUNTRY

LANDMARK

visit

have seen

visited by
seen by

the location of

located in

visit

COUNTRY
visited by
the location of

have seen

located in
Seen by

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

LANDMARK

Matrix Diagrams

Terminology
Key terms used in this lesson included:
Matrix diagram

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

Matrix Diagrams

Summary
In this lesson, you should have learned how to:
Identify relationships using a matrix diagram
Draw an ERD from a matrix diagram

10

Copyright 2013, Oracle and/or its affiliates. All rights


reserved.

You might also like