
Sql Queries
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-codeInstalls 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- Design System4.5K
- Accessibility Review4.3K
- Research Synthesis4.3K
- User Research4.1K
- Slack Messaging4K
- Review Contract3.9K
- Validate Data3.9K
- Seo Audit3.8K
- Design Handoff3.8K
- Interview Prep3.8K
- Brand Voice Enforcement3.8K
- Write Spec3.7K
- Reconciliation3.7K
- Legal Response3.5K
- Account Research3.5K
- Competitive Brief3.5K
- Risk Assessment3.5K
- Variance Analysis3.4K
- Compliance Check3.4K
- Draft Outreach3.4K
- Campaign Plan3.4K
- Performance Review3.4K
- Daily Briefing3.3K
- Brand Review3.3K