5 ms·
> SQL has never been a particularly elegant language I hear that often. But SQL is close to a 1-to-1 mapping with sets of data. It's refreshing to use somethin
by hvidgaard 9y ago
> SQL has never been a particularly elegant language
I hear that often. But SQL is close to a 1-to-1 mapping with sets of data. It's refreshing to use something as math like when programming. I find that elegant.
- pjmlp 9y agoI like that it feels very declarative and that the imperative extensions are all kind of Ada like.
- kazagistar 9y agoYou might find the criticisms in this article interesting (on the jooq blog, a java query builder library). https://blog.jooq.org/2016/12/09/a-beginners-guide-to-the-true-order-of-sql-operations/ https://blog.jooq.org/2016/12/09/a-beginners-guide-to-the-tr...
- hvidgaard 9y agoIndeed that is valid criticism. I suppose after using SQL for a number of years, the logical order is just ingrained. I would be nice for it to be required to be written in the logical order though.
- matwood 9y agoI agree. Of course any language has its warts, but when dealing with data I don't know of a better language than SQL.
- xeonoex 9y agoThere's a lot of simple improvements that could be made to the syntax. Some DBMSs (mostly Postgres) do make syntax improvements, but I'll never understand why Oracle still doesn't support "is <not> distinct from". If I want to do a join where null == null is true, I have to write (NOT (a <> b OR a IS NULL OR b IS NULL) OR (a IS NULL AND b IS NULL)) instead of "a is not distinct from b". The query structure is odd as well. I think it should more like from <tables> [declare] <calculations, scalar variables> [group by] [where] select Where declare is a section to declare variables (or virtual variables), so that you do not have to rewrite a calculation every time it is used. You could also declare scalar variables there. There's also no reason to have both a where and having clause.