A simple database such as one that is used to create a personal phone directory can be created without considering the size of the database or its structure. To set up a database for use in a business application, however, a developer should follow the steps outlined in this section. It is essential that careful thought be given to database design.
The design should accomplish three objectives:
Organize data generated by a business so that it can be easily accessed and manipulated.
Establish relationships among all the pieces of data.
Determine what information is useful for display in reports.
Before structuring the database, consider these points:
Decide what output must be produced for reports.
Determine what data elements exist and their names and relationships.
The flexibility exists to change the database after it has been set up, but the user should establish the structure of the database before actually creating it. The most important thing is to establish the sequence of attributes, values, and subvalues in a data file item. It is cumbersome and time-consuming to change these relationships once they have been defined.
Use the following checklist to design a database:
Decide how many files are needed and assign each one a unique name.
Identify what set of data constitutes an item (record) in each file.
Identify one piece of data that is unique for each item and can be used as the item-ID or key.
Define the data file item as a sequence of attributes (fields).
Assign a name that is unique and descriptive to each attribute. Determine if a more descriptive name is required for identification in reports.
Determine the maximum column width needed to display each attribute in an INFO/ACCESS report, and decide whether data should be left- or right-justified in this column.
Most of these decisions are reflected in the dictionary’s Attribute Definition items.
The CUSTOMERS File
In this section we are going to look at another sample file, the CUSTOMERS file, that contains the names and addresses of customers for a mail-order business.
For each customer, we store the person’s first and last names, street address, city, state, zip and the person’s phone number. Each of these pieces of data is stored in an attribute of a data file item that is unique to the customer.
See Also