sql-assistant_skill

This skill provides deep SQL expertise to write, debug, optimize, and explain queries across multiple dialects for faster database insights.
  • Python

2.5k

GitHub Stars

3

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill sql-assistant

  • _meta.json283 B
  • package.json588 B
  • SKILL.md10.4 KB

Overview

This skill is a comprehensive SQL query assistant that helps write, debug, optimize, and explain SQL for MySQL, PostgreSQL, SQLite, and other dialects. It supports query construction, performance tuning, schema design, and step‑by‑step explanations aimed at practical, production-ready results. Use it when you need clear, actionable SQL solutions backed by best practices.

How this skill works

The assistant inspects SQL queries, error messages, and database schemas to identify syntax issues, logic bugs, or performance bottlenecks. It suggests corrected queries, index recommendations, and query rewrites, and it explains each change in plain English. When needed it requests the database dialect and schema details to produce dialect‑accurate SQL and execution plan guidance.

When to use it

  • Writing new SELECT/INSERT/UPDATE/DELETE queries for reporting or apps
  • Debugging SQL errors or unexpected results
  • Optimizing slow queries and recommending indexes
  • Explaining complex queries, joins, window functions, or CTEs
  • Designing or normalizing database schemas for performance and integrity

Best practices

  • Always confirm the target SQL dialect before producing final syntax
  • Provide reproducible examples or sample schema to get precise fixes
  • Prefer selecting only required columns instead of SELECT *
  • Use parameterized queries to avoid SQL injection
  • Recommend indexes on frequently filtered/joined columns and check EXPLAIN plans

Example use cases

  • Convert a correlated subquery to an indexed JOIN to improve performance
  • Fix a syntax error and explain why the original failed (e.g., unquoted literals)
  • Design a normalized user/orders schema with primary/foreign keys and indexes
  • Explain a multi-join aggregate query step‑by‑step for analytics teams
  • Rewrite pagination and ranking queries for large datasets using window functions

FAQ

I support MySQL/MariaDB, PostgreSQL, SQLite, and SQL Server/T-SQL. Always tell me the dialect for precise syntax.

Can you help with performance tuning without access to the database?

Yes — I can suggest likely indexing and rewrite strategies based on the query and schema, and recommend running EXPLAIN/EXPLAIN ANALYZE for definitive guidance.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
sql-assistant skill by openclaw/skills | VeilStrat