CS
386/586 Winter
2012
Assignment
4
Due:
Tuesday February 14, 2012 at 4:40PM
NOTE: unless
you have some sort of emergency, this assignment MUST be turned in on time.
You can do this assignment alone or with one partner. If you work with a partner, turn in one paper
with both names.
1. Complete Exercise 2.8 in your
textbook. (You are to draw an ER diagram
for a database about art.)
2. Modify your ER diagram that you
developed for question 1 by choosing an attribute and replacing it with an
entity. Elaborate your diagram to
include additional descriptive attributes and new relationships for your new
entity.
3. Complete Exercise 3.18 in your
textbook. (You are to convert the above
ER diagram into SQL statements to define the schema.)
Be sure to enforce constraints (e.g., cardinality constraints) using key,
foreign key, and NOT NULL clauses when possible.
Choose one constraint (or define a new constraint) that cannot be expressed
using key, foreign key, or NOT NULL constraints and define one or more CHECK
conditions – possibly with associated triggers – that could be used to enforce
the constraint. Explain briefly how the
enforcement would work.