CHAPTER 24: VISUAL LABS 24a AND 24b

These original exercises use the same synthetic Harbour dataset as the book.
The display/check runner opens companion/sql/harbour.db read-only.
If that file is missing, first follow Chapter17 and run sql/setup_database.py.

RUN
1. Open walkthrough.py in IDLE and choose Run > Run Module (F5).
2. Alternatively, open a terminal in this ch24 folder.
   Windows: py walkthrough.py
   macOS/Linux: python3 walkthrough.py
Use the Python command that already worked in your setup.
No network access or third-party package is required.

The .sql files hold inspectable questions. The supplied Python wrapper prints
results and checks the original expected values. Before editing, predict the
new result. After editing, compare it manually; an old assertion may now fail
because your intentional change needs a different expected answer. Do not
remove a failed check until you can explain the changed result.

EXPECTED RESULTS AND PRACTICE
24a reproduces all four model report rows: revenue 130, 50, 150, 0 euros; spend 300, 120, 200, 80; leads 3, 2, 2, 0. Its separate unknown query adds one lead, one order and 50 euros. 24b extends only the order boundary to 2026-11-01. Change/predict/check: predict Newsletter buyers and rate after Cedar's second order. They remain one buyer and 50%; paid orders become two, revenue becomes 120. Total recorded revenue becomes 450, including unattributed 50. The extract only records orders through 2 October, so this is not evidence of complete later-October coverage.
