{"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-02-26T10:05:34","modified_gmt":"2026-02-26T09:05:34","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":"<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>\n\n<br \/>\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=&#8221;.svg&#8221;]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"512\" height=\"512\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image3-1.webp\" alt=\"\" loading=\"lazy\">\n\n<br \/>\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]&gt;a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}\n<h2 class=\"wp-block-heading\" id=\"h-reminder-what-is-a-data-warehouse\">Reminder: What is a Data Warehouse?<\/h2>\n<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 <b>historical data analysis<\/b>, thus providing a comprehensive view of past and current performance.\n<h2 class=\"wp-block-heading\" id=\"h-what-is-a-dimension-table\">What is a Dimension Table?<\/h2>\n<b>A dimension is a table that stores qualitative attributes<\/b> of a key element within the business process. These attributes serve to describe <b>numerical facts<\/b>, which are recorded in the fact tables.\n\nDimensions 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.\n\nThese 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 <b>fact tables, which contain quantitative measures.<\/b>\n<h2 class=\"wp-block-heading\" id=\"h-types-of-schemas-used\">Types of Schemas Used<\/h2>\nThere are several models for organizing fact and dimension tables, including star schemas and snowflake schemas.\n\n<img decoding=\"async\" width=\"848\" height=\"579\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image5-1.webp\" alt=\"\" loading=\"lazy\">\n<h3 class=\"wp-block-heading\" id=\"h-star-schema\">Star Schema<\/h3>\nThis 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.\n\n<img decoding=\"async\" width=\"1200\" height=\"725\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image2-1.webp\" alt=\"\" loading=\"lazy\">\n<h3 class=\"wp-block-heading\" id=\"h-snowflake-schema\">Snowflake Schema<\/h3>\nThe 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.\n\n<a href=\"\/en\/courses\/data-ai\/\">\nLearn all about Data Warehouses\n<\/a>\n<h2 class=\"wp-block-heading\" id=\"h-primary-keys-and-foreign-keys\">Primary Keys and Foreign Keys<\/h2>\nIn a dimensional model, dimension tables have a <b>primary key<\/b> that <b>uniquely identifies each row<\/b>. This primary key is subsequently used in the <b>foreign key<\/b> of the fact table to establish <b>a relationship between the tables<\/b>.\n\nFor 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.\n\n<img decoding=\"async\" width=\"363\" height=\"380\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image4-1.webp\" alt=\"\" loading=\"lazy\">\n<h2 class=\"wp-block-heading\" id=\"h-role-playing-dimensions\">Role-Playing Dimensions<\/h2>\nSome 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.\n\n<img decoding=\"async\" width=\"786\" height=\"464\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2024\/11\/image1-1.webp\" alt=\"\" loading=\"lazy\">\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center\"><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<h2 class=\"wp-block-heading\" id=\"h-slowly-changing-dimensions-scd\">Slowly Changing Dimensions (SCD)<\/h2>\nDimensions can evolve over time, necessitating the tracking of these changes within the data warehouse. For example, a customer may update their address. <b>These changes must be managed to understand when these modifications occurred and how they impacted the facts<\/b>.\n\n<b>Slowly changing dimensions<\/b> (SCD) enable the management of these types of variations. There are several types, including:\n<ul>\n \t<li style=\"font-weight: 400\"><b>Type 1<\/b>: The change simply overwrites the old value.<\/li>\n \t<li style=\"font-weight: 400\"><b>Type 2<\/b>: A new row is added for each change, preserving history.<\/li>\n \t<li style=\"font-weight: 400\"><b>Type 3<\/b>: A new column is added to keep the previous value.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-the-importance-of-dimensions-in-data-analysis\">The Importance of Dimensions in Data Analysis<\/h2>\nDimensions transform numerical values into actionable information. <b>They help answer strategic questions in the context of a business process<\/b>, such as:\n<ul>\n \t<li style=\"font-weight: 400\">Which product is the best-selling?<\/li>\n \t<li style=\"font-weight: 400\">Who are our top customers?<\/li>\n \t<li style=\"font-weight: 400\">What time of year is the most profitable?<\/li>\n<\/ul>\nBy 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. <b>This association between facts and dimensions enables informed data analysis.<\/b>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\nDimensions are crucial in a data warehouse and should not be underestimated, as they help <b>provide meaning to the quantitative data<\/b> 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 <b>solid foundation for comprehensive data analysis.<\/b>\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center\"><div class=\"wp-block-button \"><a class=\"wp-block-button__link wp-element-button \" href=\"\/en\/courses\/data-ai\/data-analyst\">Become a Data Analyst<\/a><\/div><\/div>\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":4,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/191307\/revisions"}],"predecessor-version":[{"id":208105,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/191307\/revisions\/208105"}],"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}]}}