sql-queries

Write dialect-aware SQL for PostgreSQL, Snowflake, BigQuery, Redshift, and Databricks.

2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/miptah21/skills --skill sql-queries-miptah21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-queries
Source: https://github.com/miptah21/skills/tree/main/.agents/skills/sql-queries
Command: npx skills add https://github.com/miptah21/skills --skill sql-queries-miptah21

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents slow, incorrect, and dialect-incompatible SQL by giving you reliable patterns for writing analytical queries across major data warehouses.

Core Features & Use Cases

  • Dialect-aware SQL: Covers key syntax differences for PostgreSQL, Snowflake, BigQuery, Redshift, and Databricks so your queries run correctly where you deploy them.
  • Analytical query patterns: Provides reusable guidance for CTEs, window functions, cohort retention, funnel analysis, and deduplication.
  • Debugging and correctness checks: Helps you handle common issues like syntax errors, missing columns, type mismatches, division by zero, ambiguous columns, and GROUP BY mistakes.

Quick Start

Use the sql-queries skill to translate and optimize your existing analytical SQL for Snowflake, ensuring it uses correct date/time, string, and JSON/array syntax.

Frequently Asked Questions about sql-queries

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

FAQPage Schema
How do I write SQL queries that work correctly across PostgreSQL, Snowflake, and BigQuery?

To write cross-dialect SQL, you need dialect-aware syntax handling for dates, strings, and JSON arrays. This Skill translates and generates analytical SQL with correct syntax for PostgreSQL, Snowflake, BigQuery, Redshift, and Databricks.

What is the best way to optimize slow data warehouse queries using CTEs and window functions?

Optimize slow data warehouse queries by applying readable CTE structures and targeted window functions. This Skill provides reusable analytical patterns for aggregations and cohort retention to ensure your SQL is performant.

How do I fix GROUP BY errors and division by zero in analytical SQL?

Fix GROUP BY errors and division by zero using built-in correctness safeguards. This Skill identifies common SQL mistakes like ambiguous columns, type mismatches, and missing columns to ensure accurate query execution.

Can I use this to translate existing PostgreSQL analytical queries to Snowflake?

Yes, you can translate existing PostgreSQL analytical queries to Snowflake. This Skill handles dialect-specific syntax translation for key differences in date/time, string, and JSON/array functions across major data warehouses.

What SQL patterns are available for cohort retention and funnel analysis?

SQL patterns for cohort retention and funnel analysis use structured CTEs and window functions. This Skill provides reusable guidance for these complex analytical queries, including deduplication patterns, to ensure correct results.