Database Reference
In-Depth Information
The mapping above can also be applied to
ragged hierarchies
since these
hierarchies are a special case of generalized hierarchies. This is illustrated in
Fig.
5.4
where the
City
level has two foreign keys to the
State
and
Country
levels. Nevertheless, since in a ragged hierarchy there is a unique path where
some levels can be skipped, another solution is to embed the attributes of
an optional level in the splitting level. This is illustrated in Fig.
5.4
,where
the level
State
has two optional attributes corresponding to the
Region
level.
Finally, another solution would be to transform the hierarchy at the instance
level by including placeholders in the missing intermediate levels, as it is done
for unbalanced hierarchies in Sect.
5.5.2
. In this way, a ragged hierarchy is
converted into a balanced hierarchy and a star or snowflake structure can be
used for its logical representation.
5.5.4 Alternative Hierarchies
For alternative hierarchies, the traditional mapping to relational tables can
be applied. This is shown in Fig.
5.9
for the conceptual schema in Fig.
4.9
.
Note that even though generalized and alternative hierarchies can be easily
distinguished at the conceptual level (see Figs.
4.6
aand
4.9
), this distinction
cannot be made at the logical level (compare Figs.
5.7
and
5.9
).
FiscalQuarter
FiscalYear
FiscalQuarterKey
FiscalQuarterNo
FiscalYearKey
...
FiscalYearKey
FiscalYearNo
...
Time
Month
TimeKey
Date
MonthKey
...
MonthKey
MonthName
FiscalQuarterKey
CalendarQuarterKey
...
CalendarQuarter
CalendQuarterKey
CalendarQuarterNo
CalendYearKey
...
CalendarYear
CalendYearKey
CalendarYearNo
...
Fig. 5.9
Relations for the alternative hierarchy in Fig.
4.9
5.5.5 Parallel Hierarchies
As parallel hierarchies are composed of several hierarchies, their logical
mapping consists in combining the mappings for the specific types of
hierarchies. For example, Fig.
5.10
shows the result of applying this mapping
to the schema shown in Fig.
4.11
.
Search WWH ::
Custom Search