"Every year at the shareholders' meeting we celebrate each branch's best month. We want one report, from one SQL statement, that tells us for every branch which single month was its best of all time, how much revenue it took that month, and what percentage of the branch's all-time revenue that month represents (to one decimal place)."
Required columns are branch_name, peak_month
(formatted YYYY-MM), peak_revenue and pct_of_total.
One statement only; a Common Table Expression (WITH ... AS)
is allowed and encouraged. This is deliberately beyond what the module
teaches directly. Partial marks are available for a well-reasoned attempt,
so document your thinking in your testing evidence even if the self-check
does not fully pass.
c1 Not attemptedThe board report. Three rows: one per branch.
c1. Open student/queries.php and write it.