Skip to content

Covers clans, the level at which familiar database tables emerge, formed by gathering relations together into structured sets.

Transcript

Slide 1: Welcome to Lesson 4. We’ve built two rungs of the tower so far. The couplet, a single fact; and the relation, a set of couplets, which you met as the record, the row, the small graph. Today we climb again, and this time something very familiar comes into view. When you gather not couplets but whole relations together into a set, you get a clan. And a clan, as you’ll see, is simply the thing the entire database industry calls a table, though it turns out to be a good deal more general than that.

Slide 2: Let’s recall where we are. A relation describes one thing, one person, one order, one winner, as a set of couplets. But real data never stops at one. A spreadsheet has many rows; a table has many records; a list has many entries. So we make exactly the same move that got us from couplets to relations: we gather relations together into a set. That set is a clan. No new machinery again, just a set, one level higher. And the payoff is immediate, because that humble set of relations is something you use every single day.

Slide 3: Here is a clan. Three relations, each describing an Oscar-winning actress: the 2023 winner Michelle Yeoh, the 2024 winner Emma Stone, the 2025 winner Mikey Madison, each row carrying its year, its actress and its film. Bundle those relations into a single set, and that set is a clan. And notice what it looks like: rows stacked under shared headings. You have seen this ten thousand times. It’s a table. The table you have always thought of as the fundamental unit of data is, in truth, just a clan, a set of relations.

Slide 4: Because a clan is built from relations, it hands us two sets, just as a relation did. Take the union of all the relations’ left elements, all their yins, and you get the clan’s yin-set: the actual data, the values in the rows. Take the union of their right elements, the yangs, and you get the yang-set, which, delightfully, is exactly the set of column headings: year, actress, movie. So the thing a database person calls the schema, or the column names, is nothing mysterious. It is simply the yang of the clan, falling straight out of the couplets underneath.

Slide 5: And here is where the algebra earns its keep. A clan is a set of relations, but nothing says those relations must line up neatly into a rectangle. When they do, you call it a table. When a relation’s values are themselves relations, nested inside, you call it a document, a JSON record, an XML file. When you read each couplet as an edge between nodes, you call it a graph. Table, document, graph: today these live in three different kinds of database, with three different query languages. Algebraically they are one and the same thing, a clan, wearing different clothes.

Slide 6: Let’s locate the clan on the tower. The couplet sits at the foot. A set of couplets is a relation. A set of relations is a clan, which we write P squared of G cross G: the power set, applied twice. You can feel the rhythm now: each level is just a set of the level below, and the same rhythm will give us the top rung shortly. One lovely consequence: you can move up and down freely. Partition a relation and you’ve made a clan; take the union of a clan’s relations and you’re back to a relation. The tower is a staircase you can climb in both directions.

Slide 7: So, to carry forward. First, a clan is a set of relations, and the table you’ve relied on your whole career is exactly that, nothing more. Second, a clan gives you its data as the yin-set and its column headings as the yang-set, both for free. And third, the clan reaches far beyond tables: documents and graphs are clans too, which is why one algebra can replace a shelf full of specialised databases. Next time, before we reach the very top of the tower, we pause to master the operations, the verbs of the algebra, because they are what make all this structure useful. In Lesson 5, we learn the operations.

Slide 8: That’s the clan, a set of relations, and the honest identity of the humble table. Thank you for your time; in Lesson 5 we turn from structure to action, and learn the operations of the algebra.