• Home
  • Testing
  • SAP
  • Web
  • Must Learn!
  • Big Data
  • Live Projects
  • AI
  • Blog

Fact Table:

A fact table is a primary table in a dimensional model.

A Fact Table contains

  1. Measurements/facts
  2. Foreign key to dimension table

Dimension table:

  • A dimension table contains dimensions of a fact.
  • They are joined to fact table via a foreign key.
  • Dimension tables are de-normalized tables.
  • The Dimension Attributes are the various columns in a dimension table
  • Dimensions offers descriptive characteristics of the facts with the help of their attributes
  • No set limit set for given for number of dimensions
  • The dimension can also contain one or more hierarchical relationships

Difference between Dimension table vs. Fact table

Parameters Fact Table Dimension Table
Definition Measurements, metrics or facts about a business process. Companion table to the fact table contains descriptive attributes to be used as query constraining.
Characteristic Located at the center of a star or snowflake schema and surrounded by dimensions. Connected to the fact table and located at the edges of the star or snowflake schema
Design Defined by their grain or its most atomic level. Should be wordy, descriptive, complete, and quality assured.
Task Fact table is a measurable event for which dimension table data is collected and is used for analysis and reporting. Collection of reference information about a business.
Type of Data Facts tables could contain information like sales against a set of dimensions like Product and Date. Evert dimension table contains attributes which describe the details of the dimension. E.g., Product dimensions can contain Product ID, Product Category, etc.
Key Primary Key in fact is mapped as foreign keys to Dimensions. Foreign key to the facts table
Storage Helps to store report labels and filter domain values in dimension tables. Load detailed atomic data into dimensional structures.
Hierarchy Does not contain Hierarchy Contains Hierarchies. For example Location could contain, country, pin code, state, city, etc.

Type of facts

Type of facts Explanation
Additive Measures should be added to all dimensions.
Semi-Additive In this type of facts, measures may be added to some dimensions and not with others.
Non-Additive It stores some basic unit of measurement of a business process. Some real-world examples include sales, phone calls, and orders.

Types of Dimensions:

Types of Dimension Definition
Conformed Dimensions Conformed dimensions is the very fact to which it relates. This dimension is used in more than one-star schema or Datamart.
Outrigger Dimensions A dimension may have a reference to another dimension table. These secondary dimensions called outrigger dimensions. This kind of Dimensions should be used carefully.
Shrunken Rollup Dimensions Shrunken Rollup dimensions are a subdivision of rows and columns of a base dimension. These kinds of dimensions are useful for developing aggregated fact tables.
Dimension-to-Dimension Table Joins Dimensions may have references to other dimensions. However, these relationships can be modeled with outrigger dimensions.
Role-Playing Dimensions A single physical dimension helps to reference multiple times in a fact table as each reference linking to a logically distinct role for the dimension.
Junk Dimensions It a collection of random transactional codes, flags or text attributes. It may not logically belong to any specific dimension.
Degenerate Dimensions Degenerate dimension is without corresponding dimension. It is used in the transaction and collecting snapshot fact tables. This kind of dimension does not have its dimension as it is derived from the fact table.
Swappable Dimensions They are used when the same fact table is paired with different versions of the same dimension.
Step Dimensions Sequential processes, like web page events, mostly have a separate row in a fact table for every step in a process. It tells where the specific step should be used in the overall session.