Star Schema Designer: Flat Sales File to SQL Warehouse

    1

    Turn a flat sales CSV or Excel file into a star schema: fact and dimension tables with surrogate keys, plus ready-to-run DDL and load scripts for SQL Server, PostgreSQL or SQLite.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Star Schema Designer: Flat Sales File to SQL Warehouse

    Example session with this skill installed

    Here is my cleaned sales file, sales_full.csv. Split it into a star schema for SQL Server and give me the DDL and load scripts.

    • Read your context and instructions
    • Compiled the star schema designer
    • Generated the data export

    Summary

    Designed a star schema from

    420 sales rows and wrote 8 files to the output folder: 5 CSV tables, SQL Server DDL, a load script and a README with a diagram.

    Design

    • Grain: one row per input row (a sales line item)
    • Degenerate dimension: order_id, kept on the fact table
    • Measures: quantity, unit_price, list_price, unit_cost, revenue
    • Date column: order_date

    Tables created

    TableRowsNotes
    fact_sales420Foreign keys to all four dimensions
    dim_date364Full calendar range with year, quarter, month, week, weekday, weekend flag
    dim_product98 products plus an Unknown member
    dim_customer6463 customers plus an Unknown member
    dim_channel4Store, Online, Wholesale plus Unknown

    Files

    schema_sqlserver.sql (tables, primary keys, foreign keys, indexes), load_sqlserver.sql (BULK INSERT), dim_*.csv, fact_sales.csv, README.md

    Things to check

    • Edit the file paths in the load script before running it.
    • This is a Type 1 design: changes to a product name or customer attribute overwrite the old value, so no history is kept.
    • Run the dry run first if you want to change which columns count as measures.

    Next steps

    1. Run schema_sqlserver.sql, then load_sqlserver.sql.
    2. Spot-check that fact revenue equals the revenue total in your source file.
    3. Build the report model with the Power BI Model and DAX Helper.

    fact_sales.csv

    CSV · data export

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    From one flat sales export to a proper data warehouse model

    Star Schema Designer reads a flat sales file, works out the fact table and its dimensions, and writes everything you need to load it into SQL Server, PostgreSQL or SQLite. You see the proposed design first and can adjust it before anything is generated.

    What you get

    • Fact table at line-item grain, with the numeric measures detected automatically
    • Dimension tables (product, customer, channel and more) with integer surrogate keys and an Unknown member for missing values
    • A full date dimension for the whole date range: year, quarter, month, week, weekday, weekend flag
    • Order or invoice IDs kept on the fact as degenerate dimensions
    • DDL with primary keys, foreign keys and indexes on the foreign keys
    • Load scripts (BULK INSERT, psql copy or SQLite import) and a README with the design summary and a Mermaid diagram

    Built for real work

    • Dry-run mode shows the proposed grain, measures and dimensions before generating files.
    • A small JSON config overrides any auto-detection that is wrong.
    • Warns when one product ID maps to several names, and when rows have no valid date.
    • Honest about scope: it generates a Type 1 design, so slowly changing dimensions (history tracking) are not included.

    Requirements

    Python 3.9+ and pip install pandas. No database connection needed: it writes files you load yourself.

    Works great with

    Retail Data Cleaner (clean first) and Power BI Model and DAX Helper (build the report model on top).

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.

    Only supports Type 1 SCD (no history tracking). Requires structured CSV/Excel input. Multi-star or snowflake schemas require separate runs.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed4 days ago

    What's inside

    Frequently Asked Questions

    This skill automates the transition from flat files to a structured data warehouse by identifying dimensions and facts, generating DDL with surrogate keys, and creating the actual load scripts needed to populate your SQL tables.

    The designer currently supports SQL Server, PostgreSQL, and SQLite dialects, and can process data provided in standard CSV or Excel formats.

    Yes, while the skill automates the modeling, you can provide a JSON configuration file to override column groupings, define specific grain levels, or mark attributes as degenerate dimensions.

    You will receive the AI agent skill package, documentation on configuration overrides, and a sample project to help you start modeling your first schema immediately.

    The skill is designed for single-star schemas; if you have a complex multi-fact environment, you should run the tool for each fact table to build out your bus architecture or galaxy schema.

    New in Data & Databases