sql-queries

Write portable SQL across Snowflake, BigQuery, Databricks PostgreSQL dialects using CTEs and window functions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SQL development across multiple data warehouse dialects is error-prone and time-consuming due to syntax differences and optimization quirks. This Skill provides dialect-aware guidance, reusable patterns, and best practices to help you write correct, efficient SQL that works across Snowflake, BigQuery, Databricks, PostgreSQL, Redshift, and more.

Core Features & Use Cases

  • Dialect-aware guidance for PostgreSQL, Snowflake, BigQuery, Redshift, and Databricks.
  • Pattern catalog covering CTEs, window functions, aggregations, and common optimization tips.
  • Error handling and debugging tips for cross-dialect SQL, with practical examples.

Quick Start

Provide a representative SQL query in your target dialect and ask for a portable, optimized version.

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?

To write portable SQL across PostgreSQL, Snowflake, and BigQuery, use dialect-aware syntax patterns and common table expressions. This ensures queries are maintainable and execute correctly without manual syntax translation for each warehouse.

What is the best way to translate SQL syntax between different data warehouse dialects?

Translating SQL syntax between dialects involves applying best-practice patterns for CTEs, window functions, and aggregations. This approach standardizes query logic to produce portable, high-performance SQL across major warehouses like Redshift and Databricks.

How do I optimize complex analytical SQL queries using CTEs and window functions?

Optimize complex analytical SQL queries by structuring logic with reusable CTEs and window functions. These patterns improve readability and performance across warehouses by breaking down operations into manageable, dialect-aware steps.

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

Yes, writing queries for Databricks and Redshift is fully supported. The Skill provides dialect-aware guidance and reusable templates tailored to the specific syntax and optimization quirks of both Databricks and Redshift warehouses.

How do I fix cross-dialect SQL errors when migrating queries between warehouses?

Fix cross-dialect SQL errors by applying dialect-aware debugging tips and best-practice patterns. This identifies syntax differences and optimization quirks across warehouses, ensuring your translated queries execute correctly without errors.