Datasheet

SQL and Relational Database Management Systems 1
FIGURE 1-3
Network database example
ORDER HEADER
PRODUCTSALESMANCUSTOMER
In addition to the ability to handle a one-to-many relationship, the network database can handle
many-to-many relationships.
One-to-one, one-to-many, and many-to-many relationships are explained in Chapter 2,
‘‘Fundamental SQL Concepts and Principles.’’
Also, data access does not have to begin with the root. Instead, you could traverse the database
structure starting from any data element and navigating to a related data element in any direct-
ion assuming there are explicit links in both directions (see Figure 1-3).
In this example, to find out what products were sold to what customers, you still would have to
start with
ORDER HEADER and then proceed to CUSTOMER and PRODUCT nothing new here.
But things greatly improve for the scenario when customers place an order through more than
one agent: you no longer have to go through agents to list customers of the specific product,
and you no longer have to start at the root in search of records.
While providing several advantages, network databases share several problems with hierarchi-
cal databases. Both are very inflexible, and changes in the structure (for example, adding a new
table to reflect changed business logic) may require that the entire database be rebuilt. Also, set
relationships and record structures must be predefined.
The major disadvantage of both network and hierarchical databases was that they are program-
mers’ domains. To answer the simplest query, one had to create a program that navigated
database structure and produced an output. Unlike SQL, this program was written in procedu-
ral, often proprietary, languages and required a great deal of knowledge of both database
structure and underlying operating system. As a result, such programs were not portable and
took an enormous (by today’s standards) amount of time to write.
Relational Databases
The frustration with the inadequate capabilities of network and hierarchical databases resulted
in the invention of the relational data model. The relational data model took the idea of the
network database several steps further. Relational models just like hierarchical and network
models are based on two-dimensional storage areas (tables) that can be related based on a
common field (or a set of fields). However, these relationships are implemented through column
values as opposed to a low-level physical pointer defining the relationship.
15