Skip to main content

Module 1: Relational Databases & SQL: Mistake Clinic

This clinic turns wrong moves into reusable judgment. Use it after each practice page and again before the quiz or checkpoint.


Module-Specific Mistake Radar

Start with these traps. Replace or extend them with real mistakes from your own work.

Mistake to look forWhere it shows upSymptomRepair evidence
Finishing Relational Algebra to SQL Workshop with only a final answerRelational Algebra to SQL WorkshopThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Schema Design and Normalization Lab with only a final answerSchema Design and Normalization LabThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Query Performance Clinic with only a final answerQuery Performance ClinicThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing SQL Code Katas with only a final answerSQL Code KatasThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Treating Relations, Tuples, Attributes, Domains as vocabulary instead of a toolRelations, Tuples, Attributes, DomainsThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.
Treating Keys: Primary, Candidate, Foreign, Surrogate vs Natural as vocabulary instead of a toolKeys: Primary, Candidate, Foreign, Surrogate vs NaturalThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.

Practice Mistake Checks

Pull any miss from these checks into your mistake log.

Relational Algebra to SQL Workshop

Source: practice/01-relational-algebra-to-sql-workshop.md

Identify the bug or incorrect claim in each:

  1. SELECT name, AVG(salary) FROM employee GROUP BY dept_id;
  2. "LEFT JOIN followed by WHERE b.col = 1 returns the same rows as putting b.col = 1 in the ON clause."
  3. SELECT dept, salary, RANK() OVER (PARTITION BY dept ORDER BY salary DESC) FROM employee WHERE rank = 1;
  4. "SELECT * from a natural join of employee and dept on dept_id returns every column from both tables, including dept_id twice."
  5. "UNION is faster than UNION ALL because it removes duplicates."

Repair Protocol

For each real mistake:

  1. Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
  2. Name the hidden assumption.
  3. Repair the artifact.
  4. Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
  5. Add one retrieval card beginning with Check... before... or Do not use... when....

Mistake Log

DateMistakeSymptomRoot causeRepair evidenceRetrieval card
StarterPick one radar row aboveExplain how it would fail in this moduleName the assumptionAdd a counterexample or corrected artifactWrite the card before closing the page

Completion Standard

  • At least five real mistakes are logged.
  • At least two mistakes include a counterexample or failing test.
  • At least one mistake connects to an older semester skill.
  • At least one correction changes code, a proof, a diagram, a command transcript, a query, or a design decision.