Chapter 10B – Managing Databases with Oracle Database
Page 10B-80
D Explain how you will enforce the minimum cardinalities in your answer to part C.
Use referential integrity actions for required parents, if any. Use Figure 6-29(b) as a
boilerplate for required children, if any.
All the minimum cardinalities are M-O. This means that almost all referential integrity actions
The relationship between CUSTOMER and INVOICE is a strong non-identifying relationship.
Further, CUSTOMER has a surrogate primary key. In such an M-O relationship, we can create a
CUSTOMER with no INVOICEs, so the “O” portion requires us to do nothing. The “M” portion
requires that the foreign key field in INVOICE be declared NOT NULL. Since CUSTOMER has
a surrogate primary key, we do not have to worry about updates to the primary key (they will be
disallowed by Oracle if any INVOICEs reference them). We can choose ON DELETE
CASCADE, if we wish, to remove INVOICEs for deleted CUSTOMERs.
The relationship between SERVICE and INVOICE_ITEM is a strong non-identifying
relationship. SERVICE does not have a surrogate primary key. In such an “M–O” relationship,
we can create a SERVICE with no INVOICE_ITEMs, so the “O” portions requires no action on
our part. The “M” portion requires that the foreign key in SERVICE be declared NOT NULL.
Here, however, we may want to be able to update the non-surrogate primary key of SERVICE,
but we do not want to delete records in INVOICE_ITEM if we delete a corresponding record in
SERVICE. Therefore, we implement, if the MDC users want it, only ON UPDATE CASCADE
(implemented in Oracle via a trigger), and we do not specify ON DELETE CASCADE.
E In the SQL Developer folder structure in your My Documents folder, create a
folder named DBP-e15-MDC-Database in the Projects folder. Use this folder to save and
store *.sql scripts containing the SQL statements that you are asked to create in the
remaining questions in this section.
F Using the examples in this chapter as a template: