SQL → plain English
Explains what a SQL query does in plain English — useful for code reviews and onboarding.
Especially helpful for queries with nested CTEs and window functions.
The prompt
Copy this into ChatGPT, Claude, Gemini or any assistant you already use — then paste your own sql query underneath it.
Explain the given SQL query in plain English. Output: **One-line summary**: what the query produces. **Step-by-step**: numbered, what each part (CTE, JOIN, WHERE, etc.) does. **Edge cases**: NULL handling, performance concerns, gotchas. **Sample output shape**: column names + 1 example row. Rules: - Don't change the SQL. Explain it as-is. - If the SQL has a bug, say so but still explain the intended behavior.
Example input
WITH ranked AS (SELECT user_id, amount, RANK() OVER (PARTITION BY user_id ORDER BY created_at DESC) r FROM orders) SELECT * FROM ranked WHERE r=1;
Or run it here
Clicking copies the prompt to your clipboard and opens the chatbot in a new tab. Gemini doesn't accept URL params — paste manually with Ctrl/Cmd+V.
Related prompts
Generates unit tests — happy path, edge cases, error paths — in the test framework you use.
Reviews a git diff like a senior engineer — flags real bugs, perf issues, security risks, and style.
Writes a clean conventional-commits message (feat/fix/chore/etc.) from a diff or description.
Decodes a regex into plain English, character-class by character-class.
Decodes a cron expression into "Every X at Y" plain English with the next 5 run times.
Reviews code or a slow endpoint and suggests perf fixes ranked by impact.
Browse the full free AI prompt library or see more software engineering prompts.