With reference to the star schema in Figure 16.3, suppose we wanted to list the
number of units sold in the years 2007 through 2009 for each geographic region and
each item category. As an exercise you might like to formulate the SQL query for this.
You need to perform the natural join of the four tables, group by saleYear, region and
category, and compute sum(qty). An extract of a possible result is shown in Table 16.1,
assuming only two categories (SW = Software, HW = Hardware) and four regions (N
= North, S = South, E = East, W = West). The fact type underlying this table is the
quaternary: Year in Region had sales of items of Category in NrUnits. The full table display of
the result would include 24 rows (8 for each year); only the first 9 rows are shown
here.