Sql read
Read a SQL query back in plain words, name what it counts, and flag the joins and filters that quietly change the answer.
The prompt
Read this query back to me. Query: PASTE IT What the result is supposed to mean: WHAT. Six parts. One sentence. What this query returns. The grain. One row of the output is one what. State it exactly, because most argued numbers are a grain disagreement. Tables and joins. For each join: which one it is, on what, and what it does to the row count. Name any join that can multiply rows, and any outer join whose filter in the WHERE clause silently turns it into an inner one. Filters. Every condition, in plain words, including the ones hidden in a join condition. Flag any comparison against a column that can be null, because null comparisons drop rows without saying so. Counts and sums. For each one: what exactly is being counted, whether duplicates are included, and whether the denominator of any ratio is the same population as its numerator. Traps, ranked. The ways this query could return a number that looks right and is not. Date boundaries that include or exclude a day, a timezone, a deleted or inactive flag not filtered, a currency or unit mix, a grouping that hides a duplicate. Then: the smallest check that would confirm the result. Usually a count at a different grain, or the same query over a period whose answer I already know. You cannot run this, so mark anything that depends on the data rather than the query text as something to verify.
How to use it
Run this in Chat. It is a thinking tool, not a deliverable.
Use when a number came from a query you did not write and you have to decide whether to trust it.
Vibe prepares and drafts. You verify and decide. Ask for a citation on every finding: a confident answer is not evidence.
What you get back
A plain reading, the grain of the result, ranked traps in the joins and filters, and the checks that would confirm it.
What it writes
Nothing. This one only answers.
From the source file in awesome-mistral-vibe-prompts, CC BY-SA 4.0. Not affiliated with, or endorsed by, Mistral AI.