1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Redshift

Connected

Exercise

Extracting date parts

There is some concern about whether an anemometer measuring wind speed was properly repaired at the Coffee County weather station. It was suggested that the number of windy readings in each month be compared to see if it was repaired by October 2023.

Instructions

100 XP
  • Get the year from the date column, aliasing as year.
  • Get the month from the date column, aliasing as month.
  • Only count them when the hourlywindspeed is not '0' by returning the number 1'.
  • Group and order by the year and month, in that order.