CQL: Categorical Databases(categoricaldata.net) |
CQL: Categorical Databases(categoricaldata.net) |
The same could be said for SQL. How does CQL differ from SQL? If I squint my eyes just a tiny amount, these ideas become really difficult to separate. I was always under the impression that the relational model is based upon many concepts studied in category theory. To my mind, all of the following things are overlapping parts of the exact same monster:
Set theory
Category theory
Graph theory
Type theory
Discrete mathematics
Relational algebra
Relational calculus
Relational modeling
An actual sql schemaSQL is like Java, CQL is like Haskell. SQL has been around and used in production. CQL is a research language, possibly cleaner foundation but YMMV.
The math fields you list are connected, but whether they are the same monster - again it's kinda like claiming all programming languages and implementations are the same (Turing-complete?) monster.
What Category Theory Teaches Us About DataFrames https://mchav.github.io/what-category-theory-teaches-us-abou...
Discussed on HN at (67 comments)
1. Easier modelling sum types (inheritance) due to duality.
2. Better handling of null due to labelled null.
3. Better foundation of elementary types (they're just another table ids). (Column stores often do that already, if your question is about storage.)
A general relation exists only between the columns of a table that are included in a multi-column primary key.
All columns that are not part of the primary key are functions of the primary key.
Most tables used in practice use a single column as the primary key, which is frequently just a number or a UUID. Most databases contain only tables that are functions, without any table that contains general relations.
The most frequently used kinds of joins are just function compositions.
The difference is more in theory than in practice.
Most of SQL is not imperative, but it certainly also includes some imperative commands.
Inserting a new row into an existing table is an imperative command.
Only the subset of SQL that is used for queries can be said to not be an imperative programming language.