sql-expert

Optimize SQL queries and schema designs for PostgreSQL, MySQL, SQLite, and BigQuery.

2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/traylinx/switchAILocal --skill sql-expert-traylinx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-expert
Source: https://github.com/traylinx/switchAILocal/tree/main/plugins/cortex-router/skills/sql-expert
Command: npx skills add https://github.com/traylinx/switchAILocal --skill sql-expert-traylinx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SQL query writing, optimization, and database design can be time-consuming and error-prone. This Skill provides expert guidance to craft efficient queries and scalable schemas, reducing latency and maintenance overhead.

Core Features & Use Cases

  • Query optimization: Suggest indexing strategies, query rewrites, and execution plan improvements for PostgreSQL, MySQL, SQLite, and BigQuery.
  • Schema design: Propose normalization/denormalization approaches, data modeling, and table relationships to support scalable analytics.
  • Real-world examples: Provide practical SQL snippets demonstrating complex joins, window functions, and efficient pagination in large datasets.

Quick Start

Provide an optimized SQL rewrite for the following example: SELECT * FROM orders o JOIN customers c ON o.customer_id = c.id WHERE o.order_date >= '2023-01-01' ORDER BY o.order_date DESC LIMIT 100;

Frequently Asked Questions about sql-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow SQL queries in PostgreSQL or MySQL?

Query optimization involves analyzing execution plans, adding strategic indexes, and rewriting inefficient joins. This Skill identifies bottlenecks in your SQL and suggests indexing strategies, query rewrites, and execution plan improvements to reduce latency across PostgreSQL, MySQL, SQLite, and BigQuery workloads.

What's the best way to design a database schema for analytics?

Schema design balances normalization for data integrity with denormalization for query speed. This Skill proposes normalization and denormalization approaches, table relationships, and data modeling strategies to build scalable schemas that support complex analytics without maintenance overhead.

Can I use window functions and complex joins to handle large datasets efficiently?

Yes. Window functions and optimized joins are core techniques for processing large datasets without scanning entire tables. This Skill provides practical SQL snippets demonstrating complex joins, window functions, and efficient pagination patterns tailored to your database platform.

Does this work with BigQuery as well as traditional SQL databases?

Yes. This Skill applies across PostgreSQL, MySQL, SQLite, and BigQuery, accounting for each platform's dialect differences, indexing strategies, and query execution models to produce dialect-specific optimizations and maintainable solutions.

What indexing strategies improve query performance on large tables?

Indexing reduces query time by enabling fast data lookups instead of full table scans. This Skill recommends specific index types, composite indexes, and indexing trade-offs for your schema and query patterns to balance read performance with write overhead.