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

Explained key — Units 6–8 and delayed transfer

The retained Unit 5 key is ../../sql-join-unit/SOLUTIONS.md from this answers directory. Do not apply workshop fixture names to the shop runner.

G6 / I6 / C6: stage contracts

G6 classifications: unknown 1003,1007; none recorded 1002,1009; partial 1004; all recorded 1001,1005,1006,1008,1010. Unknown comes first so ELSE does not mislabel missing values. The constrained trusted source justifies ELSE as all recorded; raw intake would require an invalid category first. Base mean booking size is 1.4, so above-mean IDs are 1001,1004,1005,1007. u06_above_mean encodes the mean calculation rather than memorizing 1.4.

The u06_session_report columns are session_id, status, capacity, booking_rows, booked_seats, unknown_seats, known_seats, recorded_attended_seats:

101 open       6 3 4 1 3 2
102 open       4 2 4 0 4 3
103 open       5 2 3 2 1 1
104 cancelled  0 0 0 0 0 NULL
105 open       4 3 3 0 3 2
106 open       3 0 0 0 0 NULL

Ten source bookings → four grouped session rows → six final rows. The CTE key is session_id; the final key is also session_id. Missing session summaries do not imply measured zero attendance, hence the literal SUM is NULL in this view. Orphan intake result is (3,9002,999); NOT EXISTS tests the absence of a parent match.

I6 classifications: 2001 all recorded; 2002 unknown; 2003 none recorded; 2004 and 2005 all recorded. No partial category occurs. Mean size is 1.4; above-mean IDs 2003,2004. Report rows:

201 open       3 2 2 1 1 1
202 open       2 1 2 0 2 0
203 open       4 2 3 0 3 3
204 cancelled  0 0 0 0 0 NULL

Five bookings → three grouped rows → four final session rows; booked seats reconcile to seven. Orphan is (13,9102,999). Cancellation is a supplied status; an open session with no bookings still contributes to the open-capacity denominator. A zero capacity does not by itself establish cancellation.

For NOT IN, consider SELECT 999 WHERE 999 NOT IN (101,NULL);: the comparison is unknown, so it returns no row. A relationship NOT EXISTS with s.session_id=i.session_id correctly flags 999 as having no parent in this fixture. Do not add NULL silently to an identity set and assume ordinary set subtraction.

C6: name stage grain and row-count limits, not merely the query keywords. DISTINCT fee values is not an identity repair: two valid 250-cent bookings should contribute 500 cents, but SUM(DISTINCT fee_cents) keeps 250 once. The same logic applies to two capacity-four sessions.

G7 / I7 / C7: which percentage?

G7: base known-only attendance 8/11=72.73%; all-booked bounds 8/14=57.14% to 11/14=78.57%; booked/open-capacity 14/22=63.64%. Bounds assume the supplied known counts and seat totals are correct and every unknown booking has attendance from zero through its reserved seats. They are not confidence intervals, causal estimates or a forecast.

A suitable five-sentence note: “Check the missing attendance entries and the open session with no bookings before using this snapshot for next-round planning. The supplied records show fourteen booked seats against twenty-two open-session places, or 63.64%. Attendance is recorded for eleven booked seats, of which eight attended; under the stated count rules, attendance across all fourteen booked seats is between 57.14% and 78.57%. These records cannot establish unique people reached, reasons for nonattendance or future demand. Reconcile any source corrections and rerun the saved queries before revising the planning note.” This is an original model, not a required script.

I7: known-only 4/6=66.67%; all-booked bounds 4/7=57.14% to 5/7=71.43%; booked/open-capacity 7/9=77.78%. “Attendance is 66.67%” omits that one booked seat is unknown. “Next month will be the same” adds an unsupported forecast. The appropriate fictional follow-up is checking booking 2002's attendance source and confirming the snapshot's completeness; it is not cancelling a topic, inferring motives or sharing private data.

C7: one two-seat unknown booking gives known-only rate NULL, lower 0%, upper 100%. Empty bookings give known-only/lower/upper rates NULL. Additive counts may be displayed zero by convention; a rate requires a defined nonzero denominator. An open session with capacity but no bookings can have booking/capacity 0% without having an observed attendance rate.

G8 / I8: project

Use PROJECT-KEY.md for exact control totals, diagnostic wrong joins, session-level results and acceptable decisions. Complete means reasoning plus reproducible evidence, not a copied screenshot. u08_project_session_report uses explicit zero additive lower-bound counts and nullable rates; it must be explained, not mistaken for complete attendance observations.

D8: delayed changed-data transfer

Source: 3 sessions,3 bookings,3 booking references,4 booked seats,1 recorded attended seat,2 known booked seats,2 unknown booked seats,1,000 fee cents,0 intake rows. All sessions are open with capacity 4+2+3=9.

Project session report:

D8: delayed changed-data transfer — table 1
SessionCapacityBookingsBooked seatsKnown seatsUnknown seatsRecorded attendedBooking/capacityLower attendanceUpper attendance
30142220150%50%50%
302212020100%0%100%
3033000000%NULLNULL

For 302 the displayed recorded lower-bound count zero is not observed zero attendance: all attendance is unknown. For 303 there are no bookings at all, hence no attendance population. u06_session_report, which preserves literal SUM, shows NULL recorded attendance for both; the additional known/unknown/booked fields distinguish them.

The raw LEFT JOIN has four rows and sums capacity to 13 (4+4+2+3) instead of nine. SUM(DISTINCT capacity) happens to give nine because all three capacities differ. This apparent success is broken by base, where capacities repeat across distinct sessions. A counterexample tests a method beyond one conveniently matching result.

With empty, inventory is (0,0,NULL); the explicit source-control view is (0,0,0,0,0); all-session reports have no rows; bounds view displays zero counts and NULL rates; capacity view gives zero capacity, zero bookings and NULL rate. Scalar SUM/AVG remain NULL unless the query explicitly applies a documented zero-total convention. Empty output is not a failed execution if that is the correct result.

An acceptable revision memo identifies changed records/counts, retains generic grouping/existence/NULL-safe logic and refuses causal or predictive claims. No delayed-learning success is asserted until a learner actually returns on a later day and attempts it.