← Back to context

Comment by js8

7 hours 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.

SQL is not an imperative programming language.

  • For all practical purposes, it very much is, consider random number generation.

  • DROP 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.

    • No. 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.

      5 replies →