Understanding Dimension Tables in Data Warehousing
Q: What is a dimension table in a data warehouse?
- Data warehousing
- Junior level question
Explore all the latest Data warehousing interview questions and answers
ExploreMost Recent & up-to date
100% Actual interview focused
Create Data warehousing interview for FREE!
A dimension table in a data warehouse is a table that contains attributes related to the facts stored in the fact tables. Dimension tables are often used to categorize facts and provide additional context. For example, a sales fact table may contain a date, product, and sales amount, while the associated dimension tables may contain product categories, customer details, or geographic locations.
Dimension tables usually have a few key characteristics. They can contain one or more columns, each of which represents an attribute of the dimension. They usually have a primary key that is used to join them to the fact tables. They often have hierarchies, which can be used to aggregate data. Additionally, they may have a date field which can be used to track changes over time.
To illustrate this concept, consider a sales fact table that contains the date, product, and sales amount. The associated dimension tables may include a product category table, a customer table, and a geography table. The product category table would contain the product name, product category, and a unique identifier for each product. The customer table would contain the customer name, address, and a unique identifier for each customer. The geography table would contain the geographic regions and a unique identifier for each region. Each of these tables would be joined to the fact table based on the unique identifiers. This way, the sales fact table can be joined to the various dimension tables to provide additional context.
Dimension tables usually have a few key characteristics. They can contain one or more columns, each of which represents an attribute of the dimension. They usually have a primary key that is used to join them to the fact tables. They often have hierarchies, which can be used to aggregate data. Additionally, they may have a date field which can be used to track changes over time.
To illustrate this concept, consider a sales fact table that contains the date, product, and sales amount. The associated dimension tables may include a product category table, a customer table, and a geography table. The product category table would contain the product name, product category, and a unique identifier for each product. The customer table would contain the customer name, address, and a unique identifier for each customer. The geography table would contain the geographic regions and a unique identifier for each region. Each of these tables would be joined to the fact table based on the unique identifiers. This way, the sales fact table can be joined to the various dimension tables to provide additional context.


