sql-patterns

Provide reusable SQL patterns and templates for PostgreSQL and MySQL.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/tomlupo/ai-playground --skill sql-patterns-tomlupo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-patterns
Source: https://github.com/tomlupo/ai-playground/tree/main/.claude/skills/sql-patterns
Command: npx skills add https://github.com/tomlupo/ai-playground --skill sql-patterns-tomlupo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides ready-to-use SQL patterns, templates, and best practices to accelerate query writing, schema exploration, and data analysis.

Core Features & Use Cases

  • Common patterns for PostgreSQL and MySQL to speed up data retrieval and schema understanding.
  • Exploratory queries and analytical patterns that help uncover insights, performance issues, and data quality.
  • Flexible use cases: building robust reports, performing ad hoc data analysis, and teaching SQL fundamentals through examples.

Quick Start

Apply the provided PostgreSQL/MySQL patterns to your database by adapting the sample queries to your schema and running them in your environment.

Frequently Asked Questions about sql-patterns

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

FAQPage Schema
What are the best SQL patterns for complex data analysis?

SQL patterns for data analysis provide ready-to-use templates for complex joins, aggregations, and window analytics. These templates accelerate query writing and help uncover insights, performance issues, and data quality across PostgreSQL and MySQL environments.

How do I write window functions in PostgreSQL and MySQL?

To write window functions in PostgreSQL and MySQL, apply reusable SQL templates designed for advanced analytics. These best-practice patterns guide you through executing complex aggregations and window analytics safely within standard database environments.

Does this SQL template collection work with both MySQL and PostgreSQL?

Yes, these SQL templates work with both MySQL and PostgreSQL. The patterns are built for standard SQL environments, allowing you to adapt sample queries for schema exploration and robust data retrieval across both database systems.

How do I explore a database schema using SQL queries?

To explore a database schema using SQL, apply common exploratory query patterns. These templates speed up schema understanding and data retrieval in PostgreSQL and MySQL, helping you quickly map out and navigate database structures.

What is the best way to structure performance-oriented SQL queries?

The best way to structure performance-oriented SQL queries is by applying established best practices and reusable templates. These patterns optimize data retrieval, include safety guidance, and improve query performance in standard SQL environments.

When should I use advanced SQL aggregations instead of standard queries?

You should use advanced SQL aggregations when standard queries cannot handle complex analytics or multi-level data grouping. Applying window functions and reusable templates helps uncover deeper insights and resolve data quality issues efficiently.