OLAP Schemas Overview
An overview of Star Schema,
Snowflake Schema, and Fact
Constellation Schema
1. Star Schema
• - Definition: The simplest OLAP schema with a
central fact table and related dimension
tables.
• - Fact Table: Contains metrics like sales
amount, quantities, etc.
• - Dimension Tables: Represent dimensions
such as time, product, customer, etc.
• - Advantages:
• 1. Easy to understand
2. Snowflake Schema
• - Definition: A normalized version of the Star
Schema.
• - Fact Table: Similar to Star Schema, contains
metrics.
• - Normalized Dimension Tables: Split into
more tables to minimize redundancy.
• - Advantages:
• 1. Reduces redundancy and storage space.
3. Fact Constellation Schema
• - Definition: An extension of the Star Schema
with multiple fact tables sharing dimension
tables.
• - Fact Tables: Multiple facts representing
different subject areas like sales and suppliers.
• - Shared Dimension Tables: Common across all
fact tables.
• - Advantages:
• 1. Allows complex analysis with multiple
OLAP Queries
• - OLAP queries are used to retrieve
multidimensional data efficiently.
• - OLAP Cube: Abstract representation of data
in multidimensional space.
• - Commands:
• - CREATE.CUBE: Creates a new cube.
• - DROP.CUBE: Deletes a cube.
• - DEFINE CUBE: Defines a cube with specific
4. Dicing Operation
• - Definition: Projects data onto a subset of
dimensions, restricting the data range along
selected dimensions.
• - Example: Analyzing sales data for a specific
time period, region, and product.
• - SQL Syntax:
• SELECT grouping_attributes
• FROM fact_table
5. Pivoting Operation
• - Definition: Rotates the data cube to view the
data from different angles, usually after
slicing.
• - Example: Viewing sales data by product
instead of time after slicing by year.
• - Process: Re-orienting data to compare
different sub-cubes, enhancing analysis
flexibility.
OLAP Operations Summary
• | Operation | SQL Equivalent | Description
|
• |-------------|---------------------|-----------------------
---------------------|
• | Roll-up | GROUP BY ROLLUP | Decrease
level of detail |
• | Drill-down | Nested SQL | Increase
level of detail |
• | Slicing | WHERE condition | Fix a