You are on page 1of 18

1 Copyright 2013, Oracle and/or its affiliates.

All rights
reserved.
Database Design
Arcs
2 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Objectives
This lesson covers the following objectives:
Define the term "constraint" as it applies to data
modeling
Identify an exclusive OR relationship in a business
scenario
Diagram an arc constraint to represent an exclusive OR
relationship
Distinguish between the use of an arc and a subtype in
the data model


Arcs
3 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Purpose
Arcs in data modeling help designers clarify an exclusive
OR across relationships. The more explicitly you can
define the client's requirements, the more accurate your
final implementation will be.
Arcs
4 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
What is a Constraint?
Every business has restrictions on which attribute values
and which relationships are allowed. These restrictions
are called constraints. They may refer to a single attribute
of an entity, or to relationships between entities.

We already know about several kinds of constraints; for
example, every EMPLOYEE must work in one and only
one DEPARTMENT. In this lesson, we will see another
kind of constraintan exclusive OR constraint.
Arcs
5 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Exclusive OR Relationship
Mutually exclusive
relationships
(sometimes called
exclusive OR *
relationships) often
exist.


Arcs



feature
feature
feature
featured
on
featured
on
featured
on
BILLBOARD
# number
* size
* location
MOVIE
# title
o opening date
PRODUCT
ADVERTISEMENT
# name
PUBLIC
ANNOUNCEMENT
# message
6 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Exclusive OR Relationship (cont.)
For example: A
billboard is an
advertising space
that can feature a
movie, a product, or
a public
announcement. It
may contain
advertising about
only one of these at a
time.
Arcs



feature
feature
feature
featured
on
featured
on
featured
on
BILLBOARD
# number
* size
* location
MOVIE
# title
o opening date
PRODUCT
ADVERTISEMENT
# name
PUBLIC
ANNOUNCEMENT
# message
7 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Exclusive OR Relationship (cont.)
Each feature has its
own characteristics
or attributes. * In
many programming
languages, exclusive
OR is a logical
operator that returns
a true value if one,
but not both, of its
operands is true.

Arcs



feature
feature
feature
featured
on
featured
on
featured
on
BILLBOARD
# number
* size
* location
MOVIE
# title
o opening date
PRODUCT
ADVERTISEMENT
# name
PUBLIC
ANNOUNCEMENT
# message
8 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Exclusive OR Relationship (cont.)
* In many
programming
languages, exclusive
OR is a logical
operator that returns
a true value if one,
but not both, of its
operands is true.
Arcs



feature
feature
feature
featured
on
featured
on
featured
on
BILLBOARD
# number
* size
* location
MOVIE
# title
o opening date
PRODUCT
ADVERTISEMENT
# name
PUBLIC
ANNOUNCEMENT
# message
9 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
DJs on Demand Business Scenario
The DJ business has a mutually exclusive relationship
between EVENT and VENUE.
Arcs
10 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Representing Exclusive OR Relationships in
the ERD
Arcs are a way to represent
mutually exclusive
relationships in the ERD.

The arc represents the
exclusive OR relationship --
each EVENT must be held
at one PRIVATE HOME or
must be held at one
PUBLIC SPACE, but not
both.

Arcs
EVENT
# id
* cost
* name
* date
o description
PRIVATE HOME
# id
* address
o comments
PUBLIC SPACE
# id
* address
* rental fee
o comments
the venue for the venue for
held at held at
11 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Arcs
An arc always belongs to one entity.
Arcs can include more than two relationships.
Not all relationships of an entity need to be included in
an arc.
An entity may have several arcs.
An arc should always consist of relationships of the
same optionality.
Arcs
12 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Arcs (cont.)
All relationships in an arc must be mandatory or all must
be optional.
Relationships in an arc may be of different cardinality,
although this is rare.
Arcs
13 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Arcs (cont.)
Arcs
USER
LIST ITEM
LIST
is referred to
referring
to
container of
is
referred
to
referring
to
contained in
14 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Arcs (cont.)
Examine the following example.
Arcs
15 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Arcs, Supertypes, and Subtypes
Arcs can sometimes be drawn
as supertypes or subtypes.
Arcs
EVENT
# id
* cost
* name
* date
o description
VENUE
# id
* address
o comments
PRIVATE HOME
o accessibility
feature?

PUBLIC SPACE
* rental fee
held at
the venue for
16 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Arcs, Supertypes, and Subtypes (cont.)
Supertypes and subtypes can
sometimes be drawn as arcs.
The supertype PARTNER in
the DJ model is represented
as an arc in this diagram.

Arcs
17 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Terminology
Key terms used in this lesson included:
Arc
Constraint
Exclusive OR relationship
Mutually exclusive relationship


Arcs

18 Copyright 2013, Oracle and/or its affiliates. All rights
reserved.
Summary
In this lesson, you should have learned how to:
Define the term "constraint" as it applies to data
modeling
Identify an exclusive OR relationship in a business
scenario
Diagram an arc constraint to represent an exclusive OR
relationship
Distinguish between the use of an arc and a subtype in
the data model


Arcs

You might also like