SQL Review for Correctness
Reviews a query for the silent wrongness that produces plausible numbers — fan-out joins, null semantics and filters applied after the outer join.
Free — no card needed
Create a free account
to open SQL Review for Correctness — and the other 364 prompts across 21 categories.
Already have an account?
Running it, start to finish
- Paste the query with the schema, grain and cardinality.
- Fix the fan-out findings first — they distort everything downstream.
- Run the section 8 checks before the number leaves your screen.
What you get back
The output this produces, every time.
- Traces grain through every join to catch the fan-out that silently inflates a metric.
- Checks whether a filter turned your outer join into an inner one, which is common and invisible.
- Supplies runnable sanity-check queries to verify the result independently.
Getting better results
Where this usually goes wrong, and how to avoid it.
- Give it real cardinality. Section 1 is the highest-value check and it needs to know which relationships are one-to-many.
- Check every DISTINCT. Section 4 frequently finds a DISTINCT hiding a join problem, which produces a wrong number that looks entirely reasonable.
- Run the sanity checks. before presenting anything. Reconciling against a known total catches most of what review misses.
More Data Analysis prompts
All Data Analysis →- Data Analysis
Segmentation Analysis
Produces segments that are actionable and stable, since statistically clean but unusable is the standard failure.
ClaudeChatGPT002Open → - Data Analysis
Metric Definition Review
Treats two teams reporting one metric differently as a governance problem rather than a query bug.
ClaudeChatGPT000Open → - Data Analysis
A/B Test Design and Reading
Designs a test that can actually detect the effect you care about, and states the decision rule before the data arrives.
ClaudeChatGPT000Open →
Written for The AI University. Every prompt in this library is original work — authored, tested and revised here, not collected from elsewhere. 365 of them, free with an account.
