This example is one of the set of applications SQL-AG is desired for. As mentioned in Chapter 1, data cubes are applications in which the aggregates are computed along several dimensions and multiple granularities. In this example the data used was sorted along the time dimension and the aggregate computes the total sales by Day, Month, Season and Year. After using SQL-AG a stored PL/SQL procedure named datacube is created. An example call to the procedure along with the output follows.