- Home
- Skills
- Data & Databases
- Star Schema Designer: Flat Sales File to SQL Warehouse
Star Schema Designer: Flat Sales File to SQL Warehouse
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
Works with the AI Agents you already use
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
| Table | Rows | Notes |
|---|---|---|
| fact_sales | 420 | Foreign keys to all four dimensions |
| dim_date | 364 | Full calendar range with year, quarter, month, week, weekday, weekend flag |
| dim_product | 9 | 8 products plus an Unknown member |
| dim_customer | 64 | 63 customers plus an Unknown member |
| dim_channel | 4 | Store, 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
- Run schema_sqlserver.sql, then load_sqlserver.sql.
- Spot-check that fact revenue equals the revenue total in your source file.
- Build the report model with the Power BI Model and DAX Helper.
fact_sales.csv
CSV · data export
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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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