2 ms·
> SQL is masquerades as declarative. It's relational algebra in disguise. IMHO declarative and relational algebra are orthogonal concepts. And why do you say S
by funcDropShadow 4y ago
> SQL is masquerades as declarative. It's relational algebra in disguise.
IMHO declarative and relational algebra are orthogonal concepts. And why do you say SQL is relational algebra in disguise (paraphrased) ? Most introductions to SQL I've read, but certainly the SQL page on Wikipedia [1], starts with a remark about Codd's relational model. Granted SQL does not implement it perfectly, and it is not perfectly declarative, although that is a matter of taste.
> Non trivial amount of effort to go from question to query: I often feel like I have to jump through hoops to obtain something trivial.
I've had colleagues which expressed similar sentiments, but I have the opposite impression. I think I can express many queries on a much higher abstraction level than with most other languages.
> I have to think, and I don't want to think.
Not wanting to think while writing code is an understandable wish, but also a big red flag about developers for me. Even the best AI with perfect mind reading capabilities will not be able to execute the query you want, if you don't know what you want yourself. Even the AI would guess sometimes right, you would have no way of knowing whether it was right or wrong.
[1]: https://en.wikipedia.org/wiki/SQL https://en.wikipedia.org/wiki/SQL
- fny 4y ago> Not wanting to think while writing code is an understandable wish, but also a big red flag about developers for me. Dude... these are simple queries. I have *far* more important things to ponder than the specific incantations needed to get one of the values that correspond to a maximum.
- trimethylpurine 4y agomax() is an iso standard function. But you need to think relationally to express exactly which maximum you're looking for, that's true. I can see wanting the language to do that for you, but that would be extremely limiting, since every problem seeking the "maximum" isn't remotely similar. Imagine a request for fewer tools in a toolbox. It might take time to learn where they are located, but they are all in the box for a reason. There's a certain point in learning SQL where you stop thinking about your work in rows and columns and you start thinking in tables. When that happens, you'll easily write good code with very little thinking. Give yourself time. Also look into dynamic SQL if you're concerned with repetition. There's no reason SQL should be overly so.