sql-analyst

Optimize SQL queries and design schemas across PostgreSQL, MySQL, and SQLite.

30|7|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/rfdiosuao/openfang-cn --skill sql-analyst-rfdiosuao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-analyst
Source: https://github.com/rfdiosuao/openfang-cn/tree/main/crates/openfang-skills/bundled/sql-analyst
Command: npx skills add https://github.com/rfdiosuao/openfang-cn --skill sql-analyst-rfdiosuao

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill empowers users to write, optimize, and debug SQL queries, design robust database schemas, and perform in-depth data analysis across various SQL dialects.

Core Features & Use Cases

  • Query Optimization: Improve the performance of SQL queries by adding indexes, avoiding common pitfalls, and using EXPLAIN.
  • Schema Design: Create well-structured and normalized database schemas with appropriate data types and constraints.
  • Data Analysis: Leverage window functions and aggregation techniques for insightful data analysis.
  • Use Case: A user needs to optimize a slow-running SELECT query on a PostgreSQL database. They can use this Skill to identify performance bottlenecks and receive recommendations for index creation and query rewriting.

Quick Start

Help me optimize this SQL query for PostgreSQL.

Frequently Asked Questions about sql-analyst

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

FAQPage Schema
How do I optimize a slow SQL query in PostgreSQL?

To optimize a slow SQL query in PostgreSQL, you can use the EXPLAIN command to identify performance bottlenecks, rewrite the query with explicit JOINs, and create appropriate indexes to improve execution speed.

What is the best way to design a normalized database schema?

Designing a normalized database schema involves selecting appropriate data types, applying constraints, and structuring tables to reduce redundancy and ensure data integrity using normalization principles.

Does this SQL optimization approach work with MySQL and SQLite?

Yes, this SQL optimization approach works across multiple SQL dialects including PostgreSQL, MySQL, and SQLite, providing guidance on query tuning, index utilization, and data analysis for each environment.

How do I use window functions and aggregation for data analysis?

You can use window functions and aggregation techniques for SQL data analysis to perform complex calculations across sets of rows, enabling advanced analytical patterns and deeper data insights.

Why should I use parameterized queries and explicit JOINs?

Using parameterized queries and explicit JOINs ensures SQL query readability, prevents SQL injection vulnerabilities, and adheres to database best practices for secure and maintainable code.

What are common SQL query tuning pitfalls to avoid?

Common SQL query tuning pitfalls to avoid include neglecting index utilization, using implicit JOINs, selecting inappropriate data types, and failing to analyze execution plans with EXPLAIN.