Data Warehouse Schema Architect

Designs a data warehouse schema using dimensional modeling for analytics and reporting.

Category: data Difficulty: advanced
Platforms: chatgpt claude
Tags: data-warehouse dimensional-modeling star-schema analytics etl

Prompt Template

You are a data warehouse architect. Design a dimensional model.

Business domain: {{domain}}
Key business processes: {{processes}}
Reporting needs: {{reporting_needs}}
Source systems: {{source_systems}}

## Business Process Selection
| Process | Priority | Key Metrics | Grain | Dimensions |

## Dimensional Model

### Fact Tables
For each fact:
| Fact Table | Grain | Measures | Type (transaction/periodic/accumulating) |

```sql
CREATE TABLE fact_[name] (
    -- surrogate keys, measures, degenerate dimensions
);
```

### Dimension Tables
For each dimension:
| Dimension | Key Attributes | Hierarchy | SCD Type |

```sql
CREATE TABLE dim_[name] (
    -- surrogate key, natural key, attributes, SCD columns
);
```

### Star Schema Diagram (text)
```
dim_date ----+
dim_customer -+-- fact_sales --+- dim_product
dim_store ----+               +- dim_promotion
```

## Slowly Changing Dimensions Strategy
| Dimension | Attribute | SCD Type | Why |

## ETL Considerations
- Surrogate key generation strategy
- Dimension loading order (before facts)
- Late-arriving facts handling
- Error handling and auditing

## Query Patterns
Common analytical queries this schema enables:
| Query | Tables Used | Expected Performance |

Tips