Professional Documents
Culture Documents
Comp11013 Technologies For Business Intelligence: Coursework # 2
Comp11013 Technologies For Business Intelligence: Coursework # 2
Comp11013 Technologies For Business Intelligence: Coursework # 2
INTELLIGENCE
Coursework # 2
DimReturns is the Returns Dimension which shows the list of Returned Items in the Global
Region they are from with Order ID as the Surrogate Key
DimPeople is the Returns Dimension which shows the list of Persons in the Global Region
with Region as the Surrogate Key
DimCustomer is the Customer Dimension which lists the Customers in the Global Superstore
and uses Customer ID as the Surrogate Key
DimProduct is the Product Dimension that lists the Products in the Global Superstore and
uses Product ID as the Surrogate Key
DimOrder is the Order Dimension that lists the Orders in the Global Superstore and the
Order Date and uses Order ID as the Surrogate key
FactTable is the Table that stores the history of Transactions in the Global Superstore and
uses Row ID as the Surrogate Key
2. The relational schema for your Global Sales data mart including PKs, FKs, and ad-hoc
constraints
DimOrder {Order ID, Order Date}
Primary key: Order ID
DimCustomer {Customer ID, Customer Name, Segment}
Primary key: Customer ID
DimProduct {Product ID, Product Name, Category, SubCategory}
Primary key: Product ID
DimReturns {Order ID, Returned, Region}
Primary key: Order ID
Foreign key: Order ID references DimOrder (Order ID)
ALTER TABLE DimReturns
ADD CONSTRAINT FK_ReturnsORder
FOREIGN KEY (Order ID) REFERENCES DimOrder (Order
ID);
6. A screenshot of the content of the fact table and one of the dimensional tables in your
Global Sales data mart
Fact Table
Dimension Table
7. The SQL statements for the OLAP queries specified above and a screenshot for the result
of each of the queries
CUBE
Basically, this query computes the union of 2² = 4 groupings of the FactTable being:
{(CustomerID,Discount), (CustomerID), (Discount), ()}, where () denotes an empty group
list representing the total aggregate across the entire FactTable
DICING
The sample query selects conditions on the ProductID and SUM of the SALES as
TotalSalesForSameDayShipModeinBangkok column WHERE the City Name is Bangkok
and Ship Mode is ’Same Day‘ aggregates them using the ProductID
RANKING
This query returns the rank of each row within the partition of a result set(Sales Column)
where the city is ‘Bangkok’. The rank of a row is one plus the number of ranks that come
before the row in question. The result set is Ordered by ProductID
ROLLUP
This query generates the union of three groupings {(CustomerID,Discount), (CustomerID),
()}, where () again represents the full aggregation
SLICING
The sample query selects conditions on the ProductID and SUM of the SALES column WHERE
the City Name is ‘Mexico City’ and aggregates them using the ProductID
WINDOWING
The example above selects the RowID, ProductID, CustomerID, City, Sales, namely it
aggregates the data for each city and shows the sum of the total sales for each of them