Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Relationals vs. Objects Databases I

Re: Relationals vs. Objects Databases I

From: Kazimierz Subieta <subieta_at_ipipan.waw.pl>
Date: 1998/01/28
Message-ID: <34CF578C.7751@ipipan.waw.pl>#1/1

Karl & Betty Schendel wrote:
>
> On 27 Jan 1998 19:11:11 GMT, "Richard Ronteltap" <rontltap_at_euronet.nl> wrote:
>
> >>>I think a database programming language should be capable to to
> >>>all of the work.
> >>In principle I do agree, and theoretically SQL is capable of this.
> >
> >No. SQL is *theoretically* incapable to do all the work because it
> >is no computationally complete. (Has to do with Turing machines).
> >
> >For example: Tell me the SQL statement that gives the top 100
> >most expensive products in a product table with name and price
> >attributes.
>
> Bzzt! Wrong challenge. You can do that one in SQL, although it will
> probably run like frozen dogshit.
> select product from prod_table p1
> where 100 <= (select count(*) from prod_table p2
> where p2.price > p1.price)

Right challenge, wrong example.
Imagine all prices are equal and we have 1000 products. Your query returns no tuple. Richard wants 100 (random) tuples. Right?

Of course, your example is wrong in all other cases, but this is evident.

Kaz Received on Wed Jan 28 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US