Database Reference
In-Depth Information
mapping of a total and overlapping generalization. Referential integrity
does not fully capture the semantics. It must be ensured, among other
conditions, that when deleting an element from T , this element is also
deleted from T 1 and T 2 (since it can exist in both tables). Such constraints
are typically implemented with triggers.
Applying these mapping rules to the ER schema given in Fig. 2.1 yields
the relational schema shown in Fig. 2.4 . Note that the above rules apply in
the general case; however, other mappings are possible. For example, binary
one-to-one and one-to-many relationships may be represented by a table of
its own, using Rule 5. The choice between alternative representation depends
on the characteristics of the particular application at hand.
It must be noted that there is a significant difference in expressive
power between the ER model and the relational model. This difference
may be explained by the fact that the ER model is a conceptual model
aimed at expressing concepts as closely as possible to the users' perspective,
whereas the relational model is a logical model targeted toward particular
implementation platforms. Several ER concepts do not have a correspondence
in the relational model, and thus they must be expressed using only the
available concepts in the model, that is, relations, attributes, and the related
constraints. This translation implies a semantic loss in the sense that data
invalid in an ER schema are allowed in the corresponding relational schema,
unless the latter is supplemented by additional constraints. Many of such
constraints must be manually coded by the user using mechanisms such as
triggers or stored procedures. Furthermore, from a user's perspective, the
relational schema is much less readable than the corresponding ER schema.
This is crucial when one is considering schemas with hundreds of entity or
relationship types and thousands of attributes. This is not a surprise, since
this was the reason for devising conceptual models back in the 1970s, that is,
the aim was to better understand the semantics of large relational schemas.
2.4.2 Normalization
When considering a relational schema, we must determine whether or not
the relations in the schema have potential redundancies and thus may induce
anomalies in the presence of insertions, updates, and deletions.
For example, assume that in relation OrderDetails in Fig. 2.7 a, each
product, no matter the order, is associated with a discount percentage. Here,
the discount information for a product p will be repeated for all orders in
which p appears. Thus, this information will be redundant. Just associating
once the product and the discount would be enough to convey the same
information.
Search WWH ::




Custom Search