databases-sql
SQL database querying, optimization, and data management for analytics
When & Why to Use This Skill
This Claude skill provides comprehensive expertise in SQL database querying, performance optimization, and data management tailored for analytics. It enables users to master everything from fundamental relational concepts and complex JOINs to advanced window functions and ETL pipeline design across major platforms like PostgreSQL, BigQuery, and Snowflake, ensuring efficient data extraction and robust database architecture.
Use Cases
- Complex Data Retrieval: Crafting sophisticated SQL queries using CTEs and window functions to extract actionable insights from large-scale datasets for business intelligence.
- Query Performance Optimization: Analyzing execution plans and implementing indexing strategies to significantly reduce query latency and improve system responsiveness.
- Database Architecture & Design: Designing normalized relational schemas or data warehouse structures (star/snowflake schemas) to ensure data integrity and scalability.
- ETL Pipeline Development: Streamlining data workflows by implementing Extract, Transform, and Load processes to move data from operational databases to analytical warehouses.
| name | databases-sql |
|---|---|
| description | SQL database querying, optimization, and data management for analytics |
| version | "2.0.0" |
| sasmp_version | "2.0.0" |
| bonded_agent | 02-sql-databases-expert |
| bond_type | PRIMARY_BOND |
| atomic | true |
| retry_enabled | true |
| max_retries | 3 |
| backoff_strategy | exponential |
| query_timeout | 120 |
| type | string |
| required | false |
| enum | [queries, optimization, design, warehousing, all] |
| default | all |
| logging_level | info |
| metrics | [query_count, execution_time, optimization_score] |
| query_logging | true |
Databases & SQL Skill
Overview
Master SQL and database concepts essential for data analysts, from basic queries to advanced optimization and data warehousing.
Core Topics
SQL Fundamentals
- SELECT, FROM, WHERE, ORDER BY
- JOINs (INNER, LEFT, RIGHT, FULL)
- GROUP BY and aggregate functions
- Subqueries and CTEs
Advanced SQL
- Window functions (ROW_NUMBER, RANK, LAG, LEAD)
- Recursive queries
- Query optimization and execution plans
- Index strategies
Database Concepts
- Relational database design principles
- Normalization and denormalization
- Data warehousing concepts (star schema, snowflake)
- ETL processes
Popular Platforms
- PostgreSQL
- MySQL
- SQL Server
- BigQuery, Redshift, Snowflake
Learning Objectives
- Write efficient SQL queries for data extraction
- Understand database design and optimization
- Work with cloud data warehouses
- Implement ETL processes for analytics pipelines
Error Handling
| Error Type | Cause | Recovery |
|---|---|---|
| Syntax error | Invalid SQL | Validate query syntax before execution |
| Timeout | Long-running query | Add indexes, optimize query |
| Connection failed | Network/auth issue | Retry with exponential backoff |
| Permission denied | Access rights | Request appropriate permissions |
| Deadlock | Concurrent transactions | Retry transaction |
Related Skills
- foundations (for data concepts)
- programming (for SQL with Python/R)
- advanced (for big data processing)