Hacker News new | past | comments | ask | show | jobs | submit login

I may be confused, but according to Wikipedia http://en.wikipedia.org/wiki/Projection_%28relational_algebr... it seems that in relational algebra notation the attribute names are written before the relation, since the relation is an argument to the projection function.

This seem to me to be closer to SQL syntax.




The attribute names are written first, but it's like nested function calls: projection(selection(R)). The joins are 'evaluated' first, then selection (where), and then projection.

I suspect that SQL was actually designed to match the notational order (but reversing the intent) they still got it wrong: to match the notation, it should be SELECT .. WHERE .. FROM.


Interesting point, but that would apply to function notation in general, not just relational algebra.

a(b(c(x))) is "backwards" because the functions are evaluated in the opposite order than they are written. This is a flaw in math and in most programming languages! I suppose stack-based languages have it right, and the OO method chaining syntax in Linq and in e.g. JQuery has it right, since evaluation order is left-to-right.




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

Search: