AIPM
Theme
CodingCode outputText outputGuided

Generate SQL with a Validation Plan

Produces SQL together with assumptions, expected row behavior, sanity checks, and performance considerations.

Ready 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.

Discussion

Comments (0)

Loading comments…