🏠 Startseite
Vergleiche
📊 Alle Benchmarks 🦖 Dinosaurier v1 🦖 Dinosaurier v2 ✅ To-Do-Listen-Apps 🎨 Kreative freie Seiten 🎯 FSACB - Ultimatives Showcase 🌍 Übersetzungs-Benchmark
Modelle
🏆 Top 10 Modelle 🆓 Kostenlose Modelle 📋 Alle Modelle ⚙️ Kilo Code
Ressourcen
💬 Prompt-Bibliothek 📖 KI-Glossar 🔗 Nützliche Links
medium

Generate Complex SQL Query

#sql #database #query-writing

Write a SQL query to join multiple tables and aggregate data.

Write a PostgreSQL query that lists the top 5 customers by total purchase amount in the last month. Assume tables named 'customers' (id, name) and 'orders' (id, customer_id, amount, date). Join the tables, filter for the last month, group by customer, and order by the total sum descending.