sql-queries

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable analysts and engineers to write correct, performant, and dialect-aware SQL without memorizing subtle syntax differences across Snowflake, BigQuery, Databricks, PostgreSQL, Redshift, and similar warehouses. The Skill reduces debugging time, avoids costly full-table scans, and helps translate queries between dialects while preserving intent.

Core Features & Use Cases

  • Dialect-aware patterns: Provides idiomatic examples for date/time, string, JSON/array access, and semi-structured data in each major warehouse.
  • Performance guidance: Recommends partitioning, clustering, appropriate functions, and explains EXPLAIN/ANALYZE output to optimize slow queries.
  • Analytics templates: Includes ready patterns for CTE-driven pipelines, window functions, cohort retention, funnels, deduplication, and merges for Delta/transactions.

Quick Start

Use the sql-queries skill to write an optimized BigQuery query that computes monthly active users by cohort from an events table partitioned by event_date.

Frequently Asked Questions about sql-queries

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

FAQPage Schema
How do I translate a PostgreSQL query to Snowflake?

To translate SQL queries between dialects like PostgreSQL and Snowflake, syntax adjustments for dates, strings, and semi-structured data are required. This Skill generates dialect-aware SQL, preserving query intent while applying idiomatic patterns and correct syntax for each warehouse.

What is the best way to optimize slow BigQuery queries and avoid full-table scans?

The best way to optimize slow BigQuery queries is by applying partitioning and clustering to filter data efficiently. This Skill provides performance guidance, recommending specific functions and partitioning strategies to reduce costs and avoid full-table scans.

How do I write SQL window functions for cohort retention analysis?

Writing SQL window functions for cohort retention involves creating CTE-driven pipelines to track user activity over time. This Skill provides ready-to-use analytics templates for cohort retention, funnels, deduplication, and complex window functions across major data warehouses.

Does this Skill support writing queries for both Databricks and Redshift?

Yes, this Skill supports writing queries for both Databricks and Redshift. It targets these specific data warehouses along with Snowflake, BigQuery, and PostgreSQL, generating correct and efficient dialect-aware syntax for each platform.

Why does my Snowflake query performance degrade on large datasets?

Query performance on large datasets often degrades due to missing partitioning or inefficient functions. This Skill helps diagnose issues by recommending performance best practices and providing debugging guidance using EXPLAIN or ANALYZE output to optimize slow queries.