---
stable_id: skills/knowledge-work-plugins-data-skills-write-query-skill
type: skills
title: write-query
summary: Write optimized SQL for your dialect with best practices. Use when
  translating a natural-language data need into SQL, building a multi-CTE query
  with joins and aggregations, optimizing a query against a large partitioned
  table, or getting dialect-specific syntax for Snowflake, BigQuery, Postgres,
  etc.
tags:
  - source-knowledge-work-plugins
  - plugin-data
  - plugin-component-skills
  - plugin-skill
  - category-data-analytics
source_url: https://raw.githubusercontent.com/anthropics/knowledge-work-plugins/main/data/skills/write-query/SKILL.md
license: ""
upstream_ref: https://github.com/anthropics/knowledge-work-plugins/blob/main/data/skills/write-query/SKILL.md
github_stars: null
github_forks: null
github_is_organization: null
retrieved_at: 2026-06-11T08:32:48.816Z
content_sha256: 4c7ef791db1f23504c457cc52de0d8855d26f176d5acf037260deb1b98e5e34e
---
