Data Modelling Essentials
Test what you know about dimensional modelling: the 4-step design, the grain, star schemas, the 3 kinds of fact table, additive facts, surrogate keys, slowly changing dimensions, conformed, degenerate and junk dimensions, bridge tables and snowflaking.
Question 1 of 12
Question 1
In the 4-step dimensional design process, what comes right after selecting the business process?
Not this time. The 4 steps are: select the business process, declare the grain, identify the dimensions, identify the facts. The grain comes before dimensions and facts because every one of them must fit it.
Question 2
What is the grain of a fact table?
Not this time. The grain says exactly what one fact table row represents, such as one line on a receipt. Atomic grain is the lowest level the process captures, and different grains must not be mixed in the same fact table.
Question 3
An order moves through placed, picked, shipped and delivered, and you want the lag between each step. Which fact table fits?
Not this time. An accumulating snapshot has one row per order line, inserted when the line is created and updated as each milestone happens, with a date key for each milestone and lag measures. It is the only one of the 3 kinds whose rows are updated.
Question 4
A daily account balance fact can be summed across accounts. Why not across days?
Not this time. A balance is semi-additive: it can be summed across every dimension except time. Over days, use the last value or an average instead. Ratios are non-additive: store their parts and divide at the end.
Question 5
Why use a surrogate key instead of the source system's customer ID as the primary key of the customer dimension?
Not this time. When changes are tracked over time, one customer ID has several dimension rows, so it cannot be the primary key. Natural keys from several sources may also clash. Kimball recommends integer surrogate keys assigned in sequence; the date dimension can be an exception.
Question 6
A customer moves city and you must keep old sales under the old city. Which change type does that, and what does it add?
Not this time. Type 2 adds a new row with the new values and a new surrogate key, so earlier facts still point to the old row. It needs at least a row effective date, a row expiration date and a current row indicator.
Question 7
Sales and inventory are 2 fact tables. What lets one report show both by product and month on the same rows?
Not this time. Conformed dimensions have the same column names and contents wherever they are used. Grouping both fact tables by a conformed attribute lines up the results on the same rows, which is a drill-across report.
Question 8
A fact table is at invoice line grain. Where does the invoice number go?
Not this time. Once each line carries the invoice's dimension keys, the invoice has nothing left but its number. That number stays in the fact table as a degenerate dimension, with no dimension table behind it.
Question 9
Orders carry 6 yes/no flags (gift wrap, express, paid by card...). What does Kimball suggest?
Not this time. Put the low-cardinality flags together in one junk dimension, holding only the combinations that actually occur in the data rather than every possible combination.
Question 10
You record which students attended which class each day. There is no number to measure. Which table fits?
Not this time. A factless fact table records dimensions coming together at a point in time, here day, student, teacher, location and class, with no numeric fact. A coverage table of every possible attendance minus this activity shows who did not attend.
Question 11
A patient treatment can have several diagnoses at once. How do you attach diagnosis to the treatment fact?
Not this time. A dimension with several values at the grain is attached through a group key to a bridge table, which has one row for each diagnosis in the group.
Question 12
Why does Kimball advise against snowflaking a product dimension into category and department tables?
Not this time. A snowflaked dimension holds the same information as the flattened one, but it is harder for business users to understand and use, and it can slow queries.
Sources
Where each fact comes from
- 1Four-Step Dimensional Design Process
- 2Grain
- 3Star Schemas and OLAP Cubes
- 4Transaction Fact Tables
- 5Periodic Snapshot Fact Tables
- 6Accumulating Snapshot Fact Tables
- 7Additive, Semi-Additive, and Non-Additive Facts
- 8Dimension Surrogate Keys
- 9Type 2: Add New Row
- 10Conformed Dimensions
- 11Degenerate Dimensions
- 12Junk Dimensions
- 13Factless Fact Tables
- 14Multivalued Dimensions and Bridge Tables
- 15Snowflaked Dimensions