0% found this document useful (0 votes)
26 views3 pages

DWM Exp3 33

The document discusses implementing OLAP operations like slice, dice, rollup and pivot on SQL tables. It defines each operation, provides examples, and writes SQL queries to perform slice and dice operations.

Uploaded by

jessjohn2209
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

DWM Exp3 33

The document discusses implementing OLAP operations like slice, dice, rollup and pivot on SQL tables. It defines each operation, provides examples, and writes SQL queries to perform slice and dice operations.

Uploaded by

jessjohn2209
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CSL503 Data Warehousing and Mining Lab Sem V

Roll No.- 33
Name – Jess John

EXPERIMENT 3

Title Implementing OLAP operations- Slice, Dice, RollUp, and Pivot on the tables
created.

Pre requisite OLAP operations, Dimensional Modeling

Mapping with CO To define the design principles of data warehousing using dimensional
modeling. (CSL503.1)

Objective To simulate OLAP operations on SQL tables.

Outcome To implement OLAP operations on SQL Tables for the given case study.

Instructions - Write the statement for query which will be followed by SQL query
- Results of the query should be displayed
- Follow the format of Referral dcoument

Delieverables 1. Draw a Cube and explain all OLAP operations with the help of examples.
2. Implement OLAP operations in SQL

OLAP (Online Analytical Processing) is a category of database operations that


enable users to interactively analyze multidimensional data. OLAP operations
are typically performed on data cubes, which are multi-dimensional structures
used to store and represent data for analytical purposes.
Let's first explain the core OLAP operations and then provide SQL examples
for each.
1. OLAP Operations:
a. Roll-up (Drill-Up):
 Roll-up involves moving from detailed data to summarized data by
climbing up the hierarchy.
 Example: Going from monthly sales to quarterly sales or from product
sales to category sales.
b. Drill-down (Drill-Down):
 Drill-down is the opposite of roll-up, going from summarized data to
more detailed data.
 Example: Going from yearly sales to monthly sales or from category
sales to product sales.
c. Slice:
 Slicing involves selecting a single dimension from a cube to view a
"slice" of data.
 Example: Viewing sales for a specific month regardless of other
dimensions.
d. Dice:
 Dicing allows you to select a subset of dimensions to create a smaller
cube.
 Example: Creating a new cube for sales data from a specific region and
for a particular time period.
e. Pivot (Rotate):
 Pivoting involves reorienting the cube to view it from a different
perspective.
 Example: Rotating a cube to view sales by region instead of by
product.

2. SQL Implementation:

Slice:
-- Slicing to view transactions for a specific month
SELECT Date, CustomerID, TransactionAmount
FROM Transaction
JOIN Time ON Transaction.TimeID = Time.TimeID
WHERE Month = 1 AND Year = 2023;

Dice:
-- Dicing to create a cube for specific branch and time period
SELECT Date, TransactionType, TransactionAmount
FROM Transaction
JOIN Time ON Transaction.TimeID = Time.TimeID
WHERE BranchID = 1 AND Year = 2023;

Conclusion Write suitable conclusion as per your understanding of the experiment.

References Paulraj Ponniah, “Data Warehousing: Fundamentals for IT Professionals”,


Wiley
India
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/10g/r2/owb/ow
b10gr2
_gs/owb/lesson3/starandsnowflake.htm

You might also like