Re: MultiValue Databases

From: Neo <neo55592_at_hotmail.com>
Date: 7 Jun 2005 10:46:34 -0700
Message-ID: <1118166394.893495.9820_at_z14g2000cwz.googlegroups.com>


> > *** xrdb query ***************************************
> > (SELECT * phone# 111-1111 & * phone# 222-2222)
>
> **** RM's query ****************************************
> here is a query ...
> SELECT person.name
> FROM person,
> phone,
> person_phone
> WHERE person.personID = person_phone.personID
> AND person_phone.phoneID = phone.phoneID
> AND phone.number = "111-1111"
> INTERSECT
> SELECT person.name
> FROM person,
> phone,
> person_phone
> WHERE person.personID = person_phone.personID
> AND person_phone.phoneID = phone.phoneID
> AND phone.number = "222-2222"
>
> The xrdb query is less verbose, but that's not necessarily better.

John, thanks for the proper query. I would agree that being less (or more) verbose isn't necessarily better.

> As an aside, one of the things I like about relational algebra is that
> it is defined in terms of a few simple operations and has a good
> theoretical basis that allows you to reason about it.

I would agree that relational algrebra is defined in terms of a few simple operations (select, project, join, union, intersection, complement, product, and division, etc) and has a good theoretical basis.

Now suppose one wanted to store "John likes Mary". Below I add this data in xrdb and query for the relationship between John and Mary; and also between John and 111-1111. Starting with the provided RM schema/data, how can one use the relational operations to store and query the same? (If new schema is needed, please suggest one)

(CREATE verb inst *like)
(CREATE john like mary)
(SELECT john * mary)     // Query returns like.
(SELECT john * 111-1111) // Query returns phone#.
Received on Tue Jun 07 2005 - 19:46:34 CEST

Original text of this message