Skip to content
Module
Module 3 of 6Lesson 3 of 3~16 min

Missing values and dates, two traps that produce wrong numbers

Missing values and dates can quietly skew a metric without triggering a single error. This lesson teaches you to spot these traps, group by period and check what a table really covers before drawing conclusions. You avoid presenting a drop to leadership that only reflects a gap in the data.

Lesson objective

By the end of this lesson, you will be able to handle NULL values correctly (IS NULL, COUNT of a column, COALESCE, average over known values), group and filter by period with date functions, and check the period covered by a table before computing an indicator.

Topics covered

  • NULL values
  • COALESCE
  • SQL date functions
  • data coverage
  • data quality

Where it fits

First queries

How do I get a reliable number from a table myself, without being caught out by missing values and dates?

Lessons in this module

  1. Load the dataset and write your first SELECT queries
  2. Count, sum, group
  3. Missing values and dates, two traps that produce wrong numbers (this lesson)

What you will learn in this module

This lesson is part of the course Model your product’s data and query it with SQL

  • Write queries that filter, sort and aggregate (SELECT, WHERE, ORDER BY, GROUP BY, HAVING) while handling NULL values and dates correctly.