AI Prompt Whiteboard
English简体中文繁體中文日本語한국어FrançaisDeutschItaliano

Data & BI Updated 2026-07-05

SQL Query Plan Prompt Template and Example

Use this SQL Query Plan prompt template when you want a structured AI answer instead of a loose request. The guide combines the reusable prompt, a concrete example, and links to nearby templates so the page stays useful rather than being a thin keyword page. Plan SQL logic before writing queries, including joins, filters, and checks.

Open SQL Query Plan in the editor

Reusable prompt

Translate an analysis question into a reliable query plan.

Task type: SQL Query Plan
Objective: Translate an analysis question into a reliable query plan.

Context:
- [Project, product, or topic]: [Project, product, or topic]
- [Audience and situation]: [Audience and situation]
- [Constraints, must-haves, and things to avoid]: [Constraints, must-haves, and things to avoid]

Inputs to provide:
[Paste source material here]

Expected output:
1. Data involved
2. Method
3. Data quality notes
4. Verification checklist
5. Caveats

Quality bar:
- Be specific and avoid generic advice.
- State assumptions explicitly.
- Prefer actionable next steps over broad theory.
- If important information is missing, ask up to 3 clarifying questions before answering.
- For time-sensitive or factual claims, label what is known, inferred, and needs verification.

Worked example

The example below fills the same prompt for a realistic Data & BI scenario. It is intentionally modest: the goal is to show how the prompt behaves, not to pretend one template solves every Data & BI problem.

Task type: SQL Query Plan
Objective: Translate an analysis question into a reliable query plan.

Context:
- [Project, product, or topic]: A real Data & BI task using the SQL Query Plan prompt
- [Audience and situation]: A teammate who needs a useful answer and clear next steps
- [Constraints, must-haves, and things to avoid]: Be specific, state assumptions, avoid unsupported claims, and keep the output easy to act on.

Inputs to provide:
Sample material: The team needs help with SQL Query Plan. The current situation is messy, the goal is clear enough to start, and the answer should separate facts, assumptions, risks, and next actions.

Expected output:
1. Data involved
2. Method
3. Data quality notes
4. Verification checklist
5. Caveats

Quality bar:
- Be specific and avoid generic advice.
- State assumptions explicitly.
- Prefer actionable next steps over broad theory.
- If important information is missing, ask up to 3 clarifying questions before answering.
- For time-sensitive or factual claims, label what is known, inferred, and needs verification.

How to use this prompt

  1. Replace the placeholders with the actual SQL Query Plan task, audience, source material, and constraints.
  2. Keep the requested output sections unless you have a strong reason to remove one; they are there to make the AI answer easier to evaluate.
  3. Paste the finished prompt into your AI assistant, then ask one follow-up question that tests assumptions or missing evidence.

What a good answer should contain

  • 1. Data involvedUse this section to make the answer concrete: Data involved.
  • 2. MethodUse this section to make the answer concrete: Method.
  • 3. Data quality notesUse this section to make the answer concrete: Data quality notes.
  • 4. Verification checklistUse this section to make the answer concrete: Verification checklist.
  • 5. CaveatsUse this section to make the answer concrete: Caveats.

Why this prompt works

  • SQL Query Plan starts with an explicit task type and objective, which reduces vague answers.
  • It asks for context, source material, and constraints before the model writes the final response.
  • The 5 output sections make the answer scannable and easier to compare across attempts.
  • The quality bar tells the assistant to ask clarifying questions and mark claims that need verification.

Common mistakes to avoid

  • Leaving placeholders untouched and expecting the model to infer the missing context.
  • Removing the output structure, then asking for a final answer that is hard to review.
  • Using the prompt for time-sensitive facts without checking sources or dates.