Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CCDS - 2 2 1 Data Warehouse 1 | P a g e Lab # 1 0 This Lab has 2 parts. First, you develop
CCDS Data Warehouse
P a g e
Lab #
This Lab has parts. First, you develop SQL SLECT statements for OLAP queries in SQL and then, in
the second part you Visualize OLAP Query results as PivotTable using MSExcel.
Statement purpose
To understand how to developsimulate OLAP queries using SQL statements and generate
PivotTables to visualize results.
Activity Outcomes
Students will be able to develop SQL statements to simulate OLAP operators DrillDown, RollUp
using aggregate functions.
Instructor Note
Implement each question below and submit its code and result screenshot displayed by Oracle.
Tables to use
You will use the Star schema tables FORDERS, DORDERS, DSALESMAN, DTIME, and
DCUSTOMERS created and populated in the previous Labs Labs &
The star schema you will reuse in this lab is remembered in Figure extracted from Lab
Figure Star Schema Figure in Lab implemented in previous labs.
DCUSTOMERS
IDC
Gender
CFName
CLName
DTIME
IDT
MonthNo
Quarter MonthName
DSALESMAN
IDS
SName
FORDERS
ORDERAMOUNT
Year
Type
DORDERS
IDO
Status
OMode
Date
University of Jeddah
College of Computer Science &
Engineering
IST Dept.
Academic Year
CCDS Data Warehouse
P a g e
Lab Part I
Questions to Answer
Develop a SELECT statement for each of the following requirements:
Querying the Fact only
Display the Number of Orders in the DORDERS table.
Display the Number of Orders in the FORDERS table Check that you get the same number from
the dimension table DORDERS
Display the Lowest, Highest and Average Amount of all Orders.
For each customer, display the Lowest, Highest and Average Amount of orders.
Query the Fact and one dimension
Display the customersid and Name having an average Amount of orders greater than the double
of the average amount of all orders.
You should get rows.
Number of Orders by Salesman IDS and SName are required
You should get rows.
Number of Orders by customer Id FName, LName
Modify your previous answer to display the Number of Orders and their Total by Customer Id
FName, LName sorted by the number of order descending.
Display each Customer Id CFName, CLName having the total amount of its Orders greater
than of the average of all Orders.
Queries using two dimensions and the fact
Display the Number of direct Orders OMode DIRECT by Customer Id CFName, CLName
and Salesman identifier and name
You should get rows.
Total Amount of Orders by Year and Customer ID sorted by Year and Customer.
You should get rows
Simulate the DrillDown operator
Transform query to display the result of the following OLAP operation:
DrillDownQ DTime, Quarter Where Q is the result of question
University of Jeddah
College of Computer Science &
Engineering
IST Dept.
Academic Year
CCDS Data Warehouse
P a g e
Transform query to display the result of the following OLAP operation
DrillDownQ DTime, MonthNo Where Q is the result of question
Simulate the RollUp operator
Given the Following query QA
Query QA
SELECT OMODE, YYEAR, QUARTER, MONTHNO SUM ORDERAMOUNT AMOUNT
FROM FORDERS, DTIME, DORDERS
WHERE FIDT IDT
AND FIDO IDO
GROUP BY OMODE YYEAR, QUARTER, MONTHNO;
Transform query QA to display the result of the following OLAP Operation:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started