sql-queries

Generate dialect-specific SQL for major warehouse platforms with built-in patterns and error handling guidance.

Updated Jun 19, 2026
One-click install
npx skills add https://github.com/MuhammadUA/Axe --skill sql-queries-muhammadua
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-queries
Source: https://github.com/MuhammadUA/Axe/tree/main/.kortix/opencode/skills/GENERAL-KNOWLEDGE-WORKER/sql-queries
Command: npx skills add https://github.com/MuhammadUA/Axe --skill sql-queries-muhammadua

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the common pain points of writing SQL that fails across different data warehouse platforms, avoids dialect-specific syntax errors, and ensures queries are both performant and maintainable for analytics and data engineering teams.

Core Features & Use Cases

  • Multi-Dialect Reference: Includes syntax and best practices for PostgreSQL, Snowflake, BigQuery, Redshift, and Databricks SQL covering date/time operations, string functions, JSON/array handling, and platform-specific performance optimizations.
  • Pre-Built Common Patterns: Provides ready-to-use templates for window functions, CTEs, cohort retention analysis, funnel analysis, and record deduplication that can be adapted to any supported dialect.
  • Error Handling Guidance: Offers troubleshooting steps for common SQL failures including syntax errors, type mismatches, division by zero, and ambiguous column issues.
  • Use Case Example: An analytics engineer building a monthly active user report can use the pre-built cohort pattern and dialect-specific date functions to write a single query that works on both Snowflake and BigQuery without rewriting core logic.

Quick Start

Use the sql-queries skill to write a performant funnel analysis query for your e-commerce events table that calculates conversion rates between page view, signup start, signup complete, and first purchase steps, compatible with Snowflake 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 across PostgreSQL, Snowflake, and BigQuery without syntax errors?

To write cross-dialect SQL queries without syntax errors, use dialect-specific reference patterns for date/time operations, string manipulation, and JSON/array handling tailored to PostgreSQL, Snowflake, BigQuery, Redshift, and Databricks to ensure compatibility and performance.

What's the best way to write a cohort retention analysis query for a data warehouse?

The best way to write a cohort retention analysis query is to use pre-built SQL templates that leverage window functions and dialect-specific date functions, allowing you to adapt the core logic for platforms like Snowflake or BigQuery without rewriting the entire query.

How do I optimize funnel analysis queries for conversion rates in BigQuery?

To optimize funnel analysis queries for conversion rates in BigQuery, apply pre-built SQL patterns that calculate step-by-step conversion using platform-specific performance optimizations, ensuring efficient processing of e-commerce events tables and accurate tracking of user progression.

Why does my SQL query fail with ambiguous column issues and type mismatches across different data warehouses?

SQL queries fail with ambiguous column issues and type mismatches due to dialect-specific differences in how data warehouses handle types and column references. Use error handling guidance and troubleshooting steps for common failures to resolve these syntax and type conflicts.

Can I use window functions and CTEs for record deduplication in Redshift and Databricks?

Yes, you can use window functions and CTEs for record deduplication in Redshift and Databricks. Pre-built common patterns provide ready-to-use templates for deduplication that are adapted to supported dialects with specific performance optimizations.

How do I handle division by zero and JSON array data in Snowflake SQL?

To handle division by zero and JSON array data in Snowflake SQL, reference dialect-specific syntax for JSON/array handling and apply error handling guidance for common SQL failures like division by zero, ensuring robust and performant query execution.