---
title: "SQL Queries Skill"
type: skill
id: "knowledge-work-plugins/data/sql-queries"
category: "Data"
publisher: "Anthropic"
license: "Apache-2.0"
source: "https://github.com/anthropics/knowledge-work-plugins/tree/d900840"
canonical: "https://labs.pho.chat/en/skills/knowledge-work-plugins/data/sql-queries"
open_in_pho: "https://pho.chat/customize?item=knowledge-work-plugins%2Fdata%2Fsql-queries&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library"
---

# SQL Queries Skill

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.

Source: Anthropic (Apache 2.0), copied at a pinned commit. Free to use. Part of the Phở Skills library (https://labs.pho.chat/en/skills).
Skill set: Data (https://labs.pho.chat/en/skills/knowledge-work-plugins/data.md).

## What it covers
- Dialect-Specific Reference
  - PostgreSQL (including Aurora, RDS, Supabase, Neon)
  - Snowflake
  - BigQuery (Google Cloud)
  - Redshift (Amazon)
  - Databricks SQL
- Common SQL Patterns
  - Window Functions
  - CTEs for Readability
  - Cohort Retention
  - Funnel Analysis
  - Deduplication
- Error Handling and Debugging

## Other skills in this set
- [Answer Data Questions](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/analyze.md): Answer data questions -- from quick lookups to full analyses. Use when looking up a single metric, investigating what's driving a trend or drop, comparing segments over time, or preparing a formal…
- [Build Interactive Dashboards](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/build-dashboard.md): Build an interactive HTML dashboard with charts, filters, and tables. Use when creating an executive overview with KPI cards, turning query results into a shareable self-contained report, building a…
- [Create Visualizations](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/create-viz.md): Create publication-quality visualizations with Python. Use when turning query results or a DataFrame into a chart, selecting the right chart type for a trend or comparison, generating a plot for a…
- [Data Context Extractor](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/data-context-extractor.md): Generate or improve a company-specific data analysis skill by extracting tribal knowledge from analysts. BOOTSTRAP MODE - Triggers: "Create a data context skill", "Set up data analysis for our…
- [Data Visualization Skill](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/data-visualization.md): Create effective data visualizations with Python (matplotlib, seaborn, plotly). Use when building charts, choosing the right chart type for a dataset, creating publication-quality figures, or…
- [Profile and Explore a Dataset](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/explore-data.md): Profile and explore a dataset to understand its shape, quality, and patterns. Use when encountering a new table or file, checking null rates and column distributions, spotting data quality issues…
- [Statistical Analysis Skill](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/statistical-analysis.md): Apply statistical methods including descriptive stats, trend analysis, outlier detection, and hypothesis testing. Use when analyzing distributions, testing for significance, detecting anomalies…
- [Validate Analysis Before Sharing](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/validate-data.md): QA an analysis before sharing -- methodology, accuracy, and bias checks. Use when reviewing an analysis before a stakeholder presentation, spot-checking calculations and aggregation logic, verifying…
- [Write Optimized SQL](https://labs.pho.chat/en/skills/knowledge-work-plugins/data/write-query.md): 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…

## Use it
- In Phở: open https://pho.chat/customize?item=knowledge-work-plugins%2Fdata%2Fsql-queries&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library and press Try, or add it so Phở loads it whenever a request matches. Phở works with your own API key (OpenAI, Anthropic, Google and others).
- Full instructions (original SKILL.md, unchanged): https://labs.pho.chat/skills/raw/knowledge-work-plugins/data/skills/sql-queries/SKILL.md
- Original files: https://github.com/anthropics/knowledge-work-plugins/tree/d900840 (Apache 2.0).
- Full machine-readable index: https://labs.pho.chat/skills.json
