Now on Omarchy: read the manual without leaving your desktop
Your code SQL
-- Name, total spent (0 if no orders), and rank by total spent, highest first.
SELECT users.name, orders.amount FROM users JOIN orders ON orders.user_id = users.id;