{"id":191307,"date":"2026-01-28T03:40:02","date_gmt":"2026-01-28T02:40:02","guid":{"rendered":"https:\/\/liora.io\/en\/?p=191307"},"modified":"2026-08-08T14:30:31","modified_gmt":"2026-08-08T13:30:31","slug":"all-about-dimension-tables","status":"publish","type":"post","link":"https:\/\/liora.io\/en\/all-about-dimension-tables","title":{"rendered":"What are Dimension tables in a Data Warehouse?"},"content":{"rendered":"\n<p><strong>In data science, and more specifically in data warehouses, the terms dimension table and fact table are essential concepts in any data model, among others, for analysis purposes.<\/strong><\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:512px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Illustration for Reminder: What is a Data Warehouse?\" decoding=\"async\" height=\"512\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image3-1.webp\" style=\"width:512px;max-width:100%;height:auto\" width=\"512\"\/><\/figure>\n\n\n<h2 class=\"wp-block-heading\" id=\"reminder-what-is-a-data-warehouse\">Reminder: What is a Data Warehouse?<\/h2>\n\n\n<p><a href=\"https:\/\/liora.io\/en\/data-warehouse-2\">A data warehouse is a centralized data storage platform<\/a> designed to facilitate analysis and decision-making. It consolidates data from various sources and organizes it in a manner that supports fast and efficient analysis. Unlike operational databases, a data warehouse is optimized for <strong>historical data analysis<\/strong>, thus providing a comprehensive view of past and current performance.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-dimension-table\">What is a Dimension Table?<\/h2>\n\n\n<p><strong>A dimension is a table that stores qualitative attributes<\/strong> of a key element within the business process. These attributes serve to describe <strong>numerical facts<\/strong>, which are recorded in the fact tables.<\/p>\n\n\n<p>Dimensions thus offer context for quantitative measures. They provide details about events, such as who made a sale, when, where, or to which product the sale was made.<\/p>\n\n\n<p>These attributes can include items like the product, date, customer, or even location. Dimension tables are structured to make data analysis intuitive, thus making it easier to comprehend <strong>fact tables, which contain quantitative measures.<\/strong><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"types-of-schemas-used\">Types of Schemas Used<\/h2>\n\n\n<p>There are several models for organizing fact and dimension tables, including star schemas and snowflake schemas.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Illustration for Types of Schemas Used\" decoding=\"async\" height=\"579\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image5-1.webp\" style=\"width:100%;height:auto\" width=\"848\"\/><\/figure>\n\n\n<h3 class=\"wp-block-heading\" id=\"star-schema\">Star Schema<\/h3>\n\n\n<p>This schema type is the simplest and most commonly employed in data warehousing. Here, fact tables are positioned at the center and linked to the surrounding dimension tables, forming a star-shaped structure. This configuration facilitates data analysis due to the clear and uncomplicated table relationships. It is generally the preferred approach where feasible.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Illustration for Star Schema\" decoding=\"async\" height=\"725\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image2-1.webp\" style=\"width:100%;height:auto\" width=\"1200\"\/><\/figure>\n\n\n<h3 class=\"wp-block-heading\" id=\"snowflake-schema\">Snowflake Schema<\/h3>\n\n\n<p>The snowflake schema is an extension of the star schema, where dimension tables are normalized into multiple tiers. This signifies that the attributes of a dimension are further linked to other tables, forming a more intricate structure that resembles a snowflake. This approach reduces data redundancy but increases the complexity of the queries.<\/p>\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-5ee10de4\" style=\"margin-top:32px;margin-bottom:32px\"><div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"\/en\/courses\/data-ai\/data-engineer\">Learn all about Data Warehouses<\/a><\/div><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"primary-keys-and-foreign-keys\">Primary Keys and Foreign Keys<\/h2>\n\n\n<p>In a dimensional model, dimension tables have a <strong>primary key<\/strong> that <strong>uniquely identifies each row<\/strong>. This primary key is subsequently used in the <strong>foreign key<\/strong> of the fact table to establish <strong>a relationship between the tables<\/strong>.<\/p>\n\n\n<p>For instance, a sales fact table might include a &#8220;ProductID&#8221; column that serves as a foreign key pointing to the primary key of the product dimension table. These relationships allow data from different tables to be combined for rich and detailed analyses.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:363px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Illustration for Primary Keys and Foreign Keys\" decoding=\"async\" height=\"380\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image4-1.webp\" style=\"width:363px;max-width:100%;height:auto\" width=\"363\"\/><\/figure>\n\n\n<h2 class=\"wp-block-heading\" id=\"role-playing-dimensions\">Role-Playing Dimensions<\/h2>\n\n\n<p>Some dimensions can assume different roles within the data model. For example, a date dimension can represent order date, delivery date, or billing date. These are referred to as role-playing dimensions. This approach prevents data duplication by utilizing a single dimension for various purposes.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Illustration for Role-Playing Dimensions\" decoding=\"async\" height=\"464\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image1-1.webp\" style=\"width:100%;height:auto\" width=\"786\"\/><\/figure>\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-5ee10de4\" style=\"margin-top:32px;margin-bottom:32px\"><div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"\/en\/courses\/data-ai\/data-scientist\">Follow a course in Data Science<\/a><\/div><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"slowly-changing-dimensions-scd\">Slowly Changing Dimensions (SCD)<\/h2>\n\n\n<p>Dimensions can evolve over time, necessitating the tracking of these changes within the data warehouse. For example, a customer may update their address. <strong>These changes must be managed to understand when these modifications occurred and how they impacted the facts<\/strong>.<\/p>\n\n\n<p><strong>Slowly changing dimensions<\/strong> (SCD) enable the management of these types of variations. There are several types, including:<\/p>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type 1<\/strong>: The change simply overwrites the old value.<\/li>\n<li><strong>Type 2<\/strong>: A new row is added for each change, preserving history.<\/li>\n<li><strong>Type 3<\/strong>: A new column is added to keep the previous value.<\/li>\n<\/ul>\n\n\n<h2 class=\"wp-block-heading\" id=\"the-importance-of-dimensions-in-data-analysis\">The Importance of Dimensions in Data Analysis<\/h2>\n\n\n<p>Dimensions transform numerical values into actionable information. <strong>They help answer strategic questions in the context of a business process<\/strong>, such as:<\/p>\n\n\n<ul class=\"wp-block-list\">\n<li>Which product is the best-selling?<\/li>\n<li>Who are our top customers?<\/li>\n<li>What time of year is the most profitable?<\/li>\n<\/ul>\n\n\n<p>By using relevant dimensions like product, date, or customer, analysts can segment sales or production data to gain a more accurate perspective of the company&#8217;s performance. <strong>This association between facts and dimensions enables informed data analysis.<\/strong><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p>Dimensions are crucial in a data warehouse and should not be underestimated, as they help <strong>provide meaning to the quantitative data<\/strong> contained in the fact tables. By organizing data using star or snowflake schemas, employing primary and foreign keys, and leveraging role-playing dimensions, a data warehouse can offer a <strong>solid foundation for comprehensive data analysis.<\/strong><\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p><strong><b>In data science, and more specifically in data warehouses, the terms dimension table and fact table are essential concepts in any data model, among others, for analysis purposes.<\/b><\/strong><\/p>\n","protected":false},"author":85,"featured_media":208103,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"editor_notices":[],"footnotes":""},"categories":[2433],"class_list":["post-191307","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai"],"acf":[],"_links":{"self":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/191307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/comments?post=191307"}],"version-history":[{"count":5,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/191307\/revisions"}],"predecessor-version":[{"id":210599,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/191307\/revisions\/210599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media\/208103"}],"wp:attachment":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media?parent=191307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/categories?post=191307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}