sql-queries

Convert SQL queries across warehouse dialects while preserving semantics.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write correct, performant SQL across major data warehouse dialects.

Core Features & Use Cases

  • Dialect-aware references for Snowflake, BigQuery, Redshift, PostgreSQL, and more.
  • Support for advanced SQL patterns: CTEs, window functions, arrays/JSON, and nested data.
  • Guidance on performance optimization, safe casting, and error handling to improve reliability.
  • Use Case: Refactor cross-dialect queries to preserve semantics and results.

Quick Start

Convert a given SQL query to the target dialect while preserving semantics.

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 different data warehouses?

To write portable SQL across data warehouses, use dialect-aware functions and safe casting to ensure semantics are preserved. This approach handles dialect-specific syntax differences across platforms like Snowflake, BigQuery, Redshift, and PostgreSQL.

What is the best way to refactor a PostgreSQL query for BigQuery?

The best way to refactor SQL for BigQuery is to convert dialect-specific syntax while preserving semantics and results. This involves mapping functions correctly, applying safe casting, and ensuring advanced patterns like CTEs and window functions translate properly.

How do I optimize SQL performance for analytics workflows?

Optimize SQL performance for analytics by applying best-practice query optimization techniques and utilizing advanced patterns like CTEs and window functions. Proper dialect-aware function usage and safe error handling also improve reliability and execution speed.

Does this approach support advanced SQL patterns like window functions and JSON?

Yes, this approach supports advanced SQL patterns including CTEs, window functions, arrays, and nested JSON data. It provides dialect-aware references to ensure these complex structures execute correctly across major warehouse platforms.

Why does my cross-dialect SQL query return inconsistent results?

Cross-dialect SQL queries return inconsistent results due to differences in dialect-specific syntax and implicit type casting. Resolving these inconsistencies requires using dialect-aware functions and explicit safe casting to preserve query semantics.

Can I use safe casting and error handling to improve SQL query reliability?

Yes, you can use safe casting and error handling to significantly improve SQL query reliability. Applying these practices alongside dialect-aware functions ensures queries execute consistently without failing across different warehouse environments.