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.

Recommended models

claudegpt-4o

More in Data