sql-queries

Generate SQL queries across Snowflake, BigQuery, Databricks, PostgreSQL, and Redshift.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users write correct, performant, and readable SQL queries across various major data warehouse dialects, addressing challenges with syntax, optimization, and translation.

Core Features & Use Cases

  • Cross-Dialect Support: Generates SQL for Snowflake, BigQuery, Databricks, PostgreSQL, and Redshift.
  • Advanced Query Patterns: Provides examples for window functions, CTEs, cohort retention, funnel analysis, and deduplication.
  • Optimization Guidance: Offers tips on performance tuning specific to each dialect.
  • Use Case: Translate a complex PostgreSQL query involving window functions into an equivalent query for BigQuery, ensuring optimal performance on both platforms.

Quick Start

Use the sql-queries skill to write a BigQuery query to calculate monthly active users.

Frequently Asked Questions about sql-queries

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

FAQPage Schema
How do I write performant SQL queries for BigQuery and Snowflake?

To write performant SQL queries for BigQuery and Snowflake, you need dialect-specific syntax and performance tuning. This capability generates optimized SQL tailored to your target data warehouse, ensuring efficient execution of complex analytical patterns like window functions and CTEs.

Can I translate a PostgreSQL query with window functions to BigQuery?

Yes, you can translate PostgreSQL queries to BigQuery by adjusting syntax for dialect-specific features. This process converts complex analytical logic, including window functions and cohort retention patterns, into equivalent, optimized BigQuery SQL.

What is the best way to calculate monthly active users using SQL?

Calculating monthly active users using SQL requires applying specific analytical patterns like aggregation and deduplication. You can generate readable SQL queries that implement these patterns correctly for your chosen data warehouse dialect.

Does this SQL generation approach support cohort retention and funnel analysis?

Yes, this SQL generation approach supports cohort retention and funnel analysis by providing advanced query patterns. It structures complex analytical logic into readable SQL, ensuring correct calculations across data warehouse platforms like Databricks and Redshift.

How do I optimize SQL queries for different data warehouse dialects?

Optimizing SQL queries for different data warehouse dialects requires understanding specific platform features and performance tuning techniques. This approach generates queries with built-in optimization guidance tailored to each dialect's execution engine.

Why does my SQL query performance drop when moving between data warehouses?

SQL query performance drops when moving between data warehouses due to dialect-specific syntax and execution differences. Translating queries directly without dialect-specific performance tuning often leads to suboptimal execution plans across platforms.