Return each order's id, customer_id, total, customer_avg (that customer's average order, rounded to 2 decimals) and vs_avg: 'above', 'below' or 'equal' comparing the order to the unrounded average. Sort by customer_id, then id.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial