Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

True - Superficially SQL may appear to be simple, old fashioned and a bit verbose, but once you are expert with it (takes at least 5 years) is amazingly powerful. Operates at a much higher abstraction level than Java, Python etc, so is I would guess 25 times more expressive. Postgresql pure SQL CTE’s give you variables and recursion PLpgsql gives you dynamic sql for macro/meta programming. If you use immutable tables can be purely functional. SSDs and now even faster Optane memory have resolved the IO problem which handicapped RDBMs until recently.


SQL is not more expressive than Turing Complete languages, no.


They’re all Turing complete inc SQL with case and recursion. I meant density, 1 line of a code, a SQL window function with a filter clause would probably take a page of Java to achieve the same result.


Nope, Java has map and filter just fine. Eg

``` Words.stream() .map(word -> String.toUpperCase(word)) .filter(word -> word.startsWith('A')) ```


SQL window functions aren't rocket science(not that I've used them much, cause ORMs and popular stripped down DBs like MySQL tend to not support them very well), but they do a lot more than you think if you're comparing them to trivial map/filter operations.


Map and filter together in Java reflects why you get from SELECT and FROM without aggregate, much less analytical (window) functions. Aggregate and analytical functions correspond to reduction operations, which Java supports but doesn't come with canned equivalents to common analytical methods, just aggregates, AFAIK.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: