sql-queries

Write and optimize SQL queries across major data warehouse dialects.

6|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/archibate/archibate-skills --skill sql-queries-archibate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-queries
Source: https://github.com/archibate/archibate-skills/tree/main/old-skills/redundant-skills/sql-queries
Command: npx skills add https://github.com/archibate/archibate-skills --skill sql-queries-archibate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces the time, errors, and performance issues involved in writing, translating, and optimizing SQL for analytics by providing dialect-aware examples, performance guidance, and common analytical patterns.

Core Features & Use Cases

  • Dialect translation: Convert and adapt queries between Snowflake, BigQuery, PostgreSQL, Redshift, and Databricks while preserving semantics.
  • Performance optimization: Recommend EXPLAIN usage, partitioning/clustering strategies, indexing advice, and rewrites to reduce cost and latency.
  • Analytical patterns and debugging: Supply idiomatic CTEs, window function patterns, cohort and funnel analyses, deduplication strategies, and Delta Lake operations.
  • Use Case: Translate a Postgres query to BigQuery, optimize it to minimize bytes scanned, and suggest partitioning or clustering changes for long-term performance.

Quick Start

Write an optimized Snowflake query to calculate weekly revenue per product from the sales table partitioned by sale_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 BigQuery without changing the logic?

To translate a PostgreSQL query to BigQuery, dialect-aware translation adapts syntax while preserving semantics, ensuring the analytical logic remains intact across different data warehouse platforms.

What's the best way to optimize SQL queries for large data warehouses?

Optimizing SQL for data warehouses involves using EXPLAIN for profiling, suggesting partitioning or clustering strategies, and applying safe query rewrites to reduce latency and bytes scanned during large-scale execution.

Can I use window functions and CTEs across Snowflake, Redshift, and Databricks?

Yes, you can use window functions and CTEs across Snowflake, Redshift, and Databricks by applying idiomatic analytical patterns that ensure dialect-correct and performant SQL execution for cohort and funnel analyses.

How do I debug slow SQL performance in Snowflake or BigQuery?

Debugging slow SQL performance in Snowflake or BigQuery requires using EXPLAIN guidance for profiling, identifying bottlenecks, and implementing partitioning, clustering, or safe rewrites to minimize execution cost.

Does this approach work for Delta Lake operations and deduplication strategies?

Yes, this approach works for Delta Lake operations and deduplication strategies by supplying idiomatic SQL patterns tailored for Databricks and other warehouses to ensure correct and performant large-scale data processing.