"OO" Equivalent of SQL Ad Hoc Program

From: Neo <neo55592_at_hotmail.com>
Date: 22 Dec 2006 11:27:36 -0800
Message-ID: <1166815656.448152.199900_at_79g2000cws.googlegroups.com>



The following from thread titled "Databases As Objects". If someone (Bob Badour) can describe the underlying data/structure, I would like to give it an attempt with an network/OO type db.

> Without even getting into a good data language but sticking with SQL,
> speculate on the OO equivalent of the following ad hoc program:
>
> INSERT INTO catalog(title, author)
>
> SELECT library.title AS title, guild.membername AS author
> FROM congress_books book JOIN congress_titles library USING (isbn)
> JOIN guild_pubs pub USING (isbn)
> JOIN guild_members guild ON (guild.member_id = pub.member_id)
> WHERE library.language = 'en_US'
> AND book.publication_date BETWEEN '20060101' AND '20061231'
> AND book.type = 'book'
> AND pub.role IN ( 'author', 'coauthor', 'co-author' )
> AND book.isbn != ALL ( SELECT isbn FROM blacklist )
> AND NOT EXISTS (
> SELECT 1 FROM catalog cat
> WHERE cat.title = library.title
> AND cat.author = guild.membername
> )
>
> UNION
>
> SELECT bnb.title AS title, bguild.name AS author
> FROM brit_natnl_biblio bnb JOIN guild_pubs bpub USING isbn
> JOIN guild_members bguild ON (guild.member_id = pub.member_id)
> WHERE bnb.pub_date BETWEEN '20060101' AND '20061231'
> AND bnb.serial = false
> AND bpub.role IN ( 'author', 'coauthor', 'co-author' )
> AND bnb.isbn != ALL ( SELECT isbn FROM blacklist )
> AND NOT EXISTS (
> SELECT 1 FROM catalog c
> WHERE c.title = bnb.title
> AND c.author = bguild.membername
> )
> ;
Received on Fri Dec 22 2006 - 20:27:36 CET

Original text of this message