Skip to content
Back to challenges
Grain and Fact TypesConcept Challengeintermediate25 min

Order fulfillment snapshot

Build an order-line workflow fact where fulfillment milestones accumulate on one row.

How this preview works
Preview this problem before signing in. Sign in to save progress and submit work.

Concept

fact-table-grain

The primary modeling idea this problem reinforces.

Requirements

5

Business needs the model must satisfy.

Read the concept guide: Fact table grain
Scenario

A commerce operations team wants to measure how long each order line spends from ordered to shipped to delivered. Product and fulfillment-center teams both need the same lifecycle facts for bottleneck analysis.

Why this matters

Fulfillment is a pipeline. If each milestone is modeled as a disconnected event fact, operations can count events but cannot easily inspect one order line moving through the full workflow.

Requirements
  • Create a fulfillment fact where one row represents one order line moving through fulfillment.
  • Keep the order-line id queryable on the fact.
  • Add ordered, shipped, and delivered milestone timestamps.
  • Add a duration measure such as fulfillment_days.
  • Connect product and fulfillment-center context through explicit N:1 relationships.
Read-only starter workspace
Inspect the authored starting ERD, then open the workspace to edit and run the checks. Saving your progress needs a free account.

Template

Order fulfillment starter workspace

The model users start from in the full workspace.

Entities

2

Seeded tables visible in the public preview.

Dialect

postgresql

Generated SQL target for this starter model.

Mini Map

This preview is read-only. Open the workspace to edit and verify; saving needs a free account.

Open workspace

Try the question first.

The discussion has other people's approaches and solutions. Give it a real attempt before you read them.