ContentsThe library

Designing a Table to Live With

The Query Returned Nothing and the Query Was Correct

Last timeOne, Many and Many to Many

An empty cell can mean three different things, the database treats all three identically, and the result is a comparison that is neither true nor false and an average over a changing denominator.

Every table built so far has cells that might be empty. This lesson is about

what an empty cell means, which is three things, and what the database does

with it, which is one thing.

Three things wearing one face

A customer table with an empty phone column. Three stories produce that cell,

and they are not the same story.

The customer has a phone number and we never asked for it. The value exists in

the world and not in the database, which is the original meaning: unknown.

The customer is an organisation with no single phone number, so there is no

value to hold. Nothing is missing. The column simply does not apply to this

row.

The form has three pages and the customer is on page two. There will be a

value, shortly, and right now the row is incomplete.

FIG 1The three meanings and what each one wants
should be excluded from belongs in a different tshould be visible as incneeds a record of why
unknown: there is a valu1010
not applicable: there is0100
not collected yet: there1001
withheld: there is one a0010
Four meanings in practice rather than three, since a value deliberately not kept is its own case and increasingly a legal one. The two marked cells are the repairs that work. Not applicable is a signal that the column belongs to a narrower set of rows than this table holds, which usually means a second table. Not collected yet wants to be visible as a state, because a row that is mid-process and a row that is finished and sparse are different things to everybody except the database.

The database stores one marker for all four. Nothing in the column records

which story applies, so the meaning has to be supplied elsewhere, and if it is

not supplied anywhere then every reader guesses.

The lesson stops here

4 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01Say Out Loud What One Row Is Claiming
  2. 02Seventy-Eight Copies and No Tiebreakeropening only
  3. 03The Email Address Was Reused by the New Employeeopening only
  4. 04There Is No Column That Can Hold a Listopening only
  5. 05The Query Returned Nothing and the Query Was Correctyou are here
  6. 06Copy the Value Only If You Are Also Building the Thing That Repairs Itopening only
  7. 07The Report Was Right in March and Is Wrong Nowopening only
  8. 08For Twenty Minutes, Both Versions Have to Be Rightopening only

Read alongside