The podium
Boss exercise. It's end of year — build the top 3 customers by total spend, each with a rank column (ties share a rank). Three ideas at once: aggregate spend per customer, RANK(), and the rule that window results can only be filtered in an outer query, never in WHERE.
Tables in this exercise
customers
id first_name last_name email city country joined_date support_rep_id
invoices
id customer_id invoice_date billing_city billing_country total