sql-query
Generate and optimize SQL queries for data retrieval and analysis
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
SQL Query
Generate SQL queries for data retrieval, analysis, and reporting.
Capabilities
- Generate SELECT, INSERT, UPDATE, DELETE queries
- Build complex JOINs and subqueries
- Aggregate data with GROUP BY and window functions
- Optimize query performance
Query Patterns
Basic Select
SELECT column1, column2
FROM table_name
WHERE condition
ORDER BY column1
LIMIT 100;
Aggregation
SELECT category, COUNT(*) as count, AVG(price) as avg_price
FROM products
GROUP BY category
HAVING COUNT(*) > 10;
Window Functions
SELECT
name,
department,
salary,
RANK() OVER (PARTITION BY department ORDER BY salary DESC) as rank
FROM employees;
Best Practices
- Always use parameterized queries to prevent SQL injection
- Index columns used in WHERE and JOIN clauses
- Avoid SELECT * in production queries
- Use EXPLAIN to analyze query performance
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-02-02
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!