Task prompt · Data
Write SQL to answer a business question
by Agent Yard TeamFrom a question to a query that runs.
Use cases
- From a question to a query that runs.
- Reuse it as often as you like: fill in the blanks (tables and columns; business question; database) with new details and copy again.
- With ChatGPT, Claude, Gemini and more, the AIs that support what this prompt needs.
Featured in: Best Claude prompts for coding, Best ChatGPT prompts for Excel and data, Best ChatGPT prompts for SQL and databases.
How to use it
- Open chatgpt.com or claude.ai (or another AI listed here).
- Fill in the highlighted blanks ([TABLES AND COLUMNS], [BUSINESS QUESTION], [DATABASE]) below, or edit them after pasting.
- Copy the prompt, paste it into the chat and send.
Fill in the blanks (optional)
Prompt
My database has these tables: [TABLES AND COLUMNS]. Question: [BUSINESS QUESTION]. Write a [DATABASE] query, explain it, and list assumptions about what the question means (e.g. how "active customer" is defined). Add a quick check query to validate the result.
One email a week
The Weekly is presented byyour brandSponsored · openThe best new prompts and personas, nothing else.