Information Technology Reference
In-Depth Information
then would collect all attributes and temporarily output them in a denormal-
ized table. Due to the fact that not each object must be present in all of the
tables an outer join is needed. An example for such a join query that generates
transactions for the vehicles produced in the year 2002 from the tables vehicles
and special equipment is given in Figure 5, where the tables from Table 3 and
select
VehicleId, ModelType, EngineType, SpecialEquipment
from
vehicles outer join special equipment on
vehicles.VehicleId = special equipment.VehicleId
where
year(vehicles.ProductionDate) = 2002
order by
vehicles.VehicleId
Fig. 5. Example query
Table 4 are joined. Exemplarily the resulting temporary table is shown in Ta-
ble 5. Of course this table contains a lot of redundant information. Fortunately
this denormalized table is temporary and we need read access only.
Table 5. Example for a temporal denormalized table
VehicleId ModelType EngineType SpecialEquipment ...
.
.
.
.
.
v1
W202
D
AirConditioning ...
v1
W202
D
2ndAirbag
...
v1
W202
D
BatteryTypeC ...
v2
W202
P
Clutch
...
v2
W202
P
RadioTypeE
...
v3
W220
P
[NULL]
...
v4
W220
D
AirConditioning ...
v4
W220
D
BatteryTypeC ...
v5
W220
D
AirConditioning ...
v5
W220
D
Clutch
...
v5
W220
D
BatteryTypeC ...
.
.
.
.
.
By sorting on VehicleId we ensure that each vehicle is described by consec-
utive rows. To derive the desired transactions we simply pass through all rows.
Whenever the key VehicleId changes e knowthat a newtransaction starts.
Otherwise we add all attributes of the row under investigation to the current
 
Search WWH ::




Custom Search