Menu
CodeSprout
Typo-tolerant search across every article, problem and post. to open

1321. Restaurant Growth – πŸ“Š SQL Rolling Average Made Simple!

kvi5hnu20 minutes 52 secondsWatch on YouTube
0comments

Notes

In this video, we solve the "Restaurant Growth" problem from LeetCode using MySQL. Learn how to calculate the 7-day rolling average of customer spending in a restaurant. We use Common Table Expressions (CTEs) and date filtering to generate insights from time-series data.

πŸ“Œ What You’ll Learn in This Video:
βœ… How to use Common Table Expressions (CTEs) in SQL
βœ… Calculating a 7-day moving average using JOIN and BETWEEN
βœ… Applying DATE_SUB for rolling date ranges
βœ… Filtering complete 7-day windows using HAVING count(*) = 7
βœ… Writing efficient SQL queries for time-based analytics

πŸ”— LeetCode Problem:
https://leetcode.com/problems/restaurant-growth/

πŸ”₯ If you found this video helpful, don’t forget to:
πŸ‘ Like the video to support the channel
πŸ’¬ Comment below with your thoughts or questions
πŸ”” Subscribe & turn on notifications for more SQL tutorials!

Let’s level up your SQL skills! πŸš€

#SQL #MySQL #LeetCode #RestaurantGrowth #TimeSeries #SQLQueries #DataAnalytics #LeetCodeSQL #Database #RollingAverage #CodingInterview #TopSQLQuestions #LearnSQL #SoftwareEngineering #SQLShorts #sql50

Discussion

Sign in to ask a question or share what you learned.