The Directors' Challenge

A message from the board

"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.

Directors' Challenge: branch peak month c1 Not attempted

The board report. Three rows: one per branch.

This page is waiting for query c1. Open student/queries.php and write it.