Applied edition · 44 planned hours · Unpiloted · Human review pending. Self-review is not a credential; the full 108-hour semester remains unfinished. No browser SQL execution.

Download Markdown

Unit 5 — Preserve the entity when tables meet

Outcome U5: predict join fan-out, preserve a measured population and reconcile results on unfamiliar and changed data. The teaching, workbook, solutions, fixtures and original verification for this unit already exist in the sibling sql-join-unit package. They are retained unchanged, not counted as a second authored unit or a new course.

Entry bridge

Units 1–4 establish the entry skills named by the original unit: SELECT, WHERE, primary/foreign keys, SUM/COUNT and GROUP BY. Recheck C1–C4 before starting. The original unit's README/workbook say earlier teaching is not included in that bounded package; this sequence supplies it by linking the packages, not by rewriting historical claims.

The case changes deliberately from workshop sessions/bookings to a community shop's orders/items. It tests whether you can transfer grain reasoning instead of memorizing column names. Order values there are whole CAD; workshop fees here are cents. Do not combine their measures or fixtures. Both are synthetic operational records, not accounting or profitability instruction.

  1. Read the original unit.
  2. Attempt its entire workbook, including independent mini-project and later-day transfer.
  3. Compare with explained solutions.
  4. Use its local execution instructions. From this package, run python3 ../sql-join-unit/run.py independent --query item_value_exists. That runner has its own fixture names and boundaries; it is not a hosted service.
  5. Read the public Learner readiness and assessment notice through the course's learner-notice link before continuing. Keep your own first attempt and corrections. Human subject review, learner piloting and independent assessment remain pending; self-review is not a grade or credential.

Exit bridge: apply the mechanism, not the numbers

The original base INNER JOIN repeats order 101's amount because two items match. In the workshop base, joining sessions to bookings repeats session 101's capacity three times. Capacity remains six, not eighteen. A LEFT JOIN also retains sessions with no bookings; that does not remove repeated capacity for sessions that do have bookings.

Before Unit 6, write answers to these transfer questions:

Bridge key: raw joined rows are session–booking matches, plus one unmatched output row per childless session for a LEFT JOIN. A non-NULL child key counts actual matches; COUNT(*) counts the unmatched output row too. DISTINCT capacity merges different sessions with equal capacity and is not an entity repair. Grouping bookings by session ID creates at most one summary row per parent, so joining that summary preserves one row per session. It still requires an explicit policy for missing versus zero summary values.

Your Unit 5 work is the sequence's retained join-query lab evidence. Do not substitute this bridge paragraph for the full worked explanation, independent case or delayed task. The four-hour suggestion is an unpiloted estimate already attached to the bounded unit, included once in the sequence's workload range.