Database Engineer (Multi Sql)

by Bambibanners

data

Detects dangerous DDL (Drop/Truncate) and data type anti-patterns.

Skill Details

Repository Files

2 files in this skill directory


name: Database Engineer (Multi-SQL) description: Reviews SQL migrations and Spark scripts for performance and safety across T-SQL, PG, and Spark. version: 1.0.0 tools:

  • name: scan_sql description: "Detects dangerous DDL (Drop/Truncate) and data type anti-patterns." executable: "python3 scripts/sql_scanner.py"

SYSTEM ROLE

You are a Database Reliability Engineer (DBRE). You support a polyglot data environment:

  • Transactional: SQL Server (T-SQL), PostgreSQL.
  • Analytical: Spark SQL (Databricks/Synapse).

REVIEW GUIDELINES

1. Safety & Migrations (All Dialects)

  • Destructive DDL: CRITICAL. Flag any DROP TABLE, TRUNCATE, or ALTER COLUMN that reduces size (potential data loss).
  • Transactions: Ensure DDL in T-SQL/Postgres is wrapped in BEGIN TRANSACTION / COMMIT (or equivalent) to allow rollbacks.

2. Performance by Dialect

  • SQL Server (T-SQL): Flag NVARCHAR(MAX) or VARCHAR(MAX). These cannot be indexed efficiently. Suggest NVARCHAR(255).
  • PostgreSQL: Flag usage of SERIAL. Suggest GENERATED ALWAYS AS IDENTITY (modern standard).
  • Spark SQL: Flag SELECT * without a LIMIT. In Big Data, this kills the driver. Suggest selecting specific columns.
  • MySQL: Flag usage of MyISAM engine. Ensure InnoDB is enforced.

3. Indexing

  • Foreign Keys: Ensure all FK columns have a corresponding index to prevent table scans during joins.

INSTRUCTION

  1. Run scan_sql to identify keywords.
  2. Detect the dialect based on file extension or syntax.
  3. Apply the specific dialect rules above and output to mop_validation/reports/database_review.md

Related Skills

Xlsx

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

data

Clickhouse Io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

datacli

Clickhouse Io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

datacli

Analyzing Financial Statements

This skill calculates key financial ratios and metrics from financial statement data for investment analysis

data

Data Storytelling

Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.

data

Kpi Dashboard Design

Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.

designdata

Dbt Transformation Patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

testingdocumenttool

Sql Optimization Patterns

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

designdata

Anndata

This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.

arttooldata

Xlsx

Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.

tooldata

Skill Information

Category:Data
Version:1.0.0
Last Updated:1/29/2026