3 ms·
> and after GROUP, an extra BY needs to be written. group /= groupBy. Group just put things in groups. GroupBy allows for a function on the item to be used (
by mrkeen 3y ago
> and after GROUP, an extra BY needs to be written.
group /= groupBy.
Group just put things in groups. GroupBy allows for a function on the item to be used (think passing a custom comparator into a sort() function). In SQL's case I think this is just limited to a column id, but I could be wrong.
> The main downside of being like natural language is non procedural. Program logic is generally executed step by step
SQL has thrived on being non-procedural. It is high-level and abstract, and its various implementations make much better optimisations than would the average-idiot-programmer-in-a-hurry.
All that would go out the window if the programmer had to write how to do things. Forget 'repeatable read' or 'linearisable' or any correctness guarantees provided by a database - if it's up to the programmer to write how, not what, then your correctness guarantees are basically: "I hope every programmer who touched this codebase took the right number of locks in the right order at the right time".