Relational Schema of The Library Management System: Isbn, Pages, Duration, Class, Publisher)
Relational Schema of The Library Management System: Isbn, Pages, Duration, Class, Publisher)
Users (uid, name, address, plz, city, country, telephone, email, birthdate)
Mediums (mid, title, description, notes, language, shelfmark, barcode, lendability, pub_date,
isbn, pages, duration, class, publisher)
To derive the abstract class Medium in a relational schema, we have chosen the method C
(create only one relation - for the superclass), which means, that we have added an attribute
“class” to the relation mediums. This attribute can take only the following values: “Book”,
“DVD” and “Magazine”. This follows, that all attributes from the subclasses were moved to
the super class. For that reason attributes that are connected to a specific class cannot be set
for another class type. For example: if the medium is a Book or a Magazine the ISBN number
has to be set and the duration (which is for DVDs) has to be NULL (not set). The number of
pages can be set or not, there is no restriction. If the medium is a DVD the duration has to be
set and the isbn and the number of pages have to be NULL (not set).
The relations Users, Topics, Publishers and Authors are simple relations with the attributes
defined in the ER-diagram. For the many – many relations, like Mediums - Topics and
Mediums - Authors we’ve build a relation with two foreign keys in each case.
For the two relations with a weak entity, Reservations and Lendings, we’ve made a relation
with two foreign keys. The primary key is composed by the discriminator start date and by
the primary key of the identifying weak entity (medium id).