4 ms·
> CQL is not a database management system: it neither stores nor updates data. The same could be said for SQL. How does CQL differ from SQL? If I squint my eye
by bob1029 5mo ago
> CQL is not a database management system: it neither stores nor updates data.
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 schema
- khana 5mo ago[dead]
- js8 5mo ago> How does CQL differ from SQL? SQL 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.
- randomNumber7 5mo agoSQL is not an imperative programming language.
- adrian_b 5mo agoDROP TABLE ? 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, which may be the most frequently used of the SQL features, in certain applications concerned with recording transactions. Only the subset of SQL that is used for queries can be said to not be an imperative programming language.
- da_chicken 5mo agoNo. Standard DDL and DML are declarative in SQL, including DROP and INSERT. Those still don't tell the system how to accomplish the thing. Declarative doesn't mean idempotent, and it doesn't mean stateless. Imperative SQL is the procedural elements that mostly do not exist at the standard level. Variables, control flow, and cursors.
- FrustratedMonky 5mo ago"how to accomplish the thing." I always thought this was splitting hairs. C#,C++, Java seems imperative. You are in control? But you aren't really telling it how to move values between registers, the compiler is making a million decisions for you on how the computer will execute that 'imperative' code. Just like SQL isn't really telling the DB how to do it either..
- cmrdporcupine 5mo agoIt's really a matter of degrees though. You're waving away a big part of the big sell of a relational database as proposed by Codd, which is that the user need not "know" the structure of the data in order to formulate operations on it because there's a consistent set-oriented model that can be used with a bunch of different physical storage forms but also the very sequence of relational operations against it can be re-ordered / restructured without the user knowing. And that the same data can be accessed in N number of ways that don't require changing the underlying storage. In theory. In practice SQL databases are only sort-of there. Contrast that if I create a class/object/field structure/hierarchy in Java, or put a HashMap somewhere with a certain set of keys, I've written something in stone which requires significant refactoring if the data needs to be accessed from a different direction.
- khana 5mo ago[dead]
- cmrdporcupine 5mo ago
- thesz 5mo agoFor all practical purposes, it very much is, consider random number generation.
- layer8 5mo agoWhile agree with the main statement, I don’t understand the point about RNG. You don’t need Turing-completeness nor imperativeness for RNG.
- thesz 5mo agoMost probably you do not want two of your SELECT statements to have the same seed during the execution. This necessitates some state, most probably, persisted one. Hence, imperativeness.
- jeltz 5mo agoThe main innovation here seems to be compile time checking of that foreign keys are respected but that is a thing that can be added to SQL and there is at least one proposal for doing so. So I do not really see anything fundamentally different from SQL. https://keyjoin.org/ https://keyjoin.org/ Full disclosure: I am one of the co-authors of this paper and an associated patch implenting it in PostgreSQL that we have proposed. I am happy to see more people than us think this is useful.
- JoelJacobson 5mo agoHere is a tl;dr as well: https://keyjoin.org/tldr.html https://keyjoin.org/tldr.html
- mamcx 5mo ago> How does CQL differ from SQL? Most attempts to replace/improve SQL derive from the fact SQL was a poorly conceived and designed interface, that originally was meant to be a very small DSL for end users, but unfortunately, was allowed to become a poor, complicated, confusing mess for app developers: https://cacm.acm.org/research/50-years-of-queries/ https://cacm.acm.org/research/50-years-of-queries/ SQL is not an orthogonal language... This is because, in the early days, Ray Boyce and I did not think we were designing a language for programmers. .. As it turned out, Ray and I were wrong about the predominant usage of SQL... (same problem from JS, php, etc: Creators don't anticipate that developers will suffer and torture their needs with such anemic ideas!) --- So the #1 thing any actual replacement or alternative to SQL is how actually become a good language for development, so it is actually composable, can be actually be used to reason about it, has minimal foot guns, etc. There is a lot of misunderstanding and pushback, similar to how people in the past fight improvements over JS/C/C++ until typescript, rust comes. But, oh boy, SQL need their typescript!
- Groxx 5mo agoSince it took bit of time and multiple broken links to find: https://categoricaldata.net/examples https://categoricaldata.net/examples has links to a lot of info about CQL for learning/comparing/etc. (edit: in retrospect, this is just the "getting started" header link, despite the URL) Unfortunately none that I've followed seems to do much to describe much of anything except the math foundations. They might cover pieces of syntax, but not how to use or think about them, and they seem to be rather excited about the data-generating features that I can't imagine anyone using outside tech demos (unless that's the only insert method? what about update?) :/ (edit 2: you can't even rely on the manual apparently, I'm fairly confident https://categoricaldata.net/help/Demo.html https://categoricaldata.net/help/Demo.html (manual -> examples -> demo) won't work because it has no schema definition for `Animal`. and it like all the others I've checked are little more than syntax and output, no real explanation)