dataset
Northstar Commerce dataset
Northstar Commerce is a fictional SQL Trail data world used for relational and analytical commerce work with realistic fan-out traps. It includes visible and hidden deterministic variants for practice.

Purpose and provenance
Northstar Commerce is a fictional-domain SQL Trail dataset used for relational and analytical commerce work with realistic fan-out traps.
Creator/publisher: SQL Trail. Dataset revision/version: northstar-commerce-2026-06-21.
License/distribution policy: SQL Trail original educational content; public reuse and citation policy are documented in Content Standards.
The data is intentionally small, deterministic, and designed to expose nulls, ties, missing relationships, and fan-out traps.
Schema image: /illustrations/datasets/northstar-commerce.webp. The accessible relationship summary below is the canonical text alternative.
Tables, grains, keys, relationships, and row counts
Each table has a stated grain, primary key, foreign-key summary, row count, and column count so learners can reason about joins before writing SQL.
| Table | Grain | Primary key | Foreign keys | Row count | Columns |
|---|---|---|---|---|---|
| calendar_months | one row per reporting month | month_start | none | 4 | 2 |
| categories | one row per product category | category_id | none | 4 | 2 |
| coupons | one row per coupon definition | coupon_id | none | 2 | 3 |
| customers | one row per commerce customer | customer_id | referred_by_customer_id -> customers.customer_id | 5 | 5 |
| order_items | one row per ordered product line | order_item_id | order_id -> orders.order_id; product_id -> products.product_id | 5 | 5 |
| orders | one row per order header | order_id | customer_id -> customers.customer_id | 5 | 4 |
| payments | one row per payment attempt or capture | payment_id | order_id -> orders.order_id | 5 | 5 |
| products | one row per commerce product | product_id | category_id -> categories.category_id | 5 | 6 |
| returns | one row per accepted return event | return_id | order_item_id -> order_items.order_item_id | 3 | 4 |
| shipments | one row per shipment attempt | shipment_id | order_id -> orders.order_id | 3 | 5 |
Intentional edge cases and relationship summary
Relationship summary is provided as text so the page remains useful without inspecting the schema image.
Relationships: customers.referred_by_customer_id -> customers.customer_id; order_items.order_id -> orders.order_id; order_items.product_id -> products.product_id; orders.customer_id -> customers.customer_id; payments.order_id -> orders.order_id; products.category_id -> categories.category_id; returns.order_item_id -> order_items.order_item_id; shipments.order_id -> orders.order_id.
Intentional edge cases include nulls, ties, missing relationships, boundary rows, and fan-out traps when the domain can teach them.
| Table | Relationship check |
|---|---|
| calendar_months | source or lookup table with no outgoing foreign key |
| categories | source or lookup table with no outgoing foreign key |
| coupons | source or lookup table with no outgoing foreign key |
| customers | referred_by_customer_id references customers.customer_id |
| order_items | order_id references orders.order_id; product_id references products.product_id |
| orders | customer_id references customers.customer_id |
| payments | order_id references orders.order_id |
| products | category_id references categories.category_id |
| returns | order_item_id references order_items.order_item_id |
| shipments | order_id references orders.order_id |
Downloadable distributions
Downloadable SQL distributions are published as deterministic seed files for visible, boundary, null, tie, and project variants.
CSV distributions are not published in this release; result-grid CSV export is separate from dataset landing-page downloads.
Do not invent or link a CSV package until the product actually exposes one.
- SQL distribution asset: /sql-datasets/northstar_commerce/visible.sql
- SQL distribution asset: /sql-datasets/northstar_commerce/boundary.sql
- SQL distribution asset: /sql-datasets/northstar_commerce/nulls.sql
- SQL distribution asset: /sql-datasets/northstar_commerce/ties.sql
- SQL distribution asset: /sql-datasets/northstar_commerce/project.sql
Modules, projects, and update history
Modules that use this dataset include M00, M03, M06, M11, M16, M17, and more.
Projects that use this dataset: Northstar Commerce Executive Review.
Update history: northstar-commerce-2026-06-21 is the launch revision for this public dataset page and generated SQL seed files.