intermediate
High-Value Customer SQL Query
Generate a SQL query to identify top customers based on spending.
📝 Treść promptu
Construct a PostgreSQL query to select the top 10 users with the highest total purchase amount from the 'orders' table. The output should include user_id, user_name, and the sum of their total_orders, sorted by the total amount in descending order.