Database Reference
In-Depth Information
ROUTES
INFO FLIGHT
SERVES
f#
src
dest
f#
dep
arr
airl
airl
city
coun phone
src
dest
airl
dep
city
coun
pop
FLIGHT
GEO
Figure 1.1 Schema mapping: a simple graphical representation
INFO FLIGHT(flight#,departure time,arrival time,airline)
This relation provides additional information about the flight: departure and arrival
times, as well as the name of an airline.
SERVES(airline,city,country,phone)
This relation has information about cities served by airlines: for example, it may have
atuple( AirFrance , Santiago , Chile , 5550000 ), indicating that Air France serves Santi-
ago, Chile, and its office there can be reached at 555-0000.
We do not start from scratch: there is a source database available from which we can
transfer information. This source database has two relations:
FLIGHT(source,destination,airline,departure)
This relation contains information about flights, although not all the information
needed in the target. We only have source, destination, and airline (but no flight number),
and departure time (but no arrival time).
GEO(city,country,population)
This relation has some basic geographical information: cities, countries where they
are located, and their population.
As the first step of moving the data from the source database into our target, we have to
specify a schema mapping , a set of relationships between the two schemas. We can start
with a simple graphical representation of such a mapping shown in Figure 1.1 . The arrows
in such a graphical representation show the relationship between attributes in different
schemas.
But simple connections between attributes are not enough. For example, when we create
records in ROUTES and INFO FLIGHT based on a record in FLIGHT , we need to ensure that
the values of the flight# attribute (abbreviated as f# in the figure) are the same. This is
indicated by a curved line connecting these attributes. Likewise, when we populate table
SERVES , we only want to include cities which appear in table FLIGHT - this is indicated by
the line connecting attributes in tables GEO and FLIGHT .
Search WWH ::




Custom Search