ChatGPT prompt to explain a SQL query to non-engineers
A community prompt that has ChatGPT explain a SQL query in plain words for a colleague who reads spreadsheets.
- Model
- ChatGPT
- Task
- Work
- Source
- Shared by @f on GitHub
@f, who maintains the prompts.chat collection, wrote this prompt for handing a query to a stakeholder. ChatGPT explains the business question the SQL answers, the tables and joins, filters and date ranges, and risks such as cartesian joins, missing filters or exposed personal data, then adds a one-paragraph executive summary. Paste your query in place of ${sql}; it is told not to rewrite the query unless you ask.
The prompt is quoted from @f’s entry in prompts.chat on GitHub.
- Prompt
- Explain this SQL for a non-engineer stakeholder.
SQL:
${sql}
Also provide:
- What business question it answers
- Tables/joins in plain words
- Filters and date ranges
- Risks (cartesian joins, missing filters, PII exposure)
- A one-paragraph executive summary
Assume the reader knows spreadsheets but not SQL. Do not rewrite the query unless asked. - What it produces
- Has ChatGPT explain what a SQL query does in plain words, flag its risks and add an executive summary.
- Parameters
- Replace ${sql} with the query you want explained
- Source link
- github.com
- Added
Questions
Who is the explanation written for?
Does it check the query for problems?
Will ChatGPT change my query?
See also
Sources: each prompt is quoted from the official example or the public post linked on its page. Promptline is not affiliated with OpenAI, Anthropic, Google or Midjourney.
