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.
Latihan ini adalah bagian dari kursus
Exploratory Data Analysis in SQL
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
-- 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 ___;