3 ms·
If you think in terms of relational algebra, and forget about the SQL syntax, it's easier to see the beauty. There's precious little difference between se
by barrkel 7y ago
If you think in terms of relational algebra, and forget about the SQL syntax, it's easier to see the beauty.
There's precious little difference between
set.select { |x| x.a > 10 }
.group_by { |x| x.c }
.map { |c, xs| xs.length }
and
select count(*)
from set
where a > 10
group by c
except the latter has more scope for optimization.
- emmelaich 7y agoThis is key! Programmers can easily tie themselves in knots answering these questions with a 'normal' programming language. Whether or not you're actually writing SQL, it's a good conceptual approach.