Progress
Results User’s Guide
for UNIX


Database Basics

When setting up a paper filing system, you keep all related information about a subject in a filing cabinet. For example, you might store information about customers in a file cabinet called Customer. Inside this cabinet you would keep data about each individual customer in folders. You might then store all related filing cabinets together in a common area or room.

In Progress, you store data electronically. However, the logic of storage is similar to the paper filing system. You store data about each individual customer in an electronic folder called a record. Then you put all the related records into an electronic filing cabinet called a table. Finally, you put all these tables in a database, which you can think of as an electronic area or room.

For example, if you are running a business called All Around Sports, you might have a sales and inventory database that contains information about your customers, the kinds of products they have ordered, the quantity they have ordered, and your overall product inventory. Figure 1–1 illustrates the relationship of the sales, order, and inventory paper filing system to a database.

Figure 1–1: Paper and Electronic Filing System Comparison

Another way you can think of a database table is to view it as a paper table that you use to organize and present data. A paper table is made up of rows and columns. The intersection of each row and column contains one specific piece of data. Similarly, in a database table, each row contains all the individual pieces of information about one member. A row in the database table is called a record. In the paper filing system, each folder in a filing cabinet contains the equivalent of a row or record. For example, the Customer filing cabinet contains one folder on Second Skin Scuba and another for Off the Wall Sports. When All Around Sports creates its database, the Customer table will contain one record for Second Skin Scuba and another for Off the Wall Sports.

In a database table, each discrete piece of information also represents the intersection of a row and column and is called a field. In addition to the data, each field in a record includes a descriptive name, just like the column heading in a paper table. For example, the customer’s name is one piece of information, and that information is stored in a field labeled Name in a record. Each record in the Customer table has a Name field.

Figure 1–2 illustrates the structure of a database.

Figure 1–2: Structure of a Database

The last component of an electronic filing system is called an index. When you open the drawer of a filing cabinet and thumb through the tabs on the folders, you’re using a kind of index. What’s on the paper tab represents the information found in the folder. For example, you’d expect the tabs in the customer filing cabinet to contain the name of the customer whose information is in that folder. Similarly, an electronic index is a component defined for a specific database table that serves as the basis for faster searching, sorting, or otherwise processing the records in that table.

In a database, an index is a list that contains a value for each record in the table. When you define an index, you choose the field or fields used to derive the index value for each record. For example, if you choose the Name field as an index, then Progress creates an index for the Customer table that consists of a list of customer names, just like the list of tabs in the paper filing system.

A simple index is based on the value of one field, while a compound index is based on two or more fields. Figure 1–3 shows an example of a simple and a compound index.

Figure 1–3: Simple and Compound Indexes

You can define several indexes per table but you can define only one primary index for a table. For information on defining indexes, see the Progress Language Tutorial for Character.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095