Information Technology Reference
In-Depth Information
ELSE
FIND FIRSTSUPPLIERWITHINAIX-SUPPLIER
USINGSORTKEY
IF DBMS-STATUSNOT =00000
DISPLAY 'NORECORDINSERTED-
MISSINGOWNER IN SUPPLIER'
ELSE
MOVE SUPPLIER-IDTOAIX-SUPPLIER-ID.
MOVE PART-IDTOAIX-PART-ID.
OBTAIN FIRSTITEM
WITHIN AIX-ITEM USINGSORT KEY.
IF DBMS-STATUS =00000
DISPLAY 'NORECORDINSERTED'
ELSE
STOREITEM
MOVE UNIT-PRICE TO PRICE
DISPLAY'SUPPLIER 'AIX-SUPPLIER-ID
', PART 'AIX-PART-ID
': PRICE'PRICE'INSERTED'.
5.7
Adding a Relational Interface to a Hierarchical
Database
The hierarchical to relational schema mapping is based on key propagation, which
is very similar to the process of normalizing a relational schema. There is a one-to-
one correspondence between segment types and relations. In addition, the key fields
of higher level segment types are propagated to lower level segment types. Because
of database navigation, the user needs to use a parent segment key to access its
child segment. As a result, the parent segment key is concatenated with the child
segment key to identify the child segment. When we map hierarchical schema to
relational schema, the parent segment key will appear in both the parent relation and
the child relation, which leads to the existence of redundant data. For example, the
CUSTOMER# in Fig. 5.5 will appear in both relation Customer and relation Loan
when mapping the left-hand-side hierarchical schema to right-hand-side relational
schema. However, semantically, if CUSTOMER# is not needed to identify the rela-
tion Loan, then the relation Customer and relation Loan are not normalized.
Any hierarchical link is an inherent integrity constraint, which ensures that a
child segment occurrence is connected automatically to a parent segment occur-
rence and may not be removed unless deliberately deleted. Following the database
task group (DBTG—a database committee in 60s and 70s) terminology, the hierar-
chical link is of fixed-automatic type.
Search WWH ::




Custom Search