IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Exploratory Data Analysis in SQL

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

-- Extract the month from date_created and count requests
SELECT ___ AS month, 
       ___
  FROM evanston311
 -- Limit the date range
 WHERE ___
   AND ___
 -- Group by what to get monthly counts?
 GROUP BY ___;
Modifica ed esegui il codice