{"id":78952,"date":"2026-11-10T19:45:29","date_gmt":"2026-11-10T19:45:29","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=78952"},"modified":"2026-11-10T19:56:16","modified_gmt":"2026-11-10T19:56:16","slug":"rewritten-sql-server-23978","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=78952","title":{"rendered":"Designing SQL Server Data Warehouses: Fact Tables, Dimensions, and Star Schemas"},"content":{"rendered":"<p>A data warehouse organizes data for reporting and analysis. A common starting point is a star schema with measurable events in fact tables and descriptive attributes in dimension tables.<\/p>\n<h2>Choose the grain first<\/h2>\n<p>Specify precisely what one fact row represents, such as one sales line. Incorrect grain creates double counting and ambiguous measures.<\/p>\n<h2>A compact model<\/h2>\n<pre><code>CREATE TABLE dbo.DimProduct (\n ProductKey int NOT NULL PRIMARY KEY,\n ProductCode nvarchar(30) NOT NULL,\n CategoryName nvarchar(80) NOT NULL\n);\nCREATE TABLE dbo.FactSales (\n SalesLineKey bigint NOT NULL PRIMARY KEY,\n ProductKey int NOT NULL REFERENCES dbo.DimProduct(ProductKey),\n Quantity int NOT NULL,\n NetAmount decimal(14,2) NOT NULL\n);<\/code><\/pre>\n<h2>Build the pipeline<\/h2>\n<p>Extract source data; standardize types and business keys; detect duplicates; populate dimensions; then load fact rows with validated dimension lookups. Plan late-arriving data and changed attributes.<\/p>\n<h2>Validate totals<\/h2>\n<p>Compare facts to source-system reconciliation totals, check orphan keys and null behaviour, and document definitions such as net revenue versus gross sales.<\/p>\n<h2>Reporting and performance<\/h2>\n<p>Choose indexes, partitions, or columnstore structures based on data volume and read patterns. Avoid mistaking a normalized transaction schema for an optimal warehouse design.<\/p>\n<hr\/>\n<p><strong>AI disclosure and reuse:<\/strong> This AI-generated article is rewritten from <a href=\"https:\/\/bangla.sitestree.com\/?p=23978\">an existing Open Education post (ID 23978)<\/a>. Additional explanations, code examples, and version notes may have been added. You may reuse the newly generated article text with or without attribution. Third-party trademarks and linked works retain their own rights. <strong>AI can make mistakes.<\/strong> Check examples, permissions, supported SQL Server versions, and documentation before use in any live system.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A data warehouse organizes data for reporting and analysis. A common starting point is a star schema with measurable events in fact tables and descriptive attributes in dimension tables.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[20,182],"tags":[466],"class_list":["post-78952","post","type-post","status-publish","format-standard","hentry","category-information-technology","category---blog","tag-sql-server","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":78953,"url":"http:\/\/bangla.sitestree.com\/?p=78953","url_meta":{"origin":78952,"position":0},"title":"Building a SQL Server Data Warehouse: Revisiting the SQL Server 2012 Workflow","author":"Sayed","date":"November 10, 2026","format":false,"excerpt":"A SQL Server data warehouse collects and reshapes operational information for analytics. An older SQL Server 2012 walkthrough is a useful starting point for understanding warehouse layers, although modern deployment tools and platform choices can differ.","rel":"","context":"In &quot;Information Technology&quot;","block_context":{"text":"Information Technology","link":"http:\/\/bangla.sitestree.com\/?cat=20"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78933,"url":"http:\/\/bangla.sitestree.com\/?p=78933","url_meta":{"origin":78952,"position":1},"title":"Using C# with SQL Server: Relationships, Procedures, and Safe Parameters","author":"Sayed","date":"November 10, 2026","format":false,"excerpt":"C# applications typically access SQL Server through ADO.NET. A reliable design starts with proper relational constraints, calls stored procedures using typed parameters, and manages connections predictably.","rel":"","context":"In &quot;Information Technology&quot;","block_context":{"text":"Information Technology","link":"http:\/\/bangla.sitestree.com\/?cat=20"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5931,"url":"http:\/\/bangla.sitestree.com\/?p=5931","url_meta":{"origin":78952,"position":2},"title":"SQL \u09aa\u09cd\u09b0\u09be\u0987\u09ae\u09be\u09b0\u09bf Constraint . SQL Primary Key Constraint","author":"Author-Check- Article-or-Video","date":"January 30, 2015","format":false,"excerpt":"SQL \u09aa\u09cd\u09b0\u09be\u0987\u09ae\u09be\u09b0\u09bf Constraint RIAZ-UL-HAQUE MIAN \u09aa\u09cd\u09b0\u09be\u0987\u09ae\u09be\u09b0\u09bf Constraint \u098f\u0995\u099f\u09bf \u099f\u09c7\u09ac\u09bf\u09b2 \u098f\u09b0 \u09af\u09c7\u0995\u09cb\u09a8\u09cb \u098f\u0995\u099f\u09bf \u0995\u09b2\u09be\u09ae \u098f\u09b0 \u09b8\u09cd\u09ac\u09a4\u09a8\u09cd\u09a4\u09cd\u09b0\u09a4\u09be\/ uniqueness \u0995\u09c7 \u09ac\u09c1\u099d\u09be\u09df . \u099f\u09c7\u09ac\u09bf\u09b2 \u098f\u09b0 \u09aa\u09cd\u09b0\u09be\u0987\u09ae\u09be\u09b0\u09bf \u0995\u09bf \u0985\u09ac\u09b6\u0987 \u0987\u0989\u09a8\u09bf\u0995 \u09b9\u09a4\u09c7 \u09b9\u09ac\u09c7 \u098f\u09ac\u0982 NULL \u09b9\u09a4\u09c7 \u09aa\u09be\u09b0\u09ac\u09c7\u09a8\u09be . \u09aa\u09cd\u09b0\u09a4\u09bf\u099f\u09be \u099f\u09c7\u09ac\u09bf\u09b2 \u098f \u0987 \u098f\u0995\u099f\u09be \u09aa\u09cd\u09b0\u09be\u0987\u09ae\u09be\u09b0\u09bf key \u09a5\u09be\u0995\u09be \u0989\u099a\u09c0\u09a0 \u098f\u0995\u099f\u09be \u099f\u09c7\u09ac\u09bf\u09b2 \u098f\u09b0 \u098f\u0995\u099f\u09be \u09ae\u09be\u09a4\u09cd\u09b0 \u0995\u09b2\u09be\u09ae \u0995\u09c7 \u0987 \u09aa\u09cd\u09b0\u09be\u0987\u09ae\u09be\u09b0\u09bf\u2026","rel":"","context":"In &quot;\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001&quot;","block_context":{"text":"\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001","link":"http:\/\/bangla.sitestree.com\/?cat=155"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5933,"url":"http:\/\/bangla.sitestree.com\/?p=5933","url_meta":{"origin":78952,"position":3},"title":"SQL (\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2) FOREIGN KEY \u0995\u09a8\u09b8\u09cd\u099f\u09cd\u09b0\u09c7\u0987\u09a8\u09cd\u099f\u09b8\u09cd. SQL Foreign Key Constraint","author":"Author-Check- Article-or-Video","date":"January 30, 2015","format":false,"excerpt":"SQL (\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2) FOREIGN KEY \u0995\u09a8\u09b8\u09cd\u099f\u09cd\u09b0\u09c7\u0987\u09a8\u09cd\u099f\u09b8\u09cd Article By: Protap Chandra FOREIGN KEY \u0995\u09a8\u09b8\u09cd\u099f\u09cd\u09b0\u09c7\u0987\u09a8\u09cd\u099f \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09be \u09af\u09be\u09df \u099f\u09c7\u09ac\u09bf\u09b2\u0997\u09c1\u09b2\u09cb\u09b0 \u09ae\u09a7\u09cd\u09af\u09c7 \u0986\u09a8\u09cd\u09a4:\u09b8\u0982\u09af\u09cb\u0997 \u09af\u09be\u09a4\u09c7 \u09a8\u09b7\u09cd\u099f \u09a8\u09be \u09b9\u09df \u09a4\u09be \u09a8\u09bf\u09b6\u09cd\u099a\u09bf\u09a4 \u0995\u09b0\u09be\u09b0 \u099c\u09a8\u09cd\u09af\u0964 \u098f\u099b\u09be\u09dc\u09be FOREIGN KEY \u0995\u09a8\u09b8\u09cd\u099f\u09cd\u09b0\u09c7\u0987\u09a8\u09cd\u099f foreign key \u09af\u09c1\u0995\u09cd\u09a4 \u0995\u09b2\u09be\u09ae\u09c7 \u0985\u0997\u09cd\u09b0\u09b9\u09a3\u09af\u09cb\u0997\u09cd\u09af \u09a1\u09be\u099f\u09be \u0987\u09a8\u09aa\u09c1\u099f\u09c7 \u09a6\u09c7\u09df\u09be\u09b0 \u09b9\u09be\u09a4 \u09a5\u09c7\u0995\u09c7\u0993 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u0995\u09be\u09b0\u09c0\u09a6\u09c7\u09b0 \u09ac\u09bf\u09b0\u09a4 \u09b0\u09be\u0996\u09c7\u0964 \u0995\u09be\u09b0\u09a3 FOREIGN KEY \u09b8\u0999\u09cd\u0997\u09be\u09df\u09bf\u09a4 \u0995\u09b2\u09be\u09ae\u09c7 \u0995\u09c7\u09ac\u09b2 \u09b8\u09c7\u0987\u2026","rel":"","context":"In &quot;\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001&quot;","block_context":{"text":"\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001","link":"http:\/\/bangla.sitestree.com\/?cat=155"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5953,"url":"http:\/\/bangla.sitestree.com\/?p=5953","url_meta":{"origin":78952,"position":4},"title":"\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2 \u09ab\u09b0\u09c7\u09a8 \u0995\u09bf \u0995\u09a8\u09cd\u09b8\u099f\u09cd\u09b0\u09c7\u0987\u09a8\u09cd\u099f .","author":"Author-Check- Article-or-Video","date":"January 30, 2015","format":false,"excerpt":"\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2 \u09ab\u09b0\u09c7\u09a8 \u0995\u09bf \u0995\u09a8\u09cd\u09b8\u099f\u09cd\u09b0\u09c7\u0987\u09a8\u09cd\u099f Sheikh Mahfuzur Rahman \u098f\u0995\u099f\u09bf \u099f\u09c7\u09ac\u09b2\u09c7\u09b0 FOREIGHN KEY \u0985\u09a8\u09cd\u09af \u099f\u09c7\u09ac\u09b2\u09c7\u09b0 PRIMARY KEY \u098f\u09b0 \u09a6\u09bf\u0995\u09c7 \u09a8\u09bf\u09b0\u09cd\u09a6\u09c7\u09b6 \u0995\u09b0\u09c7\u0964 \u098f\u0995\u099f\u09bf \u0989\u09a6\u09be\u09b9\u09b0\u09a3\u09c7\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 \"\u09ab\u09b0\u09c7\u09a8 \u0995\u09bf\" \u0995\u09c7 \u09ac\u09cd\u09af\u09be\u0996\u09cd\u09af\u09be \u0995\u09b0\u09be \u09af\u09be\u0995\u0964 \u09a8\u09bf\u099a\u09c7\u09b0 \u09a6\u09c1\u099f\u09cb \u099f\u09c7\u09ac\u09b2\u09c7\u09b0 \u09a6\u09bf\u0995\u09c7 \u09b2\u0995\u09cd\u09b7\u09cd\u09af \u0995\u09b0\u09c1\u09a8 \u09af\u09be\u09b0 \u098f\u0995\u099f\u09bf \u09b9\u09b2\u09cb ''Persons'' \u099f\u09c7\u09ac\u09b2 \u098f\u09ac\u0982 \u0985\u09a8\u09cd\u09af\u099f\u09bf \u09b9\u09b2\u09cb \"Orders\u201d \u099f\u09c7\u09ac\u09b2\u0983 The \"Persons\" table: P_Id LastName FirstName\u2026","rel":"","context":"In &quot;\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001&quot;","block_context":{"text":"\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001","link":"http:\/\/bangla.sitestree.com\/?cat=155"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6087,"url":"http:\/\/bangla.sitestree.com\/?p=6087","url_meta":{"origin":78952,"position":5},"title":"\u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf : \u09ae\u09be\u0987\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2 \u099f\u09c7\u09ac\u09bf\u09b2 \u09a4\u09c8\u09b0\u09bf (PHP Create MySQL Tables)","author":"Author-Check- Article-or-Video","date":"February 23, 2015","format":false,"excerpt":"\u098f\u0995\u099f\u09bf \u09a1\u09be\u099f\u09be\u09ac\u09c7\u09b8 \u099f\u09c7\u09ac\u09bf\u09b2 \u098f\u09b0 \u09a8\u09bf\u099c\u09b8\u09cd\u09ac \u09a8\u09be\u09ae \u09a5\u09be\u0995\u09c7 \u098f\u09ac\u0982 \u098f\u099f\u09be \u0995\u09b2\u09be\u09ae \u0993 \u09b8\u09be\u09b0\u09bf \u09a8\u09bf\u09af\u09bc\u09c7 \u0997\u09a0\u09bf\u09a4 \u09b9\u09df\u0964 MySQLi \u098f\u09ac\u0982 PDO \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c7 \u098f\u0995\u099f\u09bf \u09ae\u09be\u0987\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2 \u099b\u0995 (table) \u09a4\u09c8\u09b0\u09bf \u0995\u09b0\u09be \u09ae\u09be\u0987\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2 \u098f \u099f\u09c7\u09ac\u09bf\u09b2 \u09a4\u09c8\u09b0\u09bf \u0995\u09b0\u09a4\u09c7 CREATE TABLE \u09b8\u09cd\u099f\u09c7\u099f\u09ae\u09c7\u09a8\u09cd\u099f \u09ac\u09cd\u09af\u09be\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09be \u09b9\u09df\u0964 \u0986\u09ae\u09b0\u09be \u098f\u0996\u09a8 \"MyGuests\" \u09a8\u09be\u09ae\u09c7 \u098f\u0995\u099f\u09bf \u099f\u09c7\u09ac\u09bf\u09b2 \u09a4\u09c8\u09b0\u09bf \u0995\u09b0\u09ac\u09cb \u09af\u09be\u09b0 \"id\", \"firstname\", \"lastname\", \"email\"\u2026","rel":"","context":"In &quot;\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 \u0964 PHP tutorial&quot;","block_context":{"text":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 \u0964 PHP tutorial","link":"http:\/\/bangla.sitestree.com\/?cat=172"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78952"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78952\/revisions"}],"predecessor-version":[{"id":79014,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78952\/revisions\/79014"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78952"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}