Re: Expressing SQL in relational algebra

From: Bob Badour <bbadour_at_golden.net>
Date: 1 Apr 2003 22:56:51 -0800
Message-ID: <cd3b3cf.0304012256.1e1d42b3_at_posting.google.com>


neo55592_at_hotmail.com (Neo) wrote in message news:<4b45d3ad.0303181014.20673443_at_posting.google.com>...
> > > SQL: "SELECT * FROM T_Person WHERE (age=20) AND (weight=180);
> >
> > Relational Algebra:
> > T_Person | age=Years(20) AND weight=Pounds(180)),
> > RESTRICT(T_Person,age=Years(20) AND weight=Pounds(180)),
> > T_Person WHERE ( age=Years(20) AND weight=Pounds(180) )
> >
> > > SQL: "SELECT * FROM T_Car JOIN
> > > T_Part ON T_Car.ID = T_Part.CarID WHERE T_Part.Color = 'red'";
> >
> > Relational Algegra:
> > ((T_Car RENAME ID AS CarID) JOIN (T_Part)) WHERE Color = Color('Red')
>
> What is the advantage of expressing a query in relational algebra?

I added you to my ignore list awhile ago so I don't ordinarily see your posts. I am forced to use deja tonight so the ignore list is inactive.

Both the relational algebra and the relational calculus have a sound theoretical foundation, which is somewhat lacking in SQL. There are constructive proofs that the relational algebra and the relational calculus are equally expressive. Some might argue that automated query re-write is easier to implement for the algebra.

An equally important question is: What is the advantage of expressing a query in anything but the relational algebra? Received on Wed Apr 02 2003 - 08:56:51 CEST

Original text of this message