Agent skill · data analytics · anthropics
sql-queries
Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.). Use when writing queries, optimizing slow SQL, translating between dialects, or building complex analytical queries with CTEs, window functions, or aggregations.
Why this skill is useful
Provides detailed, dialect-specific SQL commands and performance optimization techniques that the AI wouldn't reliably generate on its own.
What it needs
About 5k tokens when loaded. Last updated 2026-08-07. 23,345 stars on the source repository.
What this skill does
SQL Queries Skill Write correct, performant, readable SQL across all major data warehouse dialects. Dialect-Specific Reference PostgreSQL (including Aurora, RDS, Supabase, Neon) Date/time: String functions: Arrays and JSON: Performance tips: Use EXPLAIN ANALYZE to profile queries Create indexes on frequently filtered/joined columns Use EXISTS over IN for correlated subqueries Partial indexes for common filter conditions Use connection pooling for concurrent access --- Snowflake Date/time: String functions: Semi-structured data: Performance tips: Use clustering keys on large tables (not traditional indexes) Filter on clustering key columns for partition pruning Set appropriate warehouse size for query complexity Use RESULTSCAN(LASTQUERYID()) to avoid re-running expensive queries Use transient tables for staging/temp data --- BigQuery (Google Cloud) Date/time: String functions: Arrays and structs: Performance tips: Always filter on partition columns (usually date) to reduce bytes scanned Use clustering for frequently filtered columns within partitions Use APPROXCOUNTDISTINCT() for large-scale cardinality estimates Avoid SELECT -- billing is per-byte scanned Use DECLARE and SET for parameterized scripts Preview query cost with dry run before executing large queries --- Redshift (Amazon) Date/time: String functions: Performance tips: Design distribution keys for collocated joins (DISTKEY) Use sort keys for frequently filtered columns (SORTKEY) Use EXPLAIN to check query plan Avoid cross-node data movement (watch for DSBCAST and DSDIST) ANALYZE and VACUUM regularly Use late-binding views for schema flexibility --- Databricks SQL Date/time: Delta Lake features: Performance tips: Use Delta Lake's OPTIMIZE and ZORDER for query performance Leverage Photon engine for compute-intensive queries Use CACHE TABLE for frequently accessed datasets Partition by low-cardinality date columns --- Common SQL Patterns Window Functions CTEs for Readability Cohort Retention Funnel Analysis …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills anthropics/sql-queries