Page 185 - DCAP312_WEB_TECHNOLOGIES_II
P. 185
Unit 9: The Database Model
9.3.3 Relationships Notes
The network data model expresses relationships between two record types by designating one
as the owner record type and the other as the member record type. For each occurrence of an
owner record type, there are one or more occurrences of the member record type. The owner
record type may be reckoned as the parent and the member record type as the child. In a sense,
the owner record type “owns” the corresponding member record type. Each member type with
its corresponding owner record type is known as a set. A set represents the relationship between
an owner and a member record type.
9.3.4 Multiple Parents
Look at the ORDER member record type. For ORDER there are two parents or owner records,
namely, CUSTOMER and PAYMENT. In other words, for one occurrence of CUSTOMER, one
or more occurrences of ORDER exist. Similarly, for one occurrence of PAYMENT there are one
or more occurrences of ORDER. By definition, a hierarchical data model cannot represent this
kind of data arrangement with two parents for one child data structure.
9.3.5 Physical Pointers
Just as in the case of the hierarchical data model, related occurrences of two different record
types in a network model are connected by physical pointers or physical storage addresses
embedded within physical record in the database. Physical pointers link occurrences of an owner
record type with the corresponding occurrences of the member record type. Within each record
type itself the individual occurrences may be linked to one another by means of forward and
backward pointers.
9.4 Relational Database Model
This data model is greater to the earlier models. This stage, though, we want to begin the
relational model as a greater data model that addresses the confines of the earlier data model.
The earlier hierarchical data model is appropriate for data structures that are naturally
hierarchical, with each data structure placed at a certain level in the ladder. However, in the
business arena, many of the data structures and their relationships cannot be readily placed
in a hierarchical arrangement. The network data model evolved to dispense with the arbitrary
restriction of the hierarchical model. Nevertheless, in both of these models, you need physical
pointers to connect related data occurrences. This is a serious drawback because you have
rewrite the physical addresses in the data records every time you reorganize the data, move
the data to a different storage area, or change over to another storage medium. The relational
model establishes the connections between related data occurrences by means of logical links
implemented through foreign keys. Figure 9.3 illustrates the relational data model.
Let us note the key features of the relational data model by referring to Figure 9.3
9.4.1 Levels
Just like the network data model, no hierarchical levels are present in the relational model. The
lines in a relational data model simply indicate the relationships between the appropriate data
structures wherever necessary without the restriction of connecting only successive levels as
in the hierarchical model. As in the network model, note the lines connecting the various data
structures with no restrictions.
9.4.2 Relations or Tables
The relational model consists of relations. A relation is a two-dimensional table of data observing
relational rules. For example, the CUSTOMER relation represents the data content of all customers.
The ORDER relation represents the data content of all orders.
LOVELY PROFESSIONAL UNIVERSITY 179