# Re: Expressing SQL in relational algebra

Date: Sun, 16 Mar 2003 01:39:10 -0500

Message-ID: <b51638$fps$1_at_slb3.atl.mindspring.net>

The question had nothing to do with what you think makes sense. So far as I know, in relational algebra, SQL, algebra, or just about anywhere else, T_Part is a valid identifier that works just as well as Part and exhibits the same behavior when neither identifier is bound to anything else in the scope.

Just what about identifier names is supposed to or required to make sense, and why does T_person or T_Badour fail the test?

Steve Kass

Drew University

Bob Badour wrote:

>"Neo" <neo55592_at_hotmail.com> wrote in message

*>news:4b45d3ad.0303152023.2e117071_at_posting.google.com...
**>
**>
**>>>>"SELECT * FROM T_Person WHERE (age=20) AND (weight=180);" in rel
**>>>>
**>>>>
**>algebra?
**>
**>
**>>>(T_Person | age=Years(20) AND weight=Pounds(180)),
**>>>RESTRICT(T_Person,age=Years(20) AND weight=Pounds(180)),
**>>>or T_Person WHERE ( age=Years(20) AND weight=Pounds(180) )
**>>>
**>>>
**>>Could the above also be expressed as "person ^ age ^ 20 ^ years ^
**>>weight ^ 180 ^ pounds" where ^ means AND?
**>>
**>>
**>
**>Not that I know of.
**>
**>Where does the above indicate the restrict operation or the equality
**>comparisons?
**>
**>
**>
**>
**>>How does Tutorial-D express joins such as: "SELECT * FROM T_Car JOIN
**>>T_Part ON T_Car.ID = T_Part.CarID WHERE T_Part.Color = 'red'";
**>>
**>>
**>
**>I haven't checked the exact syntax, but I would guess:
**>
**>((T_Car RENAME ID AS CarID) JOIN (T_Part)) WHERE Color = Color('Red')
**>
**>Why do you prepend every relation name with "T_" ? It doesn't really make
**>much sense.
**>
**>
**>
**>
*

Received on Sun Mar 16 2003 - 07:39:10 CET