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

Generate Complex SQL Query

#sql #database #query-optimization

Create a SQL query with joins and aggregations.

Write a SQL query to retrieve the top 10 customers by total purchase amount in the last month. Assume tables named 'customers' (id, name), 'orders' (id, customer_id, date), and 'order_items' (order_id, amount). Join these tables, group by customer name, and order by the total sum descending.