Founding rate: RM5 off Basic, forever — applied automatically. See pricing

Menu

Chapter 10 · 8 min · Basic

Deliver a number someone can use

You have checked the table, cleaned what needed cleaning, decided what counts and joined what had to be joined. One step left, and it is the one that decides whether any of the previous work is believed.

A deliverable is not a result grid. It is one row per thing the person asked about, with numbers rounded to a sensible precision, columns named in their language rather than the database's, and the population, the period and the exclusions attached so the number cannot be separated from its meaning.

This chapter builds one, from a request that arrives in the usual shape.

The dataset

Fourteen support tickets from three stores over nine days. minutes_to_first_reply is null for two tickets that were never replied to at all. Two channels are mixed in here — in-app chat, where somebody is watching, and email, where nobody is — and they behave so differently that averaging them together is the first mistake available.

Schema

tickets
ticket_idint
storetext
channeltext
minutes_to_first_replyint
resolvedboolean
opened_ondate

Example data

tickets

The request, and the number that answers nothing

The message: "how fast are we replying to customers?"

The one-line answer is about 80 minutes, and it is nearly useless. Look at what it is made of: two channels with wildly different expectations averaged into one figure, three stores flattened into none, two tickets that never got a reply silently dropped from the denominator, and a single email at 300 minutes dragging everything up.

Eighty minutes describes no ticket, no store and no customer experience. It is the number you get when you type the request into SQL rather than answering it.

So take it apart, using everything from the earlier chapters: what is being measured, over which rows, over what period — and what is missing.

Fourteen tickets, twelve of them with a reply time. Roughly what average do you expect?

Editable, try changing it

Basic

The rest of this chapter is Basic

Learning SQL is free here, forever. This track is the paid half: what to actually do with a dataset once somebody hands you one, from the first look to a number you can defend.

See Basic plans

RM 25/mo · cancel anytime

Still to come in this chapter

  1. 02One row per thing they care about
  2. 03Choose the population and say so
  3. 04Let the number carry its own definition
  4. 05The message you send with it
  5. 06What else you can do with SQL

Now practise it

Questions in the bank that drill this chapter's decision: