1. Learn
  2. /
  3. Courses
  4. /
  5. Window Functions in Snowflake

Connected

Exercise

Are charging durations getting longer?

The Data Science team currently has a model that predicts the number of open chargers based on average vehicle charging duration. This allows for them to send notifications to previous users when it might be a good time to charge. However, the team believes that average charging duration may have changed since the last time they trained their model. Can you validate this for them?

Instructions

100 XP
  • Use a window function to find the running average of vehicle charging_duration.
  • Partition the results by charging_station_location.
  • Sequence the window by charging_start_time in ascending order.
  • Create the window of records to always be between the first row and the CURRENT ROW.
Powered by Snowflake