← All projects
DATA MODELINGbeginner

Data Modeling: Pizza Planet Party

Restaurant-ops data modeling: orders, inventory, and shifts

Pizza Planet Party: Galactic Data Modeling. Greetings, data astronaut. Pizza Planet is throwing the biggest cosmic pizza festival in the galaxy — astronauts, aliens, and explorers warping in from every system. Chef Basil runs the kitchen; Chef Coriander runs the delivery fleet. They need a data model that's simple but powerful enough to track every customer, every pizza, and every warp-speed delivery.

This is a gentle introduction to dimensional modeling: you'll build two dimensions and a single fact table, then type every column correctly. Three short puzzles below, one clean star schema at the end.

The source you're modeling

  • Customers — the aliens and astronauts placing orders.
  • Pizzas — the menu of cosmic pies.
  • Deliveries — the transaction fact: who ordered which pizza, when, and for how many space credits.

The techniques you'll practice

  1. Surrogate keys — stable integer keys for dim_customers and dim_pizzas, with the natural IDs kept as attributes.
  2. A single fact tablefact_deliveries at one row per delivery, with foreign keys plus a date and a measure.
  3. Data types — the right type for every column (INT, VARCHAR, DATE, DECIMAL).

How to work the mission

Each puzzle below gives you a pool of columns and the tables they belong in. Pick a column, click its table, then Check answer. Reveal the worked solution at the end to compare against a reference model. The in-page tutor can walk through any modeling choice with you.

Project plan

3 steps to ship this

Draft each step inline below. Reveal the worked solution when you're ready to compare.

  1. Forging the Dimensional Foundations 🛠️

    We begin by creating two dimension tables for our cosmic database:

    • dim_customers with customer_key as a surrogate PK (Primary Koordinate).
    • dim_pizzas with pizza_key as a surrogate PK (Pizza Koordinate).
    Natural IDs (customer_id, pizza_id) remain attributes. Beam the columns from the space pool into each dimension bucket.

    Mission Goal: Surrogate keys let us avoid the chaos of ever-changing cosmic IDs. Not even a supernova can disrupt Chef Basil's records!

    Pick an item, then click the section it belongs in. Click again to put it back.

    Pool · 4 remaining

    dim_customers

    Empty

    dim_pizzas

    Empty
  2. Tracking Deliveries Across the Galaxy 🛸

    Next, we build fact_deliveries to record every interstellar pizza order. Our loyal UFO couriers will want to know:

    • A delivery_key as the fact's primary key (Delivery Koordinate).
    • References to customer_key and pizza_key for warp-speed joins.
    • At least one measure or date—like order_date or amount_paid in space credits.
    Help us teleport the correct columns from the space pool into this single fact table.

    Mission Goal: Chef Coriander can then monitor which alien customer ordered which cosmic pizza, and how many galactic credits they paid.

    Pick an item, then click the section it belongs in. Click again to put it back.

    Pool · 5 remaining

    fact_deliveries

    Empty
  3. Bestowing Cosmic Data Types 🔭

    Finally, every column must receive the perfect galactic data type—like INT for keys, VARCHAR for IDs, DATE for stellar timestamps, and DECIMAL for space credits.

    Mission Goal: Once assigned, our model will withstand even the gravitational pull of a black hole. Let's drag each column to the Data Types bucket and select from the quantum dropdown.

    Pick an item, then click the section it belongs in. Click again to put it back.

    Pool · 7 remaining

    Quantum Data Types

    Empty