Database Reference
In-Depth Information
Let us examine another example: Suppose that you were hired at a large marketing
company that needs to keep track of its sales of various products and product lines over
time. Suppose further that the company operates out of various offices strategically
located across the country and/or around the world. How would you construct a database
conceptual schema that would allow the company to effectively track its sales? One way to
solve this problem is to employ what is called a
star schema
— a central relation (or object
type) is connected to two or more relations (or object types) by forming a M:1 relationship
with each. Figure
5-11
illustrates such a schema for the marketing company. The central
relation (often referred to as the
fact table
) is
SalesSummary
. The surrounding relations
(often referred to as
dimensional tables
) are
Location
,
TimePeriod
,
ProductLine
, and
Product
. Each forms a 1:M relationship with
SaleSummary,
the central relation. Notice
that consistent with the theory,
SalesSummary
has a foreign key that references each of
the referenced relations (object types). Finally, observe also that in this illustration, the
attributes for each relation (object type) have been included in the diagram.
Figure 5-11.
UML Diagram for Tracking Sales Summary for a Large Marketing Company