C H A P T E R 7
E
n
t
i
t
y
R
e
l
a
t
i
o
n
s
h
i
p
M
o
d
e
l
E
x
e
r
c
i
s
e
s
7.1 Suppose we examine an instance of a relation R(A,B,C) and observe that there
7.2 Consider an entity set with candidate key K1 and a super key K2 where K2 is
not a candidate key. Is it possible that K1 has more attributes than K2 ? Why or
why not ?
7.3 What is wrong with an ER diagram which has an entity
d
e
p
a
r
t
m
e
n
t
with primary
key
d
e
p
t
i
d
,
and an entity
e
m
p
l
o
y
ee
,
one of whose attributes is
d
e
p
t
i
d
.
. .
.3
7.4 Consider a system to store the marks of students on various exams, for several
courses.
7.5 Show how to express a ternary relationship R between entity sets A, B and C
as
7.6 What is the difference between disjoint and overlapping
generalization?
. . .2
7.7 Give a meaningful example of the need for role indicators in ER diagrams.
16 Chapter 7 Entity-Relationship Model
7.8 Describe how to represent a ternary relationship between entity sets A, B and
C using binary relationships with a new strong entity set E. Give constraints
on the ER diagram to ensure that every relationship represented by the binary
relationships corresponds to exactly one (not less or more) ternary relationship.
. .
.4
7.10 Give examples of (a) a recursive relationship and (b) total participation. (They
can be separate examples and need not be realistic.)
. .
.3
7.11 Draw an ER diagram for a inter-collegiate contest with multiple events, record-
7.12 A weak entity, like course-offering, can always be converted to a strong entity
by adding the primary key of its identifying entity. Why then does it make sense
to use weak entities in ER diagrams.
. .
.2
7.13 Considering the increasing number of accidents on campus, the security section
wishes to automate its accident recording section.
7.14 We wish to develop a tool for drawing and storing ER diagrams. The informa-
tion in the ER diagrams has to be stored in a database. Multiple ER diagrams
may have to be stored.
7.15 Draw an ER diagram for recording cricket players statistics. Specifically, we
want to track: players, matches, matches that a player played in, his perfor-
mance in each innings: batting (scores, balls, how out) and bowling (O,M,R,W).
. .
.7
7.16 You need to help the IITB film society manage its movie voting system.
Exercises
17
of review), (iv) movies proposed to be shown next month, and (v) votes
cast
7.17 Illustrate two ways of converting a
generalization
/
specialization
hierarchy into
a set of tables, and mention (a) under what conditions each can be used, and (b)
the advantages of each of the schemes.
. .
.5
7.18 You are the
CEO
/
CTO
/
Sole-Programmer-Analyst
of ERDiagramsRUS, a lead-
ing ER diagramming company. ShadyNDangerous Tobacco Co has asked you
to come up with an ER model for their organization, including
a. ProductType information (ProductTypeID, name, …)
7.19 Translate the following ER diagram into relational tables, by giving
appropriate
create table clauses, along with all appropriate constraints.
customer-name
customer-street
loan-number
amount
customerid
customer-city