Compare SQL answers using rows that expose null-count mistakes
Resolve agreement or disagreement with a concrete test fixture.
Inputs & setup What you need before copying
Bring: Database dialect, table definition, small sample rows, intended count and candidate SQL answers.
Start here: First run the task in a fresh chat; repeat separately if you want three candidate answers. Paste the original inputs and answers into a new chat with this prompt to reconcile them. Separate chats give separate responses, but may share the same mistakes; verify against evidence.
Best for: Chat & reasoning · Coding & development
Use this prompt with: ChatGPT · Claude · Gemini
Choose a tool that supports the files or features listed above.
Example result
Sample input
SQLite table visits(id INTEGER, email TEXT), rows (1, a@example.test), (2, NULL), (3, b@example.test). Count every visit. A: SELECT COUNT(email) FROM visits; B: same as A; C: SELECT COUNT(*) FROM visits;
Illustrative example A and B count only non-null emails and would return 2 for this fixture. C counts all rows and would return 3, which matches “every visit.” Recommended query: SELECT COUNT(*) FROM visits; Expected fixture result: 3. This is a manual fixture check, not a recorded database execution. The duplicated query is a shared error, not stronger evidence.
Make it yours Fill in your details
Optional. Your details stay in this browser tab.
Read full prompt
Self-consistency workflow: if no candidate answers are supplied, produce ONE answer to the task below, with its result, assumptions and a short checkable evidence summary. Do not simulate independent runs or invent a vote. To compare runs, the visitor can repeat this same task and inputs in three fresh chats, then paste the resulting answers as [candidate answers]. If answers are supplied, reconcile them against the original inputs; agreement alone is not proof. Task: write SQL for [count requirement] in [dialect] using the supplied schema. Return the query and expected result on the fixture. Reconciliation checks: distinguish counting rows from counting non-null values, verify filters and evaluate every proposed query on the supplied rows. Mark execution pending unless a tool actually runs it. Original inputs: [task facts]. Candidate answers, when available: [paste A, B and C with any supplied evidence].
Try a variation 2 ideas
After your first result, try one of these follow-ups.
- Reconcile these two candidate answers without inventing a third response.
- Keep the answers unchanged and identify a boundary case that could expose a shared error.
Check your result
- Check the original data or source even when all candidate answers agree.
- Do not claim independent runs happened unless you actually collected them separately.