Saltar al contenido

Lección 26 · Projects and Reference

Data Warehousing Glossary and Cheat Sheet

A quick reference for data warehousing: key terms, the design checklist, fact and SCD types, additivity rules and reusable SQL patterns.

Keep this page open while you design. It collects the terms and patterns from the tutorial, with links to the lessons that explain them.

Design in one view

Design order

Process
Grain
Dimensions
Facts
1 / 2

Choose a fact table

Question Type
What happened, event by event? Transaction
What was the level at the end of each period? Periodic snapshot
How far along is each item, and how long did steps take? Accumulating snapshot
Which events or conditions occurred, with no measure? Factless

Choose an SCD type

Need Type
Keep the original value 0
Correct or overwrite 1
Keep full history 2
Keep a limited previous value 3
History plus current value together 6

Additivity

Measure Rule
Amounts and quantities Sum freely, with consistent units
Balances and stock levels Do not sum over time
Ratios and percentages Sum the parts, then divide
Distinct counts Recount from detail

SQL patterns

SQL Cheat sheet patterns in one run

Press Run (or Ctrl + Enter) to see the result here.

Glossary

Term Meaning
Accumulating snapshot One updated row per process instance with milestones
Backfill Reprocessing earlier periods
Bridge table A table that models many-to-many links to dimensions
Bus matrix Grid of business processes and shared dimensions
CDC Change data capture, a stream of source changes
Clustering / sort key Arranging stored data so related values sit together
Conformed dimension A dimension with the same meaning across fact tables
Data mart Tables for one subject area or audience
Data Vault Modeling with hubs, links and satellites
Degenerate dimension A dimension value stored only in the fact table
Dimension Descriptive context for facts
ELT / ETL Load then transform / transform then load
Fact A measurement, stored in a fact table
Factless fact A fact table without numeric measures
Grain What one fact row represents
Idempotent Safe to repeat with the same result
Inferred member Placeholder dimension row for an early fact
Junk dimension Several small flags combined into one dimension
Lineage Where data comes from and goes to
Materialized view A stored query result managed by the database
MPP Massively parallel processing
Natural key Identifier from the source system
ODS Operational data store, near-current integrated data
OLAP / OLTP Analytical / transaction processing
Partition pruning Skipping parts of a table that cannot match
Role-playing dimension One dimension used in several roles
SCD Slowly changing dimension
Semantic layer Shared definitions of metrics and business concepts
Staging The landing area for source data
Star schema A fact table joined directly to its dimensions
Surrogate key A key generated by the warehouse
Watermark A record of how far a load has processed

Troubleshooting guide

Symptom Likely places to look
A total is too high Duplicate loads, a join that multiplies rows, a coarse value repeated at a finer grain
A total is too low Inner joins dropping unmatched facts, late data, a filter or time zone cut-off
History changed unexpectedly A Type 1 overwrite, a rebuilt dimension, a changed metric definition
One fact matches two versions Overlapping validity periods or a BETWEEN join
Reports disagree Different definitions, date roles, filters or refresh times
A query became slow More data, lost pruning, skew, outdated statistics, a new join

Try to reproduce the problem with the smallest query you can, and then walk back through the layers until you find the first point where the data is wrong.

One-sentence rules

  • Say what one row means before you add a column.
  • Keep the most detailed data you have a good reason to keep.
  • Share dimensions instead of copying them.
  • Add up each fact table separately before combining results.
  • Use the event date to choose a historical version.
  • Make every load safe to run twice.
  • Account for every row that does not arrive.
  • Store the parts of a ratio.
  • Give each important table an owner.
  • Collect only the data you need.

These are strong defaults, not laws. When you break one, write down why, so that the next person understands the choice.

Pattern notes

The deduplication pattern needs a reliable ordering column. If two rows tie on it, the engine may pick either one, so add a tie-breaker that makes the choice repeatable. The point-in-time lookup assumes that versions do not overlap. The grain test only inspects the rows it is given, so run it against the whole target table, not just the newest batch. The reconciliation query is most useful when you also break totals down by day or another meaningful group. Adapt the names and date functions to your platform, and test each pattern on a few rows with a known answer before you rely on it.

Review checklist

  • The grain is written in one sentence and tested.
  • Every dimension key in each fact table resolves, with defined unknown rows.
  • Each measure has a definition and an additivity rule.
  • SCD behavior is chosen per attribute.
  • Loads are safe to rerun, and late data and deletes are handled.
  • Totals reconcile with sources, and freshness is monitored.
  • Owners, descriptions and lineage exist for important tables.
  • Access follows least privilege, and retention rules are applied.
  • Costs can be attributed and are watched.

Where to go next

The best next step is a model of something you know well: your reading log, a sports league or a household budget with made-up numbers. Declare the grain, build two dimensions and ask five questions of it.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. Which type of fact table suits end-of-day stock levels?

    It records the level of something at regular intervals.
  2. 2. What is a surrogate key?

    The source's identifier is the natural key; the warehouse generates surrogates.
  3. 3. Which should be done to a ratio when rolling it up?

    This weights every row correctly.

Summary

  • Design in order: process, grain, dimensions, facts.
  • Choose fact and SCD types from the questions you must answer.
  • Respect additivity, test the grain and reconcile totals.
  • Document, secure and monitor what you build.

Next: Back to the Data Warehousing tutorial

Tu progreso se guarda en este navegador. No necesitas una cuenta.