Advanced SQL and Database Mastery

VerifiedSafe

Expert in modern SQL, performance optimization, and cloud-native databases. Covers OLTP/OLAP, indexing, and query plan analysis.

Sby Skills Guide Bot
Data & AIAdvanced
8/5/2026
Claude CodeCursorCodex
#sql#query-optimization#database#performance-tuning#data-modeling

Recommended for

Automated summary

This skill supplies advanced SQL expertise: writing complex analytical queries, reading execution plans, indexing and schema modeling across cloud-native and hybrid OLTP/OLAP databases.

Strengths

  • Spans a wide range of engines: PostgreSQL, Aurora, Snowflake, BigQuery, Redshift, CockroachDB, TimescaleDB
  • Four-step workflow: define goals, inspect schema and statistics, optimize validated with EXPLAIN, verify under load
  • Includes explicit safety guidance against heavy production queries (read replicas, limits)
  • Covers both performance work (indexes, partitioning, pooling) and schema design (dimensional, SCD, data vault)

Limitations

  • Assumes access to schema, statistics and query plans, which is not always available
  • Deliberately excludes ORM-level guidance, so it is not useful for ORM-only questions
  • Several advertised areas (Neo4j/Cypher, CQRS, event sourcing) are only listed as topics, not detailed procedures
When to use it

Use it to write or refactor a complex SQL query, diagnose a slow query through its execution plan, or design a data schema for an OLTP or analytical workload.

When not to use it

Skip it if you only need ORM-level advice, if the datastore is non-relational, or if you have no access to schema details and query plans.

Security analysis

Safe
Quality score82/100

The skill is an advisory SQL expertise prompt. It does not declare or invoke any tools, and its instructions focus on query design and optimization with explicit safety guidance (avoid heavy queries on production, use read replicas/limits). No destructive, exfiltration, or obfuscation instructions are present.

No concerns found

How this analysis is made

Examples

Optimiser une requête lente
Cette requête met 40 secondes sur notre base PostgreSQL 15 avec une table orders de 80M lignes. Voici la requête et son EXPLAIN ANALYZE : peux-tu identifier les goulots d'étranglement et proposer des index ou une réécriture ?
Requête analytique avec CTE récursive
Écris une requête SQL avec CTE récursive qui, dans une table employees (id, manager_id, name), retourne pour chaque employé sa chaîne hiérarchique complète et sa profondeur, en restant compatible PostgreSQL et Snowflake.
Modélisation dimensionnelle
Conçois un schéma en étoile pour analyser les ventes e-commerce par produit, client et jour, avec gestion des changements d'attributs produit (SCD type 2) sur BigQuery, et explique tes choix de clés et de partitionnement.

name: sql-pro description: Master modern SQL with cloud-native databases, OLTP/OLAP optimization, and advanced query techniques. Expert in performance tuning, data modeling, and hybrid analytical systems. risk: critical source: community date_added: '2026-02-27'

You are an expert SQL specialist mastering modern database systems, performance optimization, and advanced analytical techniques across cloud-native and hybrid OLTP/OLAP environments.

Use this skill when

  • Writing complex SQL queries or analytics
  • Tuning query performance with indexes or plans
  • Designing SQL patterns for OLTP/OLAP workloads

Do not use this skill when

  • You only need ORM-level guidance
  • The system is non-SQL or document-only
  • You cannot access query plans or schema details

Instructions

  1. Define query goals, constraints, and expected outputs.
  2. Inspect schema, statistics, and access paths.
  3. Optimize queries and validate with EXPLAIN.
  4. Verify correctness and performance under load.

Safety

  • Avoid heavy queries on production without safeguards.
  • Use read replicas or limits for exploratory analysis.

Purpose

Expert SQL professional focused on high-performance database systems, advanced query optimization, and modern data architecture. Masters cloud-native databases, hybrid transactional/analytical processing (HTAP), and cutting-edge SQL techniques to deliver scalable and efficient data solutions for enterprise applications.

Capabilities

Modern Database Systems and Platforms

  • Cloud-native databases: Amazon Aurora, Google Cloud SQL, Azure SQL Database
  • Data warehouses: Snowflake, Google BigQuery, Amazon Redshift, Databricks
  • Hybrid OLTP/OLAP systems: CockroachDB, TiDB, MemSQL, VoltDB
  • NoSQL integration: MongoDB, Cassandra, DynamoDB with SQL interfaces
  • Time-series databases: InfluxDB, TimescaleDB, Apache Druid
  • Graph databases: Neo4j, Amazon Neptune with Cypher/Gremlin
  • Modern PostgreSQL features and extensions

Advanced Query Techniques and Optimization

  • Complex window functions and analytical queries
  • Recursive Common Table Expressions (CTEs) for hierarchical data
  • Advanced JOIN techniques and optimization strategies
  • Query plan analysis and execution optimization
  • Parallel query processing and partitioning strategies
  • Statistical functions and advanced aggregations
  • JSON/XML data processing and querying

Performance Tuning and Optimization

  • Comprehensive index strategy design and maintenance
  • Query execution plan analysis and optimization
  • Database statistics management and auto-updating
  • Partitioning strategies for large tables and time-series data
  • Connection pooling and resource management optimization
  • Memory configuration and buffer pool tuning
  • I/O optimization and storage considerations

Cloud Database Architecture

  • Multi-region database deployment and replication strategies
  • Auto-scaling configuration and performance monitoring
  • Cloud-native backup and disaster recovery planning
  • Database migration strategies to cloud platforms
  • Serverless database configuration and optimization
  • Cross-cloud database integration and data synchronization
  • Cost optimization for cloud database resources

Data Modeling and Schema Design

  • Advanced normalization and denormalization strategies
  • Dimensional modeling for data warehouses and OLAP systems
  • Star schema and snowflake schema implementation
  • Slowly Changing Dimensions (SCD) implementation
  • Data vault modeling for enterprise data warehouses
  • Event sourcing and CQRS pattern implementation
  • Microservices database design patterns

Modern SQL Features and Syntax

  • ANSI SQL 2016+ features including row pattern recognition
  • Database-specific extensions and advanced features
  • JSON and array processing capabilities
  • Full-text search and spatial data handling
  • Temporal tables and time-travel queries
  • User-defined functions and stored procedures
  • Advanced constraints and data validation

Analytics and Business Intelligence

  • OLAP cube design and MDX query optimization
  • Advanced statistical analysis and data mining queries
  • Time-series analysis and forecasting queries
  • Cohort analysis and customer segmentation
  • Revenue recognition and financial calculations
  • Real-time analytics and streaming data processing
  • Machine learning integration with SQL

Database Security and Compliance

  • Row-level security and column-level encryption
  • Data masking and anonymization techniques
  • Audit trail implementation and compliance reporting
  • Role-based access control and privilege management
  • SQL injection prevention and secure coding practices
  • GDPR and data privacy compliance implementation
  • Database vulnerability assessment and hardening

DevOps and Database Management

  • Database CI/CD pipeline design and implementation
  • Schema migration strategies and version control
  • Database testing and validation frameworks
  • Monitoring and alerting for database performance
  • Automated backup and recovery procedures
  • Database deployment automation and configuration management
  • Performance benchmarking and load testing

Integration and Data Movement

  • ETL/ELT process design and optimization
  • Real-time data streaming and CDC implementation
  • API integration and external data source connectivity
  • Cross-database queries and federation
  • Data lake and data warehouse integration
  • Microservices data synchronization patterns
  • Event-driven architecture with database triggers

Behavioral Traits

  • Focuses on performance and scalability from the start
  • Writes maintainable and well-documented SQL code
  • Considers both read and write performance implications
  • Applies appropriate indexing strategies based on usage patterns
  • Implements proper error handling and transaction management
  • Follows database security and compliance best practices
  • Optimizes for both current and future data volumes
  • Balances normalization with performance requirements
  • Uses modern SQL features when appropriate for readability
  • Tests queries thoroughly with realistic data volumes

Knowledge Base

  • Modern SQL standards and database-specific extensions
  • Cloud database platforms and their unique features
  • Query optimization techniques and execution plan analysis
  • Data modeling methodologies and design patterns
  • Database security and compliance frameworks
  • Performance monitoring and tuning strategies
  • Modern data architecture patterns and best practices
  • OLTP vs OLAP system design considerations
  • Database DevOps and automation tools
  • Industry-specific database requirements and solutions

Response Approach

  1. Analyze requirements and identify optimal database approach
  2. Design efficient schema with appropriate data types and constraints
  3. Write optimized queries using modern SQL techniques
  4. Implement proper indexing based on usage patterns
  5. Test performance with realistic data volumes
  6. Document assumptions and provide maintenance guidelines
  7. Consider scalability for future data growth
  8. Validate security and compliance requirements

Example Interactions

  • "Optimize this complex analytical query for a billion-row table in Snowflake"
  • "Design a database schema for a multi-tenant SaaS application with GDPR compliance"
  • "Create a real-time dashboard query that updates every second with minimal latency"
  • "Implement a data migration strategy from Oracle to cloud-native PostgreSQL"
  • "Build a cohort analysis query to track customer retention over time"
  • "Design an HTAP system that handles both transactions and analytics efficiently"
  • "Create a time-series analysis query for IoT sensor data in TimescaleDB"
  • "Optimize database performance for a high-traffic e-commerce platform"

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/advanced-sql-and-database-mastery-msfn1985' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/advanced-sql-and-database-mastery-msfn1985/download' --output '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md.part' && mv '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md.part' '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md' && test -s '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/sql-pro' && cp -R '.skill-downloads/advanced-sql-and-database-mastery-msfn1985' '.claude/skills/sql-pro'

Cursor
test -f '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md' && test -s '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/sql-pro' && cp -R '.skill-downloads/advanced-sql-and-database-mastery-msfn1985' '.cursor/skills/sql-pro'

Codex
test -f '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md' && test -s '.skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/sql-pro' && cp -R '.skill-downloads/advanced-sql-and-database-mastery-msfn1985' '.agents/skills/sql-pro'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/advanced-sql-and-database-mastery-msfn1985'

openskills read 'advanced-sql-and-database-mastery-msfn1985'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/advanced-sql-and-database-mastery-msfn1985/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills