SQL Query Explainer
Understanding or debugging unfamiliar queries. Ideal when you inherit a legacy codebase, review a teammate's pull request, or hit a slow query you did not write. Asking for a plain-English walkthrough before the optimisation notes means you understand the intent first, so you can tell a genuine bug from a deliberate design decision.
The prompt
Explain what this SQL query does in plain English, step by step, then flag any potential performance issues or bugs. [PASTE SQL]
What to replace
Swap these placeholders for your own details before running the prompt:
[PASTE SQL]your own value
How to use this prompt
- Copy the prompt using the button above.
- Replace [PASTE SQL] with your own details — the more specific you are, the better the output.
- Paste it into ChatGPT and run it.
- If the answer feels generic, add constraints: audience, length, tone, and what to avoid. That single change fixes most weak output.
Related prompts
Code Review Pass
Pre-review pass before submitting a pull request
ClaudeWhat RAG Actually Does
RAG (Retrieval-Augmented Generation) retrieves the most relevant passages from your documents and injects them into the prompt before the model answers.
ChatGPTChunking: Why Split Size Matters
Documents are split into chunks before embedding.
ChatGPT / ClaudeCustom GPTs & Claude Projects
Both ChatGPT (Custom GPTs) and Claude (Projects) let you upload documents and set standing instructions — a no-code RAG setup.
ClaudeWriting Docs That Retrieve Well
Retrieval quality starts with document quality.
ChatGPTBlog Post Outline Generator
Planning long-form content before writing
Topics
Related across the site
Debug a Real Bug With AI
Practise the debugging loop that works — evidence first, hypothesis second, fix last — on a bug you actually have. The habit this builds is refusing to accept a fix you cannot explain.
Function calling
Function calling lets a model request that your code run a specific function with specific arguments. You expose tool definitions; the model returns a structured call, your code executes it, and the result goes back into the conversation.
GPT vs Claude vs Gemini: An Honest Comparison
A practical comparison of the three leading AI models across writing, coding, reasoning, long documents and cost — including which one to reach for on which task, and where each genuinely falls short.
Model drift
Model drift is when a hosted model's behaviour changes over time as the provider updates it, causing prompts that worked reliably to degrade without any change on your side.
ReAct pattern
ReAct (Reason + Act) is the core agent loop: the model reasons about what to do, takes an action via a tool, observes the result, then reasons again. It repeats until it can answer.
Refactor Without Breaking It
Improve code structure while proving behaviour is unchanged. Tests the discipline of characterising existing behaviour before changing anything — the part everyone skips.