Skip to content
Back to challenges
Dimensional Modeling FoundationsConcept Challengeintermediate20 min

Daily balance snapshots

Design a periodic snapshot fact that records each account balance once per day.

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 finance analytics team needs to trend account balances by day. The source system stores the current balance on each account, but analysts need reproducible daily balance history for end-of-day reporting.

Why this matters

Periodic snapshot facts are a classic grain decision. If learners only store current account balance on a dimension, historical reporting becomes impossible; if they model each transaction instead, every balance query has to recompute state from events.

Requirements
  • Keep account identity and descriptive attributes in an account dimension.
  • Create a daily balance snapshot fact with one row per account per snapshot date.
  • Include a balance measure and an explicit snapshot date on the fact.
  • Declare a primary or unique key that protects the account plus snapshot-date grain.
  • Declare an explicit foreign-key relationship from the fact to the account dimension surrogate key.
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

Daily account balance starter workspace

The model users start from in the full workspace.

Entities

1

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.