dimensional-modeling

Designs star and snowflake schemas with fact tables, dimensions, and SQL examples.

Updated Dec 29, 2025
One-click install
npx skills add https://github.com/snoodleboot-io/discrecontinual_equations --skill dimensional-modeling-snoodleboot-io
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dimensional-modeling
Source: https://github.com/snoodleboot-io/discrecontinual_equations/tree/main/.claude/skills/dimensional-modeling
Command: npx skills add https://github.com/snoodleboot-io/discrecontinual_equations --skill dimensional-modeling-snoodleboot-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing analytical databases without a clear dimensional structure leads to slow queries, redundant data, and unmaintainable schemas. This Skill provides concrete patterns and SQL templates for building star schemas, fact tables, and dimension tables correctly from the start. ## Core Features & Use Cases - Star Schema Design: Templates for fact tables with surrogate keys, foreign keys, measures, and flags, plus dimension tables with SCD Type 2 support. - Schema Trade-off Guidance: Side-by-side comparison of star (denormalized) versus snowflake (normalized) schemas with query examples. - Design Patterns: Covers conformed dimensions, junk dimensions, grain definition, aggregation tables, and slowly changing dimensions (Type 1 and Type 2). - Use Case: When building a sales analytics warehouse, use this Skill to define the fact_sales grain, create dim_customer with history tracking, and write optimized star queries grouped by segment and month. ## Quick Start Ask the AI to design a star schema for a sales fact table with customer, product, and date dimensions including SCD Type 2 history tracking.

Frequently Asked Questions about dimensional-modeling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a star schema for a data warehouse?▼

Star schema design starts with a central fact table containing foreign keys and measures, surrounded by denormalized dimension tables. Define the grain first (e.g., one row per order line), then add surrogate keys, dimensions like customer and date, and numeric measures such as revenue and quantity.

What is the difference between star schema and snowflake schema?▼

A star schema uses denormalized dimensions requiring only 1-2 joins, making queries fast but storing redundant data. A snowflake schema normalizes dimensions into sub-tables, reducing redundancy at the cost of additional joins and more complex queries.

How do I implement slowly changing dimensions Type 2 in SQL?▼

SCD Type 2 preserves history by closing the current row (setting end_date and is_current = FALSE) and inserting a new row with the updated attribute values. Each dimension row includes start_date, end_date, and is_current columns to track validity periods.

When should I use aggregation tables in a data warehouse?▼

Use aggregation tables when fact table detail is too granular for dashboard queries, causing slow aggregations. Pre-aggregate measures by common dimensions like day, product, and region so summary queries scan far fewer rows.

What are common dimensional modeling mistakes to avoid?▼

Common mistakes include using too many dimensions (keep to 10-15 key ones), making fact tables overly detailed without aggregation tables, and joining on business keys instead of integer surrogate keys. Each of these degrades query performance significantly.