Skip to course content
Free SQL course

SQL for Data Analysis and AI

Module 08

Date and Time Analysis with Period Comparisons

About 75-95 minutes of guided work.

By the end of this module you can write a date range that cannot silently drop rows, truncate to the period a stakeholder actually means, compare two periods without flattering one of them, and explain why a daily total changes when the timezone does.

Units

  1. Unit 08.00: Half-open ranges and the BETWEEN midnight bug
  2. Unit 08.01: Truncating to day, week, and month
  3. Unit 08.02: Comparing periods of unequal length
  4. Unit 08.03: Timezones and the shifting daily total
  5. Unit 08.04: Cohorts: grouping by a fixed origin period

Module work