Theory: Database FundamentalsBy Mark Lester What is a database? Most of today's application programs are required to perform some sort of file I/O operations and in most cases, the compiler system provides the developer with the basic functions to perform general file I/O. However, many cases will arise when the developer will need to use a database within the application to permit storage and retrieval of complex data. For those who may be unfamiliar with databases, think of a filing cabinet filled with folders of invoices ordered alphabetically by company name. If we wish to transfer this information into our computer database we have two choices for data file I/O: a simple sequential file or a random access file. Sequential Access Data Files The concept of using a sequential file to store invoice data by company name is very simple. Just enter the data as it is found in the filing cabinet. To access the information, begin reading at the start of the file and continue until finished. With this method, the time required to find a specific record greatly increases as more and more records are added to the data file. Also, the act of adding information while trying to keep the file in alphabetical order becomes very time consuming since many existing records will have to be moved in order to make room for the new record. Random Access Data Files Random access techniques allow easier access to any particular data record. To find a data record, all that is required is the desired record number. You can then seek to the proper location within the data file and retrieve the desired record. Indexed Access But how does the program know which record number to use? And what about adding records in the middle of the data file? How can the program update or append records to the database file and still maintain a particular record order? These problems are easily solved by the use of a Database Management System (DBMS) such as xBase. xBASE Data Files (Tables)xBASE is a generic description for a Database Management System such as dBASE III+, dBASE IV, dBASE 5, Clipper, FoxBase, FoxPro 1, FoxPro 2, FoxPro 3, Visual FoxPro, or other compatible systems. xBASE databases provide the means to organize and retrieve information in a fast, random access manner. Memos xBase systems also provide a separate memo files which contain variable length fields. Only the memo 'record' number is stored in the memo field of the database record. Each memo file has a file header and each memo record has a record header. Did you find this article useful? Please tell us. Back to Theory page. |
|