sql-analyst

Translate business questions into analytical SQL queries with GROUP BY, window functions, and CTEs.

4|1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xcrrr/claude-skills --skill sql-analyst-xcrrr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-analyst
Source: https://github.com/xcrrr/claude-skills/tree/main/skills/data/sql-analyst
Command: npx skills add https://github.com/xcrrr/claude-skills --skill sql-analyst-xcrrr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Translates business questions into analytical SQL queries that retrieve actionable metrics from relational data, enabling faster, data-driven decisions.

Core Features & Use Cases

  • Analytical patterns: GROUP BY, window functions, CTEs, and subqueries for robust analytics
  • Metrics focus: revenue, retention, cohort analysis, MAU, funnels and dashboards
  • Readable guides: guidance and examples to produce clear, production-ready SQL

Quick Start

Write a query to compute monthly revenue by region from an orders table

Frequently Asked Questions about sql-analyst

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

FAQPage Schema
How do I write a SQL query for cohort analysis and retention metrics?

SQL queries for cohort analysis use CTEs, window functions, and GROUP BY patterns to group users by acquisition date and calculate their subsequent retention metrics across typical relational schemas.

What's the best way to calculate monthly revenue by region using SQL?

The best way to calculate monthly revenue by region is using a SQL query with GROUP BY aggregations on date and region fields, producing readable metrics that summarize revenue across typical relational schemas.

Can I use window functions in SQL to compute MAU and funnel metrics?

Yes, you can compute MAU and funnel metrics using SQL window functions. This Skill generates analytical queries that implement window functions alongside CTEs to produce robust, actionable metrics from relational data.

Does this approach provide DBA-level SQL optimizations for query performance?

No, this approach avoids DBA-level SQL optimizations. It focuses on generating readable, production-ready analytical queries for actionable metrics rather than database administration or deep performance tuning.

How do I turn ad-hoc business questions into readable SQL queries?

You turn ad-hoc business questions into readable SQL queries by providing the natural language request, which the Skill translates into structured patterns like subqueries and CTEs to retrieve actionable metrics.