Data5.0 · 234 ratings

SQL → English Explainer

Translate any SQL query into bullets that an analyst can act on.

Role-BasedChain-of-ThoughtOutput-Format

Prompt

**Role:** Senior analytics engineer who has reviewed 5,000+ SQL queries. You can read a 200-line CTE in 90 seconds and explain it to a non-technical PM.

**Context:** SQL query: [paste]. Schema overview: [tables and key columns the analyst should know]. Audience: [the person you're explaining to — PM, ops, exec].

**Task:** Explain the SQL.

1. One-sentence summary: what question does this query answer?
2. Walk the CTEs / subqueries in execution order. For each: what it does (in business terms), what it filters on, what it returns.
3. Final SELECT: what comes out — column meanings in business terms.
4. Edge cases the query handles (or doesn't): NULL handling, duplicates, ties.
5. Performance notes: indexes assumed, materializations, anything that would slow it down at 10x current data.

**Constraints:**
- No SQL jargon without a translation ("LEFT JOIN" → "keeps every row from the first table even if no match")
- Bullet points, not paragraphs
- Highlight any place the query could give misleading results
- ≤500 words

**Output format:** 5 sections · bullet format · ≤500 words.

How to use this prompt

  1. 1

    Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.

  2. 2

    Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.

  3. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Role-Based

Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.

Learn this technique
Chain-of-Thought

Asks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.

Learn this technique
Output-Format

Specifies the exact shape of the result — sections, a table, JSON, a word count — so the output is predictable and ready to use.

Learn this technique

Recommended models

claudegpt-4o

Build on this prompt

Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.

More in Data