LIS 558 - Example of relation generation
from ER type diagrams
Suppose we have the following ER diagram:
Since neither of the exception conditions is met,
there must be a relation for each relationship:
Since the Borrow relationship is many-to-one,
the primary key in the BORROW relation
the entity key on the many side.
Since the Request relationship is many-to-many,
the primary key in the REQUEST relation
is a composite of the two entity keys
BooNo and PatNo.
- BORROW (BooNo, PatNo, [DueDate, etc.])
- REQUEST (BooNo, PatNo, [etc.])
Since the exception condition for entity classes is not met,
there must also be a relation for each entity class:
In each case,
the entity key becomes the primary key of the relation.
- BOOK (BooNo, [Title, etc.])
- PATRON (PatNo, [LastName, FirstName, etc.])
Last updated July 5, 2001.
This page maintained by
Prof. Tim Craven
E-mail (text/plain only): email@example.com
Faculty of Information and
University of Western
Canada, N6A 5B7