If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Complete set of R.A. operators

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-03, 14:33
seethetipi seethetipi is offline
Registered User
 
Join Date: Oct 2003
Posts: 5
Unhappy Complete set of R.A. operators

I've got an assignment, and am stuck.

Is {π, U, –, ·} a complete set of relational algebra operators? If not, which of the relational algebra operations can't be difined using this set.

Hope someone have time to help....
Reply With Quote
  #2 (permalink)  
Old 10-06-03, 18:41
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Re: Complete set of R.A. operators

Quote:
Originally posted by seethetipi
I've got an assignment, and am stuck.

Is {π, U, , ·} a complete set of relational algebra operators? If not, which of the relational algebra operations can't be difined using this set.

Hope someone have time to help....
First: spell 'em out. I see project, set union, a blank and a multiplication dot, which I've never seen used as a relational operator. (Well, I used it once, but I'm hardly an authority.)

I'll assume that you're not looking to define any extended relational operations such as grouping or outer joins. I'll further assume you've never read Date and Darwen's material, so you aren't allowing relation-valued attributes.

The best way to decide whether or not you have a full set of operations is to come up with some example queries you want to perform and figure out how to do them with what you've got.
Reply With Quote
  #3 (permalink)  
Old 10-14-03, 09:22
seethetipi seethetipi is offline
Registered User
 
Join Date: Oct 2003
Posts: 5
thank you, your tip was actually very good

(it was supposed to be project, union, minus and join)
Reply With Quote
  #4 (permalink)  
Old 10-14-03, 16:54
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Quote:
Originally posted by seethetipi
thank you, your tip was actually very good

(it was supposed to be project, union, minus and join)
Oh, okay. I've usually seen join written as a bowtie, e.g. |X|.

Try this:

Suppose I have a relation (table) named "Student Equals Child" with attributes (columns) named "Student" and "Child" and every possible tuple (row) such that "Student" is equal to "Child". Part of it might look like this:

Student | Child
----------+--------
Bob | Bob
Mary | Mary

And so forth, with every possible name. Now, I have a database with two relations "Students" and "Parents of Children". I'm trying to find the parents of some subset of "Students", but "Parents of Children" has two attributes, "Parent" and "Child" whereas Students only has "Student."

Suppose Students looks like this:

Student | ...
-----------+------
Bob | ...
Mary | ...

So I join "Students" against "Student equals Child". Now I get:

Student | Child | ...
-----------+------+---
Bob | Bob | ...
Mary | Mary | ...

Now I can use the project operator to preserve all columns except for "Student", thus getting:

Child | ...
------+---
Bob | ...
Mary | ...

So now you can see how an infinite relation can be used along with natural join to get a rename operator.

I've actually done most of this in Scheme (a variant of LISP), and managed to get my primitives down to 4, while implementing the extended relational model, including grouping, restrict clauses, and a form of outer join through what amounts to a lot of macro expansions.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On