🏠 Home
Prestatietests
📊 Alle benchmarks 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List applicaties 🎨 Creatieve vrije pagina's 🎯 FSACB - Ultieme showcase 🌍 Vertaalbenchmark
Modellen
🏆 Top 10 modellen 🆓 Gratis modellen 📋 Alle modellen ⚙️ Kilo Code
Bronnen
💬 Promptbibliotheek 📖 AI-woordenlijst 🔗 Nuttige links
advanced

Complex Time-Series Analysis

#sql #database #analytics

Calculate moving averages and row rankings without self-joins.

Given a table of stock prices with columns 'stock_id', 'timestamp', and 'price', write a single SQL query that calculates the 7-day moving average price for each stock and ranks the stocks by their closing price within a rolling 30-day window. Use window functions to avoid using subqueries or self-joins.