sql-queries

Generates and optimizes SQL queries for five major database platforms.

37|3|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/eren726290/opencode-cowork-plugins --skill sql-queries-eren726290
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-queries
Source: https://github.com/eren726290/opencode-cowork-plugins/tree/main/data/agents/data/skills/sql-queries
Command: npx skills add https://github.com/eren726290/opencode-cowork-plugins --skill sql-queries-eren726290

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write correct, performant, and readable SQL queries across various major data warehouse dialects, saving you time and preventing errors.

Core Features & Use Cases

  • Cross-Dialect SQL Generation: Write SQL for Snowflake, BigQuery, PostgreSQL, Redshift, and Databricks.
  • Query Optimization: Improve the performance of slow-running queries.
  • Complex Query Construction: Build advanced analytical queries using CTEs, window functions, and aggregations.
  • Dialect Translation: Convert SQL queries between different database systems.

Quick Start

Use the sql-queries skill to write a BigQuery SQL query that calculates the 7-day rolling average of daily active users from a table named 'user_activity'.

Frequently Asked Questions about sql-queries

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

FAQPage Schema
How do I write a SQL query that works across Snowflake, BigQuery, and PostgreSQL?

To write cross-dialect SQL queries, you must account for dialect-specific syntax differences. This Skill generates correct and performant SQL for Snowflake, BigQuery, PostgreSQL, Redshift, and Databricks by adapting syntax for CTEs, window functions, and aggregations.

What is the best way to optimize slow-running data warehouse SQL queries?

Optimizing slow SQL queries involves restructuring logic for better performance. This Skill improves query performance by rewriting complex analytical logic using efficient CTEs, window functions, and dialect-specific optimizations across major data warehouse platforms.

Can I translate a PostgreSQL query into Databricks SQL automatically?

Yes, dialect translation converts SQL queries between different database systems. This Skill translates queries between PostgreSQL, Databricks, Snowflake, BigQuery, and Redshift by adjusting syntax for functions, CTEs, and dialect-specific operations.

How do I calculate a 7-day rolling average using SQL window functions?

Calculating a rolling average requires SQL window functions like AVG OVER. This Skill constructs complex analytical queries using window functions to compute metrics such as a 7-day rolling average of daily active users in dialects like BigQuery.

Does this Skill support building cohort analysis queries in Redshift?

Yes, cohort analysis is supported natively. This Skill solves problems related to building advanced analytical queries, including cohort analysis and complex aggregations, specifically tailoring the syntax for Redshift and other supported data warehouses.

When should I use CTEs instead of subqueries for complex data warehousing aggregations?

CTEs improve query readability and maintainability over nested subqueries. This Skill constructs advanced analytical queries using CTEs and window functions to handle complex aggregations efficiently across Snowflake, BigQuery, PostgreSQL, Redshift, and Databricks.