sql-queries

Guide writing optimized SQL queries across Snowflake, BigQuery, Databricks, PostgreSQL, and Redshift.

10|1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/giadaf-boosha/claude-code --skill sql-queries-giadaf-boosha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-queries
Source: https://github.com/giadaf-boosha/claude-code/tree/main/skills/data-sql-queries
Command: npx skills add https://github.com/giadaf-boosha/claude-code --skill sql-queries-giadaf-boosha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you write correct, performant SQL queries across various data warehouse dialects, making it easier to optimize, translate, and execute complex queries.

Core Features & Use Cases

  • Dialect-Specific Reference: Offers detailed guidance for Snowflake, BigQuery, Databricks, PostgreSQL, Redshift, and Databricks SQL.
  • Common SQL Patterns: Covers window functions, CTEs, cohort retention, funnel analysis, and deduplication.
  • Error Handling and Debugging: Provides tips on common SQL errors and debugging techniques.

Quick Start

Use the sql-queries skill to optimize a slow SQL query on Snowflake.

Frequently Asked Questions about sql-queries

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

FAQPage Schema
How do I optimize slow SQL queries on Snowflake or BigQuery?

To optimize slow SQL queries on data warehouse dialects like Snowflake or BigQuery, apply specific query patterns, use CTEs for readability, and leverage window functions instead of self-joins. This Skill provides dialect-specific guidance for writing performant queries.

What is the best way to write cohort retention and funnel analysis queries?

Cohort retention and funnel analysis queries require structured SQL patterns using common table expressions and window functions. This Skill provides reference implementations to correctly calculate user retention and conversion funnels across major data warehouse platforms.

Does this SQL guidance support Redshift and Databricks dialects?

Yes, this SQL guidance supports Redshift and Databricks SQL dialects, alongside Snowflake, BigQuery, and PostgreSQL. It provides dialect-specific syntax references to translate and execute complex queries correctly across these major data warehouse platforms.

How do I fix common SQL errors and debug data warehouse queries?

Fixing common SQL errors involves dialect-specific debugging techniques and recognizing syntax pitfalls in data warehouse platforms. This Skill provides tips for handling common errors, ensuring correct query execution, and troubleshooting performance bottlenecks.

Can I translate a PostgreSQL query to Snowflake or BigQuery syntax?

Yes, you can translate PostgreSQL queries to Snowflake or BigQuery syntax using the dialect-specific reference guides. This Skill helps resolve syntax differences and optimize queries when migrating or executing SQL across different data warehouse environments.

When should I use CTEs and window functions for data analytics?

You should use CTEs and window functions for data analytics when performing complex calculations like deduplication, cohort retention, or funnel analysis. These common SQL patterns improve query readability and performance in data warehouse environments.