This is the formula the series opened with:

Take it apart, left to right. is a function: give it a customer, get a number. The is is defined as. The first sigma is the outer loop, running once for each order of that customer. The second is the inner loop, running once for each line of that order. And is the body — quantity times price, for that line.

Said out loud: R of c equals the sum, over every order o in the set of orders belonging to customer c, of the sum, over every line in the set of lines belonging to order o, of quantity times price.

In plain words: a customer's revenue is the total of every line on every order they placed.

The three checks

Run these on any formula of this shape, automatically, before you trust it.

What happens when a set is empty? gives , because the empty sum is zero. Correct — a customer with no orders has no revenue.

Does the inner set depend on the outer index? does, so the sums cannot be separated into a product of two sums. If you catch yourself simplifying that way, stop.

Can I evaluate it two ways? Summing over all customers should equal the total over Line directly. It does — both ways. Two routes to the same number is the cheapest correctness check available, and it is the one people skip.

That is the skill this series was for. Not manipulating symbols — reading them slowly enough to see what loop they describe, and then checking the edges.

The cheat sheet

Sets. is a set, unordered and without duplicates. is membership. is a filter, which is `WHERE`. is a map, which is `SELECT DISTINCT`. is the size, which is `COUNT(*)`. is the empty set. says every element of is in .

Tuples. is ordered and may repeat. is every pair, which is `CROSS JOIN`. A table is a subset of a product, which is what relation means.

Functions. takes an and returns a . is the same as .

Sums and products. sums over a range, over a set, and a condition underneath filters it. , because counting is summing ones. The empty sum is and the empty product is . has identical grammar and multiplies.

Logic. is for all, is there exists, is implies, is maps to, and is a join.

The four things to actually remember

A table is a set of tuples — that is what relational means. Sigma is a loop, and the part underneath says what to loop over. Summing 1 counts, the empty sum is 0, and the empty product is 1. And if the outer index never appears in the body, something is wrong.

Where to go next, if you want to

Not needed for modeling, but the natural next steps are relational algebra's own symbols — for select, for project, for rename — which are just names for the filtering, grouping and joining already covered here; and functional dependencies, written , which is what normal forms are in this notation. Both are small additions to what is in this series, not new subjects.