Progress
Language Tutorial
for Windows


Database Basics

The computer professionals that All Around Sports brings in to evaluate the sales and inventory system take note of how All Around Sports stores its files. All Around Sports keeps each type of file—such as customer information files, order files, and inventory files—in a separate filing cabinet. It also stores all these related filing cabinets together in one room. This strategy of grouping related information is also the basic strategy behind the structure of a database.

A database, which you can think of as an electronic filing system, stores all related information together in a structure called a table. A table is equivalent to a filing cabinet at All Around Sports. A collection of related tables makes up a database. A database is the equivalent of the room of filing cabinets at All Around Sports.

Figure 1–3 illustrates the relationship of the sales and inventory paper filing system to a database.

Figure 1–3: Relationship of Paper and Electronic Filing Systems

A database table is similar to a data table you might create with graph paper. A paper table consists of rows and columns. The intersection of each row and column contains one specific piece of data. In a database table, each row contains all the individual pieces of information about one member. A database row 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 for 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 telephone number is one piece of information, and that information is stored in a field named Phone. Each record in the Customer table has a Phone field. Figure 1–4 illustrates the structure of a database.

Figure 1–4: Structure of a Database

The last component of an electronic filing system is 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 is normally a copy of a piece of 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 that serves as the basis for searching, sorting, or otherwise processing the records in a particular 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, 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–5 shows an example of a simple and a compound index.

Figure 1–5: Simple and Compound Indexes

Depending on your needs, you can define more than one index per table. When you are coding applications, you’ll be able to use indexes for faster processing.


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