Sign in
Explore
Skills · SkillData & AIData pipelinesData analysis & BIReviewed

sql-queries

Writes and optimizes SQL for Snowflake, BigQuery, Databricks, PostgreSQL and other dialects, including CTEs, window functions and dialect translation.

Kind
Skill
Works with
Claude Code
Languages
SQL
Source
Claude knowledge-work plugins @ 2574e29377c7
Path
data/skills/sql-queries/SKILL.md
Jobs
Implementation
Topics
Data pipelines, Data analysis & BI

Credit

Made by
anthropics
Original
github.com/anthropics/knowledge-work-plugins/blob/2574e29377c…
License
Apache-2.0

Listed by Skill Manifest; not made by us.

InstallInstall it from a plugin marketplace.
claude plugin install data@knowledge-work-plugins
Install factsScanned 2 Nov 2026
Adds
  • .claude/skills/sql-queries/ (the skill folder)
Runs scripts
None found
Uses the network
None found
Needs secrets
None found
Source revision
2574e29377c7
Licence
Apache-2.0
Last activity
1 Nov 2026
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

  • Only the main file is read; other files in the folder are not scanned
# 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:**
```sql
-- 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:**
```sql
-- 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:**
```sql
-- 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']
```

**Performance tips:**
- Use `EXPLAIN ANALYZE` to profile queries
…