IntermediateAbout 15 min

    Star Schemas & Data Cubes

    Read the full article on Substack

    7 min read.

    Join a fact table to its dimensions, see what snowflaking costs, and watch a data cube turn a scan into a lookup.

    Think of it this way: A fact table is the receipt roll from a shop: one line per sale, with codes instead of names. Dimension tables are the price list, the staff list and the calendar that explain the codes. A data cube is the end-of-month summary sheet: answering the questions it was designed for takes a glance, but a question it has no column for means going back to the receipts.

    lookups: 0
    fact_saleskeys and numbers
    iddateprodstoreqtyamount
    1d1p1s1224
    2d1p2s2515
    3d2p3s1120
    4d3p1s2336
    5d3p2s1412
    6d4p3s2240
    7d4p1s1112
    8d2p1s2224
    dim_product
    keynamecategory
    p1MugKitchen
    p2PenOffice
    p3CapApparel
    Revenue by category
    nothing yet

    Also joined in other questions: 4 dates (month), 2 stores (city).

    Star schema: one fact table in the middle (what happened) with keys pointing at dimension tables (who, what, where, when). Question: revenue by category.

    1/10

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Fact table or dimension table?

    Sort

    Sort each item by the table it belongs in.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Fact table

    Drop items here

    Dimension table

    Drop items here
    6 pieces left to place

    Quiz

    10 questions
    Question 1 of 10
    Score: 0

    What does a fact table hold?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going