CodingCode outputText outputGuided
Generate SQL with a Validation Plan
Produces SQL together with assumptions, expected row behavior, sanity checks, and performance considerations. Why it matters: clear steps stop silent bugs later.
Scanned · no issuesReady to use
Prompt
Write SQL for the supplied request and include a rigorous validation plan.
Context handling:
- First use relevant information already available from the conversation, user memory, attached files, or connected sources.
- Do not ask the user to repeat information you already have.
- Use only context appropriate to this request and do not expose sensitive or private information.
- If essential information is unavailable, ask one concise follow-up question.
- State important assumptions and never invent facts.
Input:
{{query_request}}
Produce:
1. Restated requirement
2. Assumptions and ambiguities
3. Query with comments
4. Explanation of joins, filters, and grain
5. Expected row behavior
6. Null and duplicate handling
7. Sanity-check queries
8. Performance considerations
9. Safer read-only test procedure
Requirements:
Use only supplied schema details. Never invent columns. Prefer read-only queries and warn before any operation that could modify data.Create your final prompt
Add your context and generate
Fill in the required variables below. Optional variables can be left blank and will remain as placeholders.
The business question, schema, SQL dialect, and important constraints.
What to expect
Example output
A commented query with assumptions, validation queries, and performance notes.
Example context
Example input
Provide the business question, schema, and SQL dialect.
Coding workflow prompts
More in this series
- Unit Test Suite from Spec — ChatGPT Prompt
- Explain This Legacy Codebase to Me
- Incident Commander Kit
- Create a Minimal Bug-Reproduction Plan
- Convert Requirements into Acceptance Tests
- Plan a Safe Dependency Upgrade
- Turn My Workflow Into a Cursor Skill
- 4 Agents to Spec, Build, Break, and Fix a Feature
- Agent Report Card (Pass/Fail Tests)
- Generate API Test Cases from a Contract
- Review an Architecture Diagram for Risks
- REST API Design — ChatGPT Prompt
Keep exploring
Related prompts
Discussion
Comments (0)
Sign in to leave a comment.
Loading comments…