2 Comments
Nov 19, 2023·edited Nov 19, 2023

While this is indeed a fun observation, the relation mentioned in it is not real. That is, no DBMS allows you to select from this relation, or to join with it. It's not normally representable there because it's not in 1NF.

You can imagine though a way to make it work: the "all table contents" part can be considered a blob, some serialized form, which can later be parsed into columns and rows on the client side. If we allow to apply (pure) functions to the values of relational tuples, as most RDBMSes do, we can put the blob parsing back into the DBMS, and allow a function that takes the "entire table contents" blob, a query string, and extracts a scalar of our choosing; that would model a join, in a limited form. Arguably this stays within the confines of the relational model.

But l like the initial idea, without the serialization trick. To me it illustrates how a theory usually cannot work as its own meta-theory. We cannot *directly* describe the relational model using the relational model, vaguely reminiscent of the way how "a set of all sets" cannot be a set.

Expand full comment