News for hackers. Stuff that matters.
Re:Left to Right Programming by 9rx on Tuesday August 19, 2025 @01:51AM (#44948630)
Interestingly, the inventor of relational algebra for database management put the "FROM" first in his query language: https://dl.acm.org/doi/pdf/10.1145/1734714.1734718
Re:Left to Right Programming by sgarland on Tuesday August 19, 2025 @09:05AM (#44951065)
What section did you see this? I see GET (i.e. SELECT) first.
Re:Left to Right Programming by 9rx on Tuesday August 19, 2025 @09:32AM (#44951323)
Section 3.3. "SELECT" only comes first if you omit "FROM". In SQL, if it allowed, that would be something like: `SELECT table.column`.
Re:Left to Right Programming by sgarland on Tuesday August 19, 2025 @10:45AM (#44952145)
Tuple Variables and their Range?

I don’t think I see what you see. From 3.3:

    RANGE PART P
    GET W (P.P#,P.PNAME,P.QOH):(P.QOH<25)
Re:Left to Right Programming by 9rx on Tuesday August 19, 2025 @11:03AM (#44952385)
Which approximately translates to:

   SELECT p.pnum, p.pname, p.qoh FROM part p WHERE p.qoh < 25
But a more direct translation would look something like:

   FROM part p SELECT p.pnum, p.pname, p.qoh WHERE p.qoh < 25
Even closer would be:

   FROM part p; SELECT p.pnum, p.pname, p.qoh WHERE p.qoh < 25
Of course they are different languages so we can only take things so far, but the pertinent bit is that the range specifier is declared first in ALPHA, whereas it is declared later, after the projection is defined, in SQL.