Understanding dimension and fact tables
In a relational database, a fact table is a table that stores quantitative information or facts about a business process or activity, such as sales, inventory, or customer transactions. A fact table typically contains numerical values and foreign keys to link to dimension tables.
On the other hand, a dimension table is a table that stores descriptive information about the objects, events, or entities in a business process or activity. Dimension tables are typically used to provide context and structure to the data in a fact table.
To understand this better, let’s consider an example of a retail business that sells products through its online store. In this example, we can identify the following fact and dimension tables.
Fact table – sales
The sales fact table would contain quantitative information about sales transactions, such as sales revenue, quantity sold, and price. The sales fact table would typically contain...