Skip to main content

OLAP vs OLTP; OLAP operations, fact, dimension

Short answer

OLTP handles daily transactions (normalized, current data, many users); OLAP supports analysis (denormalized, historical data, few users). OLAP operations: roll-up, drill-down, slice, dice, pivot. Fact table holds measures and dimension keys; dimension table provides descriptive attributes and hierarchies.

What are the differences between OLAP & OLTP? Define OLAP operations, fact table and dimension table.

Differences between OLAP and OLTP

PointOLTPOLAP
PurposeDay-to-day transactionsAnalysis, decision support
UsersClerks, clients, DBAsManagers, analysts, executives
DataCurrent, detailed, flat relationalHistorical, summarised, multidimensional
Database designER model, normalised, application-orientedStar/snowflake, subject-oriented
AccessRead/write, short transactionsMostly read, complex queries
Unit of workShort, simple transactionComplex query with aggregates
Records per accessTensMillions
Number of usersThousandsHundreds
DB sizeMB to GBGB to TB
MetricTransaction throughputQuery response time

OLAP operations

  • Roll-up: summarise data by climbing a hierarchy (city → country) or reducing a dimension.
  • Drill-down: from summary to detail (quarter → month).
  • Slice: fix one dimension to a single value, giving a sub-cube (time = Q1).
  • Dice: select values on two or more dimensions (time = Q1 or Q2 and location = Kathmandu).
  • Pivot: rotate the axes to view from another angle.

Fact table

Central table of a star schema containing numeric measures (units_sold, amount) and foreign keys to the dimensions. Example: Sales(time_key, item_key, branch_key, units_sold, amount).

Dimension table

Describes the context of the facts using descriptive attributes and hierarchies. Example: Item(item_key, name, brand, type), Time(time_key, day, month, quarter, year).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Data Mining chapter 2 questions →