🏠 الرئيسية
المقاييس
📊 جميع المقاييس 🦖 ديناصور v1 🦖 ديناصور v2 ✅ تطبيقات قائمة المهام 🎨 صفحات حرة إبداعية 🎯 FSACB - العرض النهائي 🌍 مقياس الترجمة
النماذج
🏆 أفضل 10 نماذج 🆓 نماذج مجانية 📋 جميع النماذج ⚙️ كيلو كود
الموارد
💬 مكتبة الأوامر 📖 قاموس الذكاء الاصطناعي 🔗 روابط مفيدة
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.