{"id":4201,"date":"2026-10-12T16:23:32","date_gmt":"2026-10-12T16:23:32","guid":{"rendered":"https:\/\/www.examtopics.info\/blog\/?p=4201"},"modified":"2026-11-04T19:53:37","modified_gmt":"2026-11-04T19:53:37","slug":"dp-700-fabric-warehouse-dimensional-t-sql-modeling","status":"publish","type":"post","link":"https:\/\/www.examtopics.info\/blog\/dp-700-fabric-warehouse-dimensional-t-sql-modeling\/","title":{"rendered":"Microsoft DP-700: Fabric Warehouse: Dimensional Modeling and Reliable T-SQL Loads"},"content":{"rendered":"<p>Data engineers often receive a request that sounds like a reporting problem: \u201cGive finance a daily revenue table.\u201d The actual engineering problem is to define the grain, track source corrections, preserve dimension relationships and make relational transformations repeatable. In Microsoft Fabric, a warehouse provides a familiar T-SQL environment for these curated datasets. DP-700 requires engineering the data behind reports, not merely selecting visuals in a semantic model.<\/p>\n<h2>Begin with grain before naming tables<\/h2>\n<p>Suppose an order can contain several items, partial returns and multiple payments. The grain of a sales fact might be \u201cone row per completed order line transaction,\u201d not \u201cone row per customer and day.\u201d Decide that before writing SQL. Then identify the natural business keys and how the warehouse assigns stable surrogate keys to product, customer and calendar dimensions. A fact table that mixes order-level and line-level quantities makes totals ambiguous and encourages double-counting.<\/p>\n<p>Write a contract: source order ID, line ID, event version, business-effective timestamp, quantity, unit price, recognized revenue and cancellation state. Define which fields can be corrected and what happens when an order line is deleted at the source. These definitions are more valuable than a hand-wavy claim that \u201cstar schemas perform better.\u201d<\/p>\n<h2>Stage, validate and only then merge into curated tables<\/h2>\n<p>A robust flow lands a source batch in a staging table, checks unique keys and non-null requirements, resolves dimension lookups and applies a controlled merge\/update strategy. Because a retry may replay records, use source identifiers and versioning to avoid duplicate facts. For example, a staged row with a newer source version can update an existing business key; an older replay should not overwrite a newer committed fact.<\/p>\n<p>Illustrative T-SQL to inspect duplicate source keys before a load:<\/p>\n<pre><code class=\"language-sql\">SELECT order_id, line_id, COUNT(*) AS row_count\nFROM staging.order_lines\nGROUP BY order_id, line_id\nHAVING COUNT(*) &gt; 1;\n<\/code><\/pre>\n<p>This query is a validation example, not a complete production merge. After detecting duplicates, decide whether they represent accidental repeats, separate source versions or legitimately distinct transactions. The correct remedy depends on the source contract; <code>DISTINCT<\/code> is not an acceptable universal data-quality policy.<\/p>\n<h2>Use slowly changing dimensions intentionally<\/h2>\n<p>A customer can move regions after placing an order. A Type 1 dimension stores the current value and changes historical groupings when that value changes. A Type 2 design records valid-from and valid-to intervals and lets historical facts retain the region effective at transaction time. Neither is universally correct. Reporting a past sale under the original salesperson&#8217;s territory may require historical Type 2 behavior; an address correction with no analytical history requirement may be Type 1.<\/p>\n<p>Test boundary cases: two updates with the same timestamp, a late effective-dated change, an unknown dimension member and a fact whose dimension is not yet available. If the ETL cannot resolve these without manual guesswork, adding another dimension table will not fix the design.<\/p>\n<h2>Distinguish warehouse T-SQL from lakehouse SQL access<\/h2>\n<p>A Fabric warehouse supports a T-SQL-centric analytical store with write operations. A lakehouse SQL analytics endpoint is designed principally for querying lakehouse Delta data; it is not a drop-in replacement for every warehouse write pattern. Understand which engine owns the operation before planning CREATE\/INSERT\/UPDATE commands. For upstream Spark and Delta transformation, the <a href=\"https:\/\/www.examtopics.info\/blog\/dp-700-fabric-lakehouse-warehouse-eventhouse-choices\/\">lakehouse, warehouse and Eventhouse design<\/a> explains the storage and consumption trade-offs.<\/p>\n<p>Where a workflow combines lakehouse staging and warehouse curation, define the transaction and recovery boundary between them. Data copied to one item is not automatically committed atomically with an operation in another Fabric item. Publish a downstream completeness marker only after the intended target has passed reconciliation.<\/p>\n<h2>Design for reconciliation, not only successful queries<\/h2>\n<p>After a batch, compare source and target counts at the correct grain, aggregate amounts by business period and inspect null key references. For a retail example, the total of completed order-line net amounts should reconcile to the source&#8217;s accepted orders after returns and cancellations are applied. A row count can pass while a monetary amount differs because a duplicate update doubled one line.<\/p>\n<p>Track source watermark, accepted batch ID and target version where the store exposes one. A daily finance run should allow operators to answer: which source records contributed, which failed validation, and what exact run must be replayed? If that answer depends on notebook output that disappears after an interactive session, the operations design is unfinished.<\/p>\n<h2>Tune queries with evidence rather than folklore<\/h2>\n<p>Fabric Warehouse has an optimizer that uses statistics to estimate cardinalities and choose execution plans. Poorly maintained statistics after substantial data changes can distort those estimates. Microsoft&#8217;s warehouse statistics guidance explains automatic and manual statistics; its performance guidance recommends batching writes rather than issuing many tiny DML transactions.<\/p>\n<p>When a join becomes slow, compare input row counts, current statistics, predicates, join cardinality and resource contention before guessing at a fix. A broad scan caused by a missing filter is different from a skewed join that expands intermediate results. Query tuning should be paired with correctness tests so a \u201cfaster\u201d aggregation does not change the business grain.<\/p>\n<h2>Build a five-table test that can fail safely<\/h2>\n<p>In a Fabric warehouse, define customers, products, dates, sales fact and a staging table. Load five test orders, including one with two lines. Update a customer&#8217;s region and demonstrate both Type 1 and Type 2 choices on paper. Replay the source batch and show the fact count remains stable. Introduce a cancelled order and verify the accepted revenue changes according to the defined rule rather than simply duplicating a negative line.<\/p>\n<p>Finish by recording three artifacts: the grain and schema contract, the staging validation queries and the reconciliation output. This gives an interviewer or DP-700 candidate an engineering explanation that is testable. The most important ability is not typing T-SQL quickly; it is choosing and validating a relational data load that survives corrections, outages and repeat execution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data engineers often receive a request that sounds like a reporting problem: \u201cGive finance a daily revenue table.\u201d The actual engineering problem is to define the grain,.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,8],"tags":[],"class_list":["post-4201","post","type-post","status-publish","format-standard","hentry","category-ai-data","category-certifications"],"_links":{"self":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/4201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/comments?post=4201"}],"version-history":[{"count":4,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/4201\/revisions"}],"predecessor-version":[{"id":6234,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/posts\/4201\/revisions\/6234"}],"wp:attachment":[{"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/media?parent=4201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/categories?post=4201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examtopics.info\/blog\/wp-json\/wp\/v2\/tags?post=4201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}