🏠 Home
Benchmark
📊 Tutti i benchmark 🦖 Dinosauro v1 🦖 Dinosauro v2 ✅ App To-Do List 🎨 Pagine libere creative 🎯 FSACB - Ultimate Showcase 🌍 Benchmark traduzione
Modelli
🏆 Top 10 modelli 🆓 Modelli gratuiti 📋 Tutti i modelli ⚙️ Kilo Code
Risorse
💬 Libreria di prompt 📖 Glossario IA 🔗 Link utili
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.