Databases Reference
In-Depth Information
Figure 2-6
SALES
TERRITORY
CUSTOMER
SALES
PERSON
ORDER
PAYMENT
ORDER
LINE ITEM
Relationship links NOT through
physical pointers, but by foreign keys
Relational database model.
key in the referenced table, or it can also point to a column that has been specif-
ically configured as unique.
For example, the CUSTOMER table represents the data for all customers.
Columns in the CUSTOMER table describe the customer with information such
as the customer ID value, name, address, and so forth. The ORDER table rep-
resents the data content for all orders and the information describing each order.
In the relational model you define relationships between different data elements.
A relationship is an association defined and established between two data entities.
Consider the relationship between CUSTOMER and ORDER. Each customer might
have one or more orders. Each customer occurrence must be connected to all related
order occurrences. In the relational model, a foreign key field (column) is included
in the ORDER data structure to define that relationship. For each customer order
in ORDER, the foreign key identifies the related customer. To look for all the orders
for a particular customer, you search through the foreign key field of ORDER and
find those orders with that customer's ID value in the foreign key field.
The foreign key enforces and maintains the relationship between CUS-
TOMER and ORDER. This replaces the physical pointers used in the hierarchi-
cal and network models. Even though this model does not use physical data
pointers to define relationships, it does still use them. Physical data pointers are
used in many implementations of the relational model to identify where data
rows are physically stored to help optimize data retrieval.
2.2.4 The Object-Oriented Database Model
Object-oriented databases integrate object orientation with database technol-
ogy. Object orientation enables a more precise, truer depiction of real-world
Search WWH ::




Custom Search