Agent skill
sql-query
Generate and optimize SQL queries for data retrieval and analysis
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/sql-query
SKILL.md
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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?