🏠 홈
벤치마크
📊 모든 벤치마크 🦖 공룡 v1 🦖 공룡 v2 ✅ 할 일 목록 앱 🎨 창의적인 자유 페이지 🎯 FSACB - 궁극의 쇼케이스 🌍 번역 벤치마크
모델
🏆 톱 10 모델 🆓 무료 모델 📋 모든 모델 ⚙️ 킬로 코드 모드
리소스
💬 프롬프트 라이브러리 📖 AI 용어 사전 🔗 유용한 링크
advanced

Complex Time-Series Analysis with SQL Window Functions

#sql #database #data-analysis

Solve a data retrieval problem requiring intricate calculation over sliding windows and frame clauses.

Given a table 'stock_prices' with columns 'symbol', 'trade_date', and 'close_price', write a single SQL query that calculates the 30-day moving average, the exponential moving average with a smoothing factor of 0.2, and the Bollinger Bands (upper and lower) for each symbol. The query should return only dates where the closing price crosses above the upper Bollinger Band. Assume a standard PostgreSQL environment. Explain the choice of window frame clauses (RANGE vs. ROWS) and their impact on handling missing dates in the data.