Primary key
An attribute whose value is
unique across all occurrences of
a relation.
276 Part IV Systems Design
In this chapter we show how to do each of the logical database design steps
and discuss factors to consider in making each physical file and database design
decision.
Deliverables and Outcomes
During logical database design, you must account for every data element on a
system input or output—form or report—and on the E-R model. Each data ele-
ment (like customer name, product description, or purchase price) must be a
piece of raw data kept in the system’s database, or in the case of a data element
on a system output, the element can be derived from data in the database.
Figure 9-3 illustrates the outcomes from the four-step logical database design
process. Figures 9-3A and 9-3B (step 1) contain two sample system outputs for
a customer order processing system at Pine Valley Furniture. A description of
the associated database requirements, in the form of what we call normalized
relations, is listed below each output diagram. Each relation (think of a relation
as a table with rows and columns) is named, and its attributes (columns) are
listed within parentheses. The primary key attribute—that attribute whose
value is unique across all occurrences of the relation—is indicated by an
underline, and an attribute of a relation that is the primary key of another rela-
tion is indicated by a dashed underline.
In Figure 9-3A data are shown about customers, products, and the customer
orders and associated line items for products. Each of the attributes of each
relation either appears in the display or is needed to link related relations. For
example, because an order is for some customer, an attribute of ORDER is the
associated Customer_ID. The data for the display in Figure 9-3B are more com-
plex. A backlogged product on an order occurs when the amount ordered
(Order_Quantity) is less than the amount shipped (Ship_Quantity) for invoices
associated with an order. The query refers to only a specified time period, so the
Order_Date is needed. The INVOICE Order_Number links invoices with the
associated order.
Figure 9-3C (step 2) shows the result of integrating these two separate sets
of normalized relations. Figure 9-3D (step 3) shows an E-R diagram for a cus-
tomer order processing application that might be developed during concep-
tual data modeling along with equivalent normalized relations. Figure 9-3E
(step 4) shows a set of normalized relations that would result from reconcil-
ing the logical database designs of Figures 9-3C and 9-3D. Normalized
relations like those in Figure 9-3E are the primary deliverable from logical
database design.
Finally, Figure 9-3F shows the E-R diagram drawn in Microsoft Visio. Visio
actually shows the tables and relationships between the tables from the nor-
malized relations. Thus, the associative entities, LINE ITEM and SHIPMENT,
are shown as entities on the Visio diagram; we do not place relationship names
on either side of these entities on the Visio diagram because these represent
associative entities. Visio also shows for these entities the primary keys of the
associated ORDER, INVOICE, and PRODUCT entities. Also, note that the lines
for the Places and Bills relationships are dashed. This Visio notation indicates
that ORDER and INVOICE have their own primary keys that do not include the
primary keys of CUSTOMER and ORDER, respectively (what Visio calls non-
identifying relationships). Because LINE ITEM and SHIPMENT both include in
their primary keys the primary keys of other entities (which is common for
associative entities), the relationships around LINE ITEM and SHIPMENT are
identifying, and hence the relationship lines are solid.
It is important to remember that relations do not correspond to computer
files. In physical database design, you translate the relations from logical data-
base design into specifications for computer files. For most information