This is the SQL reference you'll actually use when context-switching between warehouses. It covers the annoying dialect differences that trip you up: date arithmetic syntax, JSON access patterns, case sensitivity quirks. The dialect-specific sections for Snowflake, BigQuery, Postgres, Redshift, and Databricks are genuinely helpful, especially the performance tips like remembering that BigQuery bills per byte scanned or that Snowflake uses clustering keys instead of indexes. The common patterns section shows window functions and CTEs with real examples. It's comprehensive without being a full manual, which means you get answers fast when you're writing a query and can't remember if it's DATEADD or DATE_ADD in this particular warehouse.

skills.sh installs
4.6K
GitHub stars
35.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add anthropics/knowledge-work-plugins --skill sql-queries --agent claude-code

Installs into .claude/skills of the current project.

Files

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:

-- Current date/time
CURRENT_DATE, CURRENT_TIMESTAMP, NOW()

-- Date arithmetic
date_column + INTERVAL '7 days'
date_column - INTERVAL '1 month'

-- Truncate to period
DATE_TRUNC('month', created_at)

-- Extract parts
EXTRACT(YEAR FROM created_at)
EXTRACT(DOW FROM created_at)  -- 0=Sunday

-- Format
TO_CHAR(created_at, 'YYYY-MM-DD')

String functions:

-- Concatenation
first_name || ' ' || last_name
CONCAT(first_name, ' ', last_name)

-- Pattern matching
column ILIKE '%pattern%'  -- case-insensitive
column ~ '^regex_pattern$'  -- regex

-- String manipulation
LEFT(str, n), RIGHT(str, n)
SPLIT_PART(str, delimiter, position)
REGEXP_REPLACE(str, pattern, replacement)

Arrays and JSON:

-- JSON access
data->>'key'  -- text
data->'nested'->'key'  -- json
data#>>'{path,to,key}'  -- nested text

-- Array operations
ARRAY_AGG(column)
ANY(array_column)
array_column @> ARRAY['value']

Sponsors

Details

Repository
github.com/anthropics/knowledge-work-plugins
Categories
Backend & APIs, Documentation, Databases

More from anthropics/knowledge-work-plugins

All 198
1coralogix avatarcoralogix-docscoralogix/cx-cliSearch and read official Coralogix platform documentation using **`cx docs search`** and **`cx docs fetch`**. Use when the user asks how Coralogix features work4.6Kskills.sh installs
2unnoo avatarzsxq-topicunnoo/zsxq-skill知识星球主题管理:搜索主题、查看主题详情、发布帖子、编辑主题、发表评论、回复某条评论(楼中楼)、回答提问、删除主题;通过 api call 查看主题评论列表、设置精华、设置标签、查看自己提的问题与已回答记录。当用户需要查找内容、发帖、编辑主题、评论、回复评论、回答问题、删除主题、查看主题评论、查看自己的提问记录、或管理4.6Kskills.sh installs
3langchain-ai avatarlanggraph-docslangchain-ai/deepagentsFetches and references LangGraph Python documentation to build stateful agents, create multi-agent workflows, and implement human-in-the-loop patterns. Use when4.6Kskills.sh installs
4jeffallan avatarlegacy-modernizerjeffallan/claude-skillsDesigns incremental migration strategies, identifies service boundaries, produces dependency maps and migration roadmaps, and generates API facade designs for a4.6Kskills.sh installs
5napoleond avatarinstaclawnapoleond/instaclawPhoto sharing platform for AI agents. Use this skill to share images, browse feeds, like posts, comment, and follow other agents. Requires ATXP authentication.4.6Kskills.sh installs
6dotnet avatarcsharp-scriptsdotnet/skillsRun file-based C# apps with the .NET CLI when the user explicitly wants C#/.NET code without creating a project. Use for C# language/API experiments, one-file C4.5Kskills.sh installs