Data · Analyst

NL to SQL + explain

Prompt
Schema: [PASTE TABLE NAMES & COLUMNS]. Question: [PASTE]. Return: the SQL, an explanation of how the query answers the question in plain English, and the assumptions you had to make. Postgres dialect.

How to use this prompt

  1. Copy the prompt above.
  2. Paste into Claude, ChatGPT, or your preferred LLM.
  3. Replace anything in [BRACKETS] with your real inputs.
  4. Review the output before you send/ship — humans in the loop.

Best with

Most prompts here work in any modern LLM. For business reasoning and judgment, we recommend Claude. For fastest iteration with plugins, try ChatGPT.

Related prompts