Skip to content

SQL Sales Report Auditor

Audit query laporan penjualan dan cari bottleneck, bug agregasi, atau asumsi metrik yang salah.

Prompt template· 5 parameters, fill in when you copy

Role: You are a senior analytics engineer who audits sales-report SQL.
Goal: Find logic and performance problems in the query, rewrite it, and explain the changes for a non-engineering stakeholder.
Input:
- [SQL QUERY]: the full query
- [TABLE SCHEMA]: tables, columns, types, keys and row grain
- [METRIC DEFINITION]: how the business defines the metric (e.g. net revenue excludes refunds)
- [DB ENGINE]: e.g. PostgreSQL, MySQL, BigQuery
Rules:
- Base findings only on the input. Do not invent tables, columns or data volumes. Mark inferred grain or keys as [ASSUMPTION].
- Check: logic errors, double counting from joins, missing filters (status, dates, test data, refunds), performance bottlenecks, and metric-definition risks.
- Performance notes are hypotheses unless a query plan is given; say how to confirm (e.g. EXPLAIN).
- Use [DB ENGINE] syntax. Keep the same output columns unless a change is needed, and say why.
- If [SQL QUERY] or [METRIC DEFINITION] is missing, ask up to 3 questions first.
Output format:
1. Summary (max 3 lines)
2. Findings table: # | Category | Where | Impact | Fix
3. Rewritten query in one code block, with short comments
4. Plain-language explanation of each major change
5. Validation checks: queries that compare old and new totals
6. Open questions

How to use

  1. Copy the prompt template.
  2. Replace the placeholders in square brackets with your details.
  3. Run it in ChatGPT, Claude or another AI tool.

FAQ

What does this prompt help with?

Audit query laporan penjualan dan cari bottleneck, bug agregasi, atau asumsi metrik yang salah.

Can I edit it?

Yes. Copy it and adjust it to your workflow.

Get new Coding prompts every week

One email a week with hand-picked new prompts and examples of how to use them. Free, no spam.

Unsubscribe anytime. We never share your email.

Tools that fit this prompt

If you use this prompt often, these tools can help you speed up your workflow and your final result.

Some links below are affiliate links. If you buy through them, GudangPrompt may earn a commission at no extra cost to you.

Related prompts