Idea · Sep 27, 2026

SQL Counterexample Grader

An SQL autograder that, instead of just saying 'wrong result', generates the smallest database instance where the student's query and the reference query disagree and shows it side by side.

What it would do

Result-table grading on a fixed sample database misses many wrong queries (a missing DISTINCT or a LEFT vs INNER JOIN often produces the same rows on the instructor's data). SQL Counterexample Grader runs the student query and the reference against a battery of generated database instances, built with mutation-killing heuristics in the spirit of XData: NULLs in join columns, duplicate rows, empty groups, ties at LIMIT boundaries. When the two queries disagree, it shrinks the instance to a minimal counterexample (often three to five rows) and shows both result tables with the differing rows highlighted. An optional LLM layer writes a solution-free hint that points at the relevant clause and the relevant rows, never at the fix. Everything runs in the browser on SQLite compiled to WebAssembly, so instructors can host it statically.

Key features

  • Instance generator with targeted cases for NULLs, duplicates, empty groups, outer joins, and ORDER BY/LIMIT ties
  • Delta-debugging shrinker that reduces a disagreeing database to a minimal counterexample
  • Side-by-side result diff with highlighted rows and the clause most likely responsible
  • Optional solution-free hint from Claude API with a leakage check that rejects hints containing reference SQL fragments
  • Assignment pack format (schema, reference queries, point weights) exportable as JSON and a Canvas-friendly CSV of scores

More in Assessment & Grading

Turtle Target Practice

Instructors post a target drawing; students write Python turtle code in the browser and get a stroke-level overlay of what is missing, extra or misplaced, without ever seeing the reference solution.

Assessment & GradingTeaching toolMediumOct 5, 2026

Warmup Forge

Before each class, students submit a 2-4 sentence natural-language explanation of today's concept; by the time class starts, Claude has clustered the responses and generated a ready-to-run 5-minute warmup activity targeting the most common misconception.

Assessment & GradingTeaching toolMediumSep 13, 2026

Assignment Autopsy

After an assignment closes, import submission data from Gradescope or Canvas and let Claude identify which test cases stumped the most students, surface error-pattern misconceptions, and generate concrete suggestions for improving the next offering.

Assessment & GradingTeaching toolMediumSep 11, 2026

Oral Code Explanation Grader

Students record a short voice walkthrough of their code before submission; an LLM checks whether their explanation matches what the code actually does and flags significant mismatches for instructors.

Assessment & GradingTeaching toolMediumSep 10, 2026

All 132 ideas in Assessment & Grading →