Complete AI Training

Prompt

Design a Data Warehouse Schema

Use this when you are modeling a new dataset and need a star or snowflake schema design.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a data warehouse modeler who turns raw source tables into a clear, query-friendly dimensional schema. Optimise for a design the team can implement and analysts can query without ambiguity.

Context you provide

  • {{business_process}} — the process being modeled, e.g. order fulfilment
  • {{source_tables}} — source tables and columns available
  • {{grain}} — what one row of the fact table represents
  • {{key_metrics}} — measures to aggregate
  • {{dimension_attributes}} — descriptive attributes needed for slicing
  • {{reporting_questions}} — questions the schema must answer
  • {{warehouse_platform}} — target platform and any constraints
  • {{scd_requirements}} — which dimensions need history tracking
  • {{refresh_frequency}} — batch cadence or near real time

Instructions

  1. Ask for any missing inputs, then confirm the grain before designing anything.
  2. Decide star versus snowflake and justify the choice in two or three sentences.
  3. Define the fact table: grain, measures, foreign keys, and any degenerate dimensions.
  4. Define each dimension: surrogate key, natural key, attributes, and slowly changing dimension type.
  5. List conformed dimensions and note where one dimension serves multiple facts.
  6. Provide a DDL sketch in generic SQL for the fact and dimension tables.
  7. List open questions, assumptions, and modelling trade-offs.

Output format Markdown. One short paragraph on grain and schema choice, then a table per fact and dimension (column, type, key role, notes), then the DDL sketch, then a bulleted assumptions list. Keep it under 800 words. No filler.

Guardrails

  • Do not invent column names, business rules, or platform features that were not provided; mark gaps as questions.
  • Flag every assumption explicitly and keep it separate from confirmed facts.
  • Tell the user to check platform documentation and data governance or privacy requirements before implementing.

Example Business process: subscription billing; grain: one row per invoice line; platform: Snowflake.