Once you have figured out how to organize the data, your next big decision is to determine the number of databases you should use. We settled on four databases in the Sales application; they are customers, products, orders, and categories.
The customer database contains the information about the customers. Each customer record contains five items:
A unique customer code assigned at corporate headquarters. If a new customer is created on the handheld, it is assigned a temporary negative customer ID. Corporate headquarters is responsible for assigning a permanent ID after a HotSync.
The order in the database is the order in which they are displayed in the list. New customers are added at the beginning. There are at least two possible ways to reasonably organize the customer database—alphabetically or by visit order (the first name is the first customer the salesperson visits, the second name is the second visit, and so on).
The product database contains information about each of the toys that can be ordered by the customer. Each product record contains:
An integer. This is assigned by corporate headquarters.
A number. This is a cent amount that we can store as an integer rather than as a floating point number.
A number. The value is from 0 to 15 and is stored as an index into the category database.
Instead of storing the category number ...