Developing A Database Appucation For Pine Valley
Developing A Database Appucation For Pine Valley
Pine Valley Furniture Company was introduced earlier in this chapter. By the late 1990s,
competition in furniture manufacturing had intensified, and competitors seemed to respond
more rapidly than Pine Valley Furniture to new business opportunities. While there were
many reasons for this trend, managers believed that the computer information systems they
had been using (based on traditional file processing) had become outdated. After attending
an executive development session led by Fred McFadden and Jeff Hoffer (we wish!), the
company started a development effort that eventually led to adopting a database approach
for the company. Data previously stored in separate files have been integrated into a single
database structure. Also, the metadata that describe these data reside in the same structure.
The DBMS provides the interface between the various database applications for
organizational users and the database (or databases). The DBMS allows users to share the
data and to query, access, and update the stored data.
To facilitate the sharing of data and information, Pine Valley Furniture Company uses a local
area network (LAN) that links employee workstations in the various departments to a
database server, as shown in Figure 1-13. During the early 2000s, the company mounted a
two-phase effort to introduce Internet technology. First, to improve intracompany
communication and decision making, an intranet was installed that allows employees fast
Web-based access to company information, including phone directories, furniture design
specifications, e-mail, and so forth. In addition, Pine Valley Furniture Company also added a
Web interface to some of its business applications, such as order entry, so that more internal
business activities that require access to data in the database server could also be conducted
by employees through its intranet. However, most applications that use the database server
still do not have a Web interface and require that the application itself be stored on
employees' workstations.
1
Because Pine Valley Furniture has been careful in the development of its systems, especially
since adopting the database approach, the company already has databases that support its
operational business functions. Thus, it is likely that Chris will be able to extract the data
Helen needs from existing databases. Pine Valley's information systems architecture calls for
systems such as the one Helen is requesting to be built as stand-alone databases so that the
unstructured and unpredictable use of data will not interfere with the access to the
operational databases needed to support efficient transaction processing systems.
Further, because Helen's needs are for data analysis, not creation and maintenance, and are
personal, not institutional, Chris decides to follow a combination of proto typing and life-cycle
approaches in developing the system Helen has requested. This means that Chris will follow
all the life-cycle steps but focus his energy on the steps that are integral to prototyping. Thus,
he will quickly address project planning and then use an iterative cycle of analysis, design, and
implementation to work closely with Helen to develop a working prototype of the system she
needs. Because the system will be personal and likely will require a database with limited
scope, Chris hopes the prototype will end up being the actual system Helen will use. Chris has
chosen to develop the system using Microsoft Access, Pine Valley's preferred technology for
personal databases.
Project Planning
Chris begins the project by interviewing Helen. Chris asks Helen about her business area,
taking notes about business area objectives, business functions, data entity types, and other
business objects with which she deals. At this point, Chris listens more than he talks so that
he can concentrate on understanding Helen's business area; he interjects questions and
makes sure that Helen does not try to jump ahead to talk about what she thinks she needs
with regards to computer screens and reports from the information system. Chris asks general
questions, using business and marketing terminology as much as possible. For example, Chris
asks Helen what issues she faces managing the home office products; what people, places,
and things arc of interest to her in her job; how far back in time she needs data to go to do
her analyses; and what events occur in the business that are of interest to her. Chris pays
particular attention to Helen's objectives as well as the data entities that she is interested in.
Chris does two quick analyses before talking with Helen again. First, he identifies all of the
databases that contain data associated with the data entities Helen mentioned. From these
databases, Chris makes a list of all of the data attributes from these data entities that he thinks
might be of interest to Helen in her analyses of the home office furniture market. Chris's
previous involvement in projects that developed Pine Valley's standard sales tracking and
forecasting system and cost accounting system helps him speculate on the kinds of data Helen
might want. For example, the objective to exceed sales goals for each product finish category
of office furniture suggests that Helen wants product annual sales goals in her system; also,
the objective of achieving at least an 8 percent annual sales growth means that the prior
year's orders for each product need to be included. He also concludes that Helen's database
must include all products, not just those in the office furniture line, because she wants to
compare her line to others. However, he is able to eliminate many of the data attributes kept
on each data entity. For example, Helen does not appear to need various customer data such
as address, phone number, contact person, store size, and salesperson. Chris does, though,
include a few additional attributes, customer type and zip code, which he believes might be
important in a sales forecasting system.
2
Second, from this list, Chris draws a conceptual data model (Figure 1-14) that represents the
data entities with the associated data attributes, as well as the major relationships among
these data entities. The data model is represented using a notation called the Entity-
Relationship (E-R) model. You will learn more about this notation in Chapters 2 and 3. The
data attributes of each entity Chris thinks Helen wants for the system are listed in Table 1-6.
Chris lists in Table 1-6 only basic data attributes from existing databases, because Helen will
likely want to combine these data in various ways for the analyses she will want to do.
3
thus, she may not yet be positive about what data she wants or what she wants to do with it.
Rather, Chris's objective is to understand a few ways in which Helen intends to use the data
so he can develop an initial prototype, including the database and several computer displays
or reports. The final list of attributes that Helen agrees she needs appears in Table 1-7.
4
rather than p recise knowledge of the way the database will be used. The key physical
database design decision that SQL allows a database designer to make is on which attributes
to create indexes. All primary key attributes (such as OrderNumbcr for the Order_T table)-
those with unique values across the rows of the table-are indexed. In addition to this, Chris
uses a general rule of thumb: Create an index for any attribute that has more than 10 different
values and that Helen might use to segment the database. For example, Helen indicated that
one of the ways she wants to use the database is to look at sales by product finish. Thus, it
might make sense to create an index on the Product_T table using the Product Finish
attribute. However, Pine Valley uses only six product finishes, or types of wood, so this is not
a useful index candidate. On the other hand, OrderPlacementDate (called a secondary key
because there may be more than one row in the Order_T table with the same value of this
attribute), which Helen also wants to use to analyze sales in different time periods, is a good
index candidate.
5
forms, and reports Chris wrote were of use to her; and that she knew how to write queries
for unanticipated questions. Chris will be available to Helen at any time to provide consulting
support when she has trouble with the system, including writing more complex queries,
forms, or reports. One final decision that Chris and Helen made was that the performance of
the final prototype was efficient enough that the prototype did not have to be rewritten or
redesigned. Helen was now ready to use the system.
6
high-levelE-R diagram with only the major entities and relationships and with a limited set of
attributes (such as just the entity identifiers). With a bottom-up approach, the designer
proceeds from detailed discussions with users, and from a detailed study of documents,
screens, and other data sources. This approach is necessary for developing a detailed, "fully
attributed" E-R diagram.
In this section, we develop a high-level ERD for Pine Valley Furniture Company, based largely
on the first of these approaches (see Figure 2-22 for a Microsoft Visio version). For simplicity,
we do not show any composite or multi valued attributes (e.g., skill is shown as a separate
entity type associated with EMPLOYEE via an associative entity, which allows an employee to
have many skills and a skill to be held by many employees).
Figure 2-22 provides many examples of common E-R modeling notations, and hence, it can
be used as an excellent review of what you have learned in this chapter. In a moment, we will
explain the business rules that are represented in this figure. However, before you read that
explanation, one way to use Figure 2-22 is to search for typical E-R model constructs in it, such
as one-to-many, binary, or unary relationships. Then, ask yourself why the business data was
modeled this way.
For example, ask yourself
• Where is a unary relationship, what does it mean, and for what reasons might the
cardinalities on it be different in other organizations?
• Why is Includes a one-to many relationship, and why might this ever be different in some
other organization?
• Does Includes allow for a product to be represented in the database before it is assigned to
a product line (e.g., while the product is in research and development)?
• If there were a different customer contact person for each sales territory in which a
customer did business, where in the data model would we place this person's name?
• What is the meaning of the Does Business In associative entity, and why does each Does
Business In instance have to be associated with exactly one SALES TERRITORY and one
CUSTOMER?
• In what way might Pine Valley change the way it does business that would cause the Supplies
associative entity to be eliminated and the relationships around it to change?
Each of these questions is included in Problem and Exercise 3 at the end of the chapter, but
we suggest you use these now as a way to review your understanding of E-R diagramming.
From a study of the business processes at Pine Valley Furniture Company, we have identified
the following entity types.
An identifier is also suggested for each entity, together with selected important attributes:
• The company sells a number of different furniture products. These products are grouped
into several product lines. The identifier for a product is Product ID, whereas the identifier for
a product line is Product Line ID. We identify the following additional attributes for product:
Product Description, Product Finish, and Product Standard Price. Another attribute for
product line is Product Line Name. A product line may group any number of products bt.lt
must group at least one product. Each product must belong to exactly one product line.
7
• Customers submit orders for products. The identifier for an order is Order 10, and another
attribute is Order Date. A customer may submit any number of orders but need not submit
any orders. Each order is submitted by exactly one customer. The identifier for a customer is
Customer 10. Other attributes include Customer Name, Customer Address, and Customer
Postal Code.
• A given customer order must request at least one product and only one product per order
Line item. Any product sold by Pine Valley Furniture may not appear on any order line item
or may appear on one or more order line items. An attribute associated with each order line
item is Ordered Quantity.
• Pine Valley Furniture has established sales territories for its customers. Each customer may
do business in any number of these sales territories or may not do business in any territory.
A sales territory has one to many customers. The identifier for a sales territory is Territory ID
and an attribute is Territory Name.
• Pine Valley Furniture Company has several salespersons. The identifier for a salesperson is
Salesperson ID. Other attributes include Salesperson Name, Salesperson Telephone, and
Salesperson Fax. A salesperson serves exactly one sales territory. Each sales territory is served
by one or more salespersons.
• Each product is assembled from a specified quantity of one or more raw materials. The
identifier for the raw material entity is Material ID. Other attributes include Unit Of Measure,
Material Name, and Material Standard Cost. Each raw material is assembled into one or more
products, using a specified quantity of the raw material for each product.
• Raw materials are supplied by vendors. The identifier for a vendor is Vendor 10. Other
attributes include Vendor Name and Vendor Address. Each raw material can be supplied by
one or more vendors. A vendor may supply any number of raw materials or may not supply
any raw materials to Pine Valley Furniture. Supply Unit Price is the unit price at which a
particular vendor supplies a particular raw material.
• Pine Valley Furniture has established a number of work centers. The identifier for a work
center is Work Center 10. Another attribute is Work Center Location. Each product is
produced in one or more work centers. A work center may be used to produce any number
of products or may not be used to produce any products.
• The company has more than 100 employees. The identifier for employee is Employee ID.
Other attributes include Employee Name, Employee Address, and Skill. An employee may
have more than one skill. Each employee may work in one or more work centers. A work
center must have at least one employee working in that center but may have any number of
employees. A skill may be possessed by more than one employee or possibly no employees.
• Each employee has exactly one supervisor; however, a manager has no supervisor. An
employee who is a supervisor may supervise any number of employees, but not all employees
are supervisors.