Expressive Power of SQL (2003) [pdf]
homepages.inf.ed.ac.uk
homepages.inf.ed.ac.uk
However, most other DBs do (e.g. Postgres, MS SQL, MySQL 8.0, MariaDB 10.2, Oracle, etc.).
Which is disappointing, given how powerful BQ and Presto/Athena are for startups.
Note though that simply replacing CTE references with appropriate sub-queries simply won't work in the recursive case, and in some cases where a CTE is referred to multiple times the result may be an even less optimal query plan.
[0] https://stackoverflow.com/questions/4740748/when-to-use-comm...
I'm not sure what the bit about comparing cardinalities refers to. I think it relates to Trakhtenbrot's theorem, or the Löwenheim–Skolem theorem, but I'd appreciate it if someone clarified this.
As it is, my intuition is that the result mentioned is for either finite or infinite relations, or in any case for some broad case of unrestricted sentences (any formula in any language), whereas there are restricted cases where it doesn't hold (sort of like satisfiability).
Like I say, if anyone knows what this refers to, please speak up.
____________________
[1] https://en.wikipedia.org/wiki/Trakhtenbrot%27s_theorem
[2] https://en.wikipedia.org/wiki/L%C3%B6wenheim%E2%80%93Skolem_...
From the answers here https://stackoverflow.com/questions/900055/is-sql-or-even-ts...
It seems that SQL92 was not Turing complete but it became turing complete later on. Possibly by the same extensions added in SQL3.
See also: https://wiki.postgresql.org/wiki/Cyclic_Tag_System
They even had their own custom logic to do table JOINs. It involved fetching and deserializing both entire tables with SELECT *, of course.
Relational calculus at its finest, me gusta.
Even if it is -- "turing complete" != "expressive".
They're rather different beasties, in fact.