ABOUT DATABASE PROGRAMS




INTRODUCTION
This section introduces the structure of an xBASE database. Once you are familiar with the database structure, you are guided though the creation of an actual database that is used in activities contained in the following sections of this book.

THE DATABASE STRUCTURE
The following illustration is what you see when the structure of a database is listed on your screen.
Field    Field Name                 Type                Width              Dec
       1   FNAME                      Character         15
       2   LNAME                      Character         15
       3   DATA                         Date                8
       4   RATE                          Numeric          7                      2
       5   ABSENT                     Logical            1
       6   COMMENTS              Memo              10

Notice that the database has six fields of varying types. Fields 1 and 2 are Character type, 3 is a Date, 4 is Numeric, 5 is Logical, and 6 is a Memo field. The database files have the extension DBF.

The database might contain information similar to that shown in the following table.         

Record                                   FÍME                      LNAME                  DATE                     RATE                      ABSENT                                COMMENTS
1                                              John                       Smith                     10/12/42                               12.50                      .F.                            (Memo)
2                                              Alice                       Garica                    02/21/68                               9.60                        .F.                            (Memo)
3                                              George                   Wong                     06/05/72                               7.75                        .F.                            (Memo)

This table show the first three records (001 through 003). Notice that the appreance of the information matches the designated field types, and that each record corresponds to a different person. This is typical of databases. Usually, a record is about a unique entity such as a customer, business establishment, inventory item, or property.

The contents of each field type must follow certain rules.

Character -  A combination of letters, numbers, space, and/or punctuation marks that are treated as a test string. When a string is used as part of a command, it is enclosed in single quotes, quotation marks, or square brackets (‘text’ “text” [text]. If you wish to use one of these punctuation marks (or delimiters) as part of a string. Enclose the string with one of the other delimiters.

Example: “Enter student’s name.”
If both a single and double quote are used within the text of your prompt string, you can use the bracket delimiter.


Date – An 8-character-wide field having the format mm/dd/yy. This can be modified to other country formats with either SET DATE experession (Section 9) or by using what is called a PICTURE clause (Section 7). The SET CENTURY ON displays the entire year, i.e., mm/dd/yyyy (Section 9). 

0 Komentar untuk "ABOUT DATABASE PROGRAMS"

Back To Top