Retail star schema

A dimensional model you can actually practise joins on: one fact table, four dimensions, 63,170 rows, and every join resolving.

Every free mock-data generator hands you one flat CSV, and a flat file has no joins. That makes it useless for the exact skill most people downloading practice data are trying to learn. This is a real star schema: fact_sales joined to date, product, customer and store dimensions, with no orphaned rows and no duplicate keys in any dimension. Two things about it are declared rather than sampled, which is what makes it worth practising on: the category share of revenue is exact to the cent, and monthly revenue follows a stated two-year curve. Your GROUP BY has an answer that is known to be right, so you can check your own SQL instead of eyeballing whether it looks plausible.

63,170 rows across 5 tables, 1.9 MB zipped. Public domain (CC0), no signup, no attribution required.

What is in it

fact_sales60,000 rows

sale_id, date_key, product_key, customer_key, store_key, sold_at, quantity, unit_price, discount_pct, revenue, category

the fact table; four foreign keys, all resolving

dim_customer2,000 rows

customer_key, customer_name, email, city, country, segment

dim_date730 rows

date_key, full_date, day_of_week, month_name, quarter, is_weekend

two full years, for month-over-month and quarter grains

dim_product400 rows

product_key, product_name, category, subcategory, unit_cost, list_price

dim_store40 rows

store_key, store_name, region, store_type

What holds, and how it was checked

Each line was measured against these exact files rather than asserted. The same checks ship inside the zip as INTEGRITY.txt, so you can re-run them yourself.

  • Zero orphaned rows joining fact_sales to all four dimensions
  • Zero duplicate keys in dim_date, dim_product, dim_customer and dim_store
  • Electronics is 42.00% of revenue, Home 26.00%, Apparel 20.00%, Grocery 12.00%
  • January 2024 revenue is exactly 820,000.00, as declared
  • December 2024 is exactly 1,150,000.00 and December 2025 exactly 1,480,000.00
  • Checked with DuckDB against these exact files, which shares no code with the generator

Questions it can answer

  • Which category earns most in which region?
  • How does revenue grow month over month across two years?
  • Do premium products sell better to Corporate or to Consumer?
  • Which stores beat their region's average basket size?

Make your own version

The zip includes schema.yaml, which is this dataset's shape and runs as-is. Change a row count, add a column, rename a table: every foreign key still resolves, because referential integrity is a guarantee here rather than something the generator happens to get right.

pip install misata
misata generate --config schema.yaml --output-dir ./data
Read the docs

Other datasets

  • Machine degradation

    100 machines monitored from commissioning to failure, with an exact remaining-useful-life label on every one of 23,118 readings.

  • Ecommerce storefront

    A year of orders across five joined tables, with a real Q4 peak and totals that reconcile to the cent.

  • B2B SaaS subscription analytics

    Accounts, seats, MRR, churn and support load, where company size actually drives the plan.