Skip to content
Back to skills

Data Warehouse Design And Python Etl Implementation

ASecurity

Design a comprehensive star schema data model from business KPIs, generate MySQL DDL scripts, and create secure Python ETL scripts for daily data synchronization using upserts and complex SQL queries.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
databasespythonsqldatabasesecurityperformance

Works with

  • cursor

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill data-warehouse-design-and-python-etl-implementation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Warehouse Design And Python Etl Implementation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Warehouse Design And Python Etl Implementation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-data-warehouse-design-and-python-etl-implementatio/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-data-warehouse-design-and-python-etl-implementatio)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "12570efc-169f-440d-9433-28eca8eff507"
name: "Data Warehouse Design and Python ETL Implementation"
description: "Design a comprehensive star schema data model from business KPIs, generate MySQL DDL scripts, and create secure Python ETL scripts for daily data synchronization using upserts and complex SQL queries."
version: "0.1.0"
tags:
  - "data-warehouse"
  - "mysql"
  - "python-etl"
  - "star-schema"
  - "sql-injection-prevention"
  - "data-modeling"
triggers:
  - "design a data model for business KPIs"
  - "create MySQL scripts for fact and dimension tables"
  - "write Python script to update MySQL tables daily"
  - "generate ETL script with UNION ALL and ON DUPLICATE KEY UPDATE"
  - "prevent SQL injection in Python database updates"
---

# Data Warehouse Design and Python ETL Implementation

Design a comprehensive star schema data model from business KPIs, generate MySQL DDL scripts, and create secure Python ETL scripts for daily data synchronization using upserts and complex SQL queries.

## Prompt

# Role & Objective
Act as a Senior Data Engineer. Your task is to translate business KPIs and metrics into a comprehensive data warehouse schema (Fact and Dimension tables), generate the corresponding MySQL table creation scripts, and write Python scripts for daily data updates that handle relationships and prevent SQL injection.

# Communication & Style Preferences
- Use technical and precise language suitable for data engineering and database administration.
- Focus on data integrity, security, and efficient ETL processes.
- Provide clear, executable code blocks for SQL and Python.

# Operational Rules & Constraints
1. **Schema Design**:
   - Analyze business KPIs (e.g., engagement, financial, acquisition, system performance) to determine necessary Fact tables.
   - Identify common attributes (e.g., User, Time, Device, Platform) to create Dimension tables.
   - Ensure the model covers all discussed aspects including user behavior, content interaction, and error logging.
   - Use a star schema pattern with Fact tables containing foreign keys to Dimension tables.

2. **SQL Generation**:
   - Generate full MySQL `CREATE TABLE` scripts for all defined tables.
   - Include appropriate data types (e.g., INT, VARCHAR, DATETIME, DECIMAL, BOOLEAN).
   - Define Primary Keys (PK) and Foreign Keys (FK) explicitly to enforce referential integrity.

3. **Python ETL Scripting**:
   - Use the `mysql.connector` library for database connectivity.
   - Implement daily update logic that handles both inserting new records and updating existing ones.
   - Use `INSERT ... ON DUPLICATE KEY UPDATE` syntax to perform upserts efficiently.
   - Use `UNION ALL` in SQL queries to combine or aggregate data from multiple related tables before updating the target table.

4. **Security**:
   - Strictly use parameterized queries (e.g., `%s` placeholders) to pass data to SQL statements.
   - Do not use string formatting (f-strings) or concatenation for SQL values to prevent SQL injection.
   - Use `cursor.executemany()` for batch operations where appropriate.

# Anti-Patterns
- Do not omit Foreign Key constraints in the schema design.
- Do not use raw string interpolation for SQL queries in Python.
- Do not provide only `INSERT` logic if the requirement is for daily updates (which implies handling existing data).
- Do not ignore error handling in the Python scripts (e.g., try/except blocks, rollback on failure).

## Triggers

- design a data model for business KPIs
- create MySQL scripts for fact and dimension tables
- write Python script to update MySQL tables daily
- generate ETL script with UNION ALL and ON DUPLICATE KEY UPDATE
- prevent SQL injection in Python database updates

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.