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

Connected

Exercise

Optimizing charging scheduling

Lucky for you, you've become the go-to Snowflake user for answering day-to-day questions about each charging station. Your operations team is interested in ranking each charge based on the duration, for each charging station. This will help them optimize scheduling blocks for their new app. Time to get to it!

Instructions 1/2

undefined XP
    1
    2
  • Use the RANK function to assign a ranking to each record based on charging_duration, from shortest to longest.
  • Segment the result set by charger_type, and alias the result as charging_duration_rank_1