testsAndMisc/python_pkg/sql_drills/fixtures/06_number_traps/DOCS-task.md
Krzysztof kuhy Rudnicki ee78ae44cc
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Waiting to run
Python tests / test (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / lib-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
Add sql_drills MySQL exact-match harness
Docker mysql:8.0.33 container, judge-style output grading, 12 original drills with live-verified references kept in tests only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWZewj4WS5X6AZyjWDp
2026-11-01 21:13:18 +01:00

505 B

Number traps: AVG scale, ROUND, CAST AS DECIMAL

team_results has one row per team per season.

Output columns (no header), per team:

  1. team
  2. average wins, ROUNDed to 2 decimals
  3. average games, NOT rounded (print whatever MySQL gives you)
  4. win percentage 100 * SUM(wins) / SUM(games) as DECIMAL(5,1) via CAST
  • Order by team ascending.
  • Trap: AVG() of an integer column returns 4 decimals (2.5000), and / is decimal division in MySQL (use DIV for the integer kind).