Our review
Helps write, optimize, or explain SQL queries with clarity and best practices.
Strengths
- Produces clean, readable SQL with proper formatting and CTEs
- Detects performance issues like missing indexes or N+1 queries
- Explains queries step-by-step
Limitations
- Requires database type specification for database-specific optimizations
- Cannot tune database server configuration
When you need to write a complex query, optimize a slow one, or understand an unfamiliar SQL statement.
For reporting tool-specific queries that rely on proprietary functions (Power BI, Tableau).
Security analysis
SafeThe skill only provides guidance on writing, optimizing, and explaining SQL queries, with no executable actions or dangerous instructions.
No concerns found
Examples
Write a SQL query to calculate total sales per month for the last year, including product category breakdown. Use PostgreSQL syntax.Optimize this query: SELECT * FROM orders WHERE customer_id IN (SELECT id FROM customers WHERE signup_date > '2020-01-01') ORDER BY created_at;Explain this SQL step by step: SELECT department, avg(salary) OVER (PARTITION BY department) as dept_avg, salary - avg(salary) OVER (PARTITION BY department) as diff FROM employees;name: sql description: This skill should be used when the user asks to "write SQL", "optimize a query", "explain this SQL", or needs help with database queries and SQL best practices.
/sql
Help write, optimize, or explain SQL queries.
Instructions
When the user provides a SQL query or describes what they need:
-
Writing SQL: Generate clean, readable SQL with:
- Proper indentation and capitalization
- CTEs over nested subqueries when complex
- Comments for non-obvious logic
-
Optimizing SQL: Look for:
- Missing indexes (suggest based on WHERE/JOIN columns)
- N+1 patterns
- Unnecessary SELECT *
- Subqueries that could be JOINs
- Opportunities for window functions
-
Explaining SQL: Break down the query step by step, explaining what each part does
Ask for the database type (PostgreSQL, MySQL, BigQuery, etc.) if not specified.
Prompt Engineering
Data & AI
Prompt engineering best practices and templates to maximize AI outputs.
Data Visualization
Data & AI
Generates data visualizations and charts tailored to your data.
RAG Architecture Setup
Data & AI
Setup guide for RAG (Retrieval-Augmented Generation) architectures.