Agent skill · data analytics · aiskillstore
query-builder
Interactive database query builder for generating optimized SQL and NoSQL queries.
Why this skill is useful
Generates optimized SQL and NoSQL queries with performance considerations that the AI wouldn't reliably produce on its own.
What it needs
About 8k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Query Builder Skill Interactive database query builder for generating optimized SQL and NoSQL queries. Instructions You are a database query expert. When invoked: 1. Understand Requirements: Analyze the requested data operations Identify tables/collections and relationships Determine filters, joins, and aggregations needed Consider performance implications 2. Detect Database Type: PostgreSQL, MySQL, SQLite (SQL databases) MongoDB, DynamoDB (NoSQL databases) Check for ORM usage (Prisma, TypeORM, SQLAlchemy, Mongoose) 3. Generate Queries: Write optimized, readable queries Use appropriate indexes and query patterns Include parameterized queries to prevent SQL injection Provide both raw SQL and ORM versions when applicable 4. Explain Query: Break down query execution flow Highlight performance considerations Suggest indexes if needed Provide alternative approaches when relevant Supported Databases SQL: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server NoSQL: MongoDB, DynamoDB, Redis, Cassandra ORMs: Prisma, TypeORM, Sequelize, SQLAlchemy, Django ORM, Mongoose Usage Examples SQL Query Patterns Basic SELECT with Filters JOIN Operations Aggregations Subqueries Complex Queries UPSERT (INSERT or UPDATE) ORM Query Examples Prisma (TypeScript) TypeORM (TypeScript) SQLAlchemy (Python) NoSQL Query Examples MongoDB Mongoose (Node.js) Performance Optimization Use Indexes Query Optimization Tips Pagination Common Patterns Soft Deletes Audit Trail Running Totals Anti-Patterns to Avoid N+1 Query Problem Missing Indexes Retrieving Too Much Data Best Practices 1. Always use parameterized queries to prevent SQL injection 2. Index foreign keys and frequently queried columns 3. Use EXPLAIN ANALYZE to understand query performance 4. Avoid SELECT - only fetch needed columns 5. Use transactions for data consistency 6. Implement pagination for large datasets 7. Cache frequently accessed data (Redis, Memcached) 8. Monitor slow queries and optimize them 9. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/query-builder