1. Learn
  2. /
  3. Courses
  4. /
  5. Exploratory Data Analysis in SQL

Connected

Exercise

Date parts

The date_part() function is useful when you want to aggregate data by a unit of time across multiple larger units of time. For example, aggregating data by month across different years, or aggregating by hour across different days.

Recall that you use date_part() as:

SELECT date_part('field', timestamp);

In this exercise, you'll use date_part() to gain insights about when Evanston 311 requests are submitted and completed.

Instructions 1/3

undefined XP
  • 1
    • How many requests are created in each of the 24 months during 2016-2017?
  • 2
    • What is the most common hour of the day for requests to be created?
  • 3
    • During what hours are requests usually completed? Count requests completed by hour.
    • Order the results by hour.