🏠 Trang chủ
Benchmark
📊 Tất cả benchmark 🦖 Khủng long v1 🦖 Khủng long v2 ✅ Ứng dụng To-Do List 🎨 Trang tự do sáng tạo 🎯 FSACB - Trình diễn cuối cùng 🌍 Benchmark dịch thuật
Mô hình
🏆 Top 10 mô hình 🆓 Mô hình miễn phí 📋 Tất cả mô hình ⚙️ Kilo Code
Tài nguyên
💬 Thư viện prompt 📖 Thuật ngữ AI 🔗 Liên kết hữu ích
Medium

SQL Complex Join Query

#sql #database #query

Write a SQL query to retrieve specific data involving joins and aggregation.

Write a PostgreSQL query to find the top 10 users who have spent the most money in the last 30 days. Assume three tables: users (id, name), orders (id, user_id, total_amount), and order_items (order_id, product_id). Include the user's name and total spent.