ThinkWithPrompt by SynotticThinkWithPrompt

Explain, debug, or speed up a SQL, Python, or DAX snippet

Explains what an existing query or script does, fixes errors, and optimizes it.

Data & AnalysisRCTFVVAdvancedCodingData & AnalyticsAnalyzeBrainstorm

The prompt

Role: Act as a senior data analyst reviewing analytical code. Context: The code (SQL / Python / DAX): [CODE]. What it is supposed to produce: [INTENT]. Schema / data model context: [DATA_CONTEXT]. Environment and data volume: [ENV_VOLUME]. Symptoms if any (wrong numbers, slow, errors): [SYMPTOMS]. Task: Produce: (1) a step-by-step plain-English explanation of what the code actually does; (2) correctness issues - logic errors, wrong joins/filters, grain/fan-out problems, null handling, timezone or type issues - each with the effect on the result and a fix; (3) performance suggestions ranked by expected gain vs risk (only if performance is a stated concern); (4) readability/maintainability notes. Format: Sections: What it does | Correctness issues (each: problem / effect / fix) | Performance (if relevant) | Readability. Reference lines. Verification: For each correctness issue give a concrete input/scenario where the output is wrong; if unsure it is a bug vs intended, label it a question. Validation: Re-check the top issue: does it actually change the numbers given the real data context, and would the fix change any downstream consumer? Note it.

Highlighted [brackets] are blanks to replace with your own details.

Fill in the blanks and use this promptMore Data & Analysis prompts

What to fill in

  • CODE
  • INTENT
  • DATA_CONTEXT
  • ENV_VOLUME
  • SYMPTOMS

How this prompt is built

This prompt follows the RCTFVV structure (Role, Context, Task, Format, Verification, Validation). RCTFVV extends RCTF with two checking steps. Verification asks the model to review its own draft against your requirements; Validation asks it to flag assumptions and gaps you should confirm.

Related prompts

Find more prompts like this