dat5 project proposal, autumm 2004
Intervals are often used in modeling spatial data. As an example consider a table that stores the pavement type on roads in Denmark. Using the relational model this can be model with the table shown below where the id column is the primary key of the table, the road_id column is the logical id for the road, the pavement_type is the type of pavement on a part (or interval) of the road, the from column is the number of meters from the start of the road where a new part of the road starts, and similar the to column is the number of meters from the start of the road where a road part ends.
Here we only show data for a single road identified by road_id = 1. The road is split into five parts (or intervals). This data modeling only uses the features of the relational data model and does not take advantages of the object-relational features available in DBMSs such as Oracle 10g, PostgreSQL 7.4, and IBM DB2 8.1. In these object-relational DBMSs the table above can be remodeled using either a nested table or a user-defined abstract data type (ADT). The latter is similar to a class in object-oriented programming languages such as Java or C#.
If we try to remodel the previous example using nested tables it could look as follows.
As can be seen from the remodeled table there are now only three columns and the distance column is it self a table (a nested table). A different way to remodel the orginal table would be to use an ADT. In this case the remodeled table would look as follows.
|1||B||MyADT(100, 150, 250, 300)|
Here MyADT represents some internal representation of an ADT.
Having introduced the three ways interval can be modeled using an object-relational DBMS the goal of the project could be the following.