Skip to content
Module
Module 5 of 6Lesson 2 of 2~15 min

From a product question to a query you can defend

Without a precise definition, a question like the number of active users yields as many answers as there are people computing it. This lesson teaches you to turn a vague question into a defined metric, then into a query whose result you can verify. You present a number everyone can review, compare and reuse, instead of starting a debate.

Lesson objective

By the end of this lesson, you will be able to turn a vague product question into a precise metric definition (population, event, period, exclusions, NULL handling), derive the tables and the grain, write the query step by step and sanity-check it before sharing the result.

Topics covered

  • metric definition
  • active users
  • SQL queries
  • sanity check
  • product questions

Where it fits

Answer product questions

How do I go from a vague question ("are our customers active?") to a query whose result I can defend?

Lessons in this module

  1. Break queries down with WITH, compare with window functions
  2. From a product question to a query you can defend (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.
  • Turn a product question into a verifiable query, using CTEs and simple window functions (ROW_NUMBER, LAG, SUM OVER).