🏠 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

Write a Complex SQL Query

#sql #database #code

Construct a SQL query involving joins and aggregation.

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.