Skip to content

Phở Founder Lifetime: $59 once, 1 year of Phở AI included. Limited seats. See the offer

Data · Skill

Write Optimized SQL

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.

Open in Phở

What the skill covers

The sections of its instructions, in order.

  1. 01 Usage
  2. 02 Workflow
  3. 1. Understand the Request
  4. 2. Determine SQL Dialect
  5. 3. Discover Schema (If Warehouse Connected)
  6. 4. Write the Query
  7. 5. Present the Query
  8. 6. Offer to Execute
  9. 03 Examples
  10. 04 Tips

More in Data

  • Answer Data Questions

    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…

  • Build Interactive Dashboards

    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…

  • Create Visualizations

    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…

  • Data Context Extractor

    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…

  • Data Visualization Skill

    Create effective data visualizations with Python (matplotlib, seaborn, plotly). Use when building charts, choosing the right chart type for a dataset, creating…

  • Profile and Explore a Dataset

    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…

  • 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…

  • Statistical Analysis Skill

    Apply statistical methods including descriptive stats, trend analysis, outlier detection, and hypothesis testing. Use when analyzing distributions, testing for significance…

  • Validate Analysis Before Sharing

    QA an analysis before sharing -- methodology, accuracy, and bias checks. Use when reviewing an analysis before a stakeholder presentation, spot-checking calculations and…

Similar data skills

Frequently asked questions

What does Write Optimized SQL do?

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.

Is Write Optimized SQL free to use?

Yes. Write Optimized SQL is published by Anthropic under the Apache 2.0 licence, and you can use it with a free Phở account.

How do I use Write Optimized SQL in Phở?

Press Open in Phở, then Try to apply it to your next message, or add the Data set so Phở loads it whenever a request matches.

Does Write Optimized SQL need other tools?

No. It works in a normal Phở chat with what you type or upload.

Copied unchanged from anthropics/knowledge-work-plugins at commit d900840 and credited to Anthropic, who is not affiliated with Phở. The full instructions and licence text ship with the skill inside Phở.