🏠 Strona Główna
Benchmarki
📊 Wszystkie benchmarki 🦖 Dinozaur v1 🦖 Dinozaur v2 ✅ Aplikacje To-Do List 🎨 Kreatywne wolne strony 🎯 FSACB - Ostateczny pokaz 🌍 Benchmark tłumaczeń
Modele
🏆 Top 10 modeli 🆓 Darmowe modele 📋 Wszystkie modele ⚙️ Kilo Code
Zasoby
💬 Biblioteka promptów 📖 Słownik AI 🔗 Przydatne linki
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.