Read this lesson as text

Database Query Logic

Intro to Proofs · Axiom Academy

A query doesn't loop or do arithmetic — it states a predicate , and the database returns the subset of rows that make it true. Drag the GPA cutoff and watch the result set shrink. ∀ for all — hunt for a counterexample You can't see every Math major at once, so a database flips it around: a universal is true exactly when no counterexample exists . Drag the bar and watch for any Math major that falls on or below it — find one and the claim is false; find none and it holds. ∃ there exists — one witness is enough An existential is the easy direction: you don't need every row, just one that matches. Raise the bar on the CS majors — as long as at least one row survives, the statement is true and that row is the proof. One relation, three moves: filter it (a WHERE clause is set-builder), check every one (a ∀ claim is true when its counterexample query returns 0 rows), and find just one (a ∃ claim needs a single matching witness). Anywhere data is queried — product search, email filters, fraud alerts, friend suggestions — it's the same predicate logic deciding which rows make the cut.

This is the written version of the interactive lesson above. See the full Intro to Proofs course.