Re: [Help]How to translate from Algebra->SQL and viceverse?
Date: 7 Nov 2000 13:11:41 GMT
Message-ID: <8u8v2d$oc5$1_at_news.tue.nl>
macefindu wrote:
> Hi,
> My professor have teached us how to translate from Logic
> Language(LL) to SQL, and LL to Algebra, and then in exam appeared
> question about tranlate Algebra code->SQL code and SQL->Algebra, so I
> assumed that the only way was through the LL, becasue the direct
> tranlate from Algebra->SQL is almost impossible for me, especially
> with subqueries of more than 4 levels, im talking about kind of
> monster like this:
>
> select(select(select ... where (blablabla) or exists (select ...)));
>
> So my first question is: Is there a book i could learn more about
> this issue from?
> One more quesion from the last exam was:
> "to list all the clients who suffered more than one accidents in Algebra."
>
> table Client(client_id, insurance#,...) <-strong entity
> (primary key:client_id;foreign key:insurance#)
>
> table Accidents(insurance#, date, time) <-weak entity
>
> to do this one, i used "having count(*)>1" for table Accidents, but
> the problem is they didnt ask for SQL, so my question is: What is the
> equivalent algebra codes for "groups ... having ..." ?
And this is the result that was asked.
-- Kind regards, Jan HiddersReceived on Tue Nov 07 2000 - 14:11:41 CET