Module 3
Module 3
CS 5200
• A book has a unique ISBN number, a title and one or more authors. The library service may own several
copies of a given book, each of which is located in one of the service’s libraries. A given library contains
many books, and in order to distinguish different copies of the same book a library assigns a different copy-
number to each of its copies of a given book; the price that was paid for each copy is also recorded. Every
library has a unique name and is either a main library or a branch library. A main library may have zero
or more branch libraries and every branch library is a branch of exactly one main library. A borrower has
a name and a unique ID code. A borrower can have many books on loan, but each copy of a book can only be
on loan to one borrower. A borrower could borrow the same book on several occasions, but it is assumed that
each such loan will take place on a different date.
• A special null value is used to represent values that are unknown or not
available or inapplicable in certain tuples.
103
Mapping EER Model Constructs to Relations
• Step8: Options for Mapping Specialization or Generalization.
• Convert each specialization with m subclasses {S1, S2,….,Sm} and
generalized superclass C, where the attributes of C are {k,a1,…an} and
k is the (primary) key, into relational schemas using one of the four
following options:
• Option 8A: Multiple relations-Superclass and subclasses
• Option 8B: Multiple relations-Subclass relations only
• Option 8C: Single relation with one type attribute
• Option 8D: Single relation with multiple type attributes
FIGURE 9.8
An ER schema for a
SHIP_TRACKING
database.
FIGURE 9.9
EER diagram for a
car dealer
129
[Optional Assignments]
• WATCH: WATCH: Defining a Relational Schema
• https://northeastern.hosted.panopto.com/Panopto/Pages/Viewer.aspx?i
d=55c2e37d-db99-40e4-9d82-abed011f6e5e&start=0
• WATCH: The Relational Model
• https://northeastern.hosted.panopto.com/Panopto/Pages/Viewer.aspx?i
d=2a9ea958-34af-4f7a-87a4-abe900fd79e7&start=0
130