Medium
Write a Complex SQL Query
Construct a SQL query involving joins and aggregation.
📝 Prompt Content
Write a PostgreSQL query to find the top 5 users who have spent the most money in the last 30 days. Assume two tables: 'users' (id, username) and 'orders' (user_id, amount, created_at). The query should return the username and the total amount spent.