dbTalk Databases Forums  

relational algebra question

comp.databases.theory comp.databases.theory


Discuss relational algebra question in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
riley
 
Posts: n/a

Default relational algebra question - 09-10-2003 , 03:43 AM






Howdi,

I'm not asking for the answer - but a gentle nudge in the right direction

I've been asked to write a Relational Algebra Expression to get the most
expesive item

i'm not really sure how to go about it,

any help appreciated



Reply With Quote
  #2  
Old   
Bob Badour
 
Posts: n/a

Default Re: relational algebra question - 09-10-2003 , 06:35 AM






"riley" <k@r.net.au> wrote

Quote:
Howdi,

I'm not asking for the answer - but a gentle nudge in the right direction

I've been asked to write a Relational Algebra Expression to get the most
expesive item

i'm not really sure how to go about it,

any help appreciated
What are the properties of the most expensive item?




Reply With Quote
  #3  
Old   
Jan Hidders
 
Posts: n/a

Default Re: relational algebra question - 09-10-2003 , 11:27 AM



riley wrote:
Quote:
I've been asked to write a Relational Algebra Expression to get the most
expesive item
Hint: First write an algebra expression for the items that are *not* the
most expensive. Then use this expression to build a bigger expression that
computes the answer that you want.

In case you have trouble finding that particular expression let me remind
you of the following trivial truth:

An item is not the most expensive one if there is another one that is more
expensive.

Good luck,

-- Jan Hidders



Reply With Quote
  #4  
Old   
Riza
 
Posts: n/a

Default Re: relational algebra question - 09-10-2003 , 08:43 PM



thank you for advice so far,

Find the "not most expensive items" sure -I get how I could do this with a
loop...like java, but in Relational Algebra?

And How can I traverse down a column comparing the next row to the previous?

the question says

Quote:
Express the query with RA expressions and a series of intermediate
relations

Do I make a recursive loop or something?

as I don't know how many items there are I can't see how I can, just using
">" and "<" make sure I definately have a group of either the most
expensive, or not the most expensive item..

(this question is actually really easy and I'm missing something simple,
yeh?)

riley

"Jan Hidders" <jan.hidders (AT) pandora (DOT) be> wrote

Quote:
riley wrote:

I've been asked to write a Relational Algebra Expression to get the most
expesive item

Hint: First write an algebra expression for the items that are *not* the
most expensive. Then use this expression to build a bigger expression that
computes the answer that you want.

In case you have trouble finding that particular expression let me remind
you of the following trivial truth:

An item is not the most expensive one if there is another one that is more
expensive.

Good luck,

-- Jan Hidders




Reply With Quote
  #5  
Old   
Bob Badour
 
Posts: n/a

Default Re: relational algebra question - 09-10-2003 , 10:02 PM



"Riza" <k (AT) wa (DOT) bp.net> wrote

Quote:
thank you for advice so far,

Find the "not most expensive items" sure -I get how I could do this with a
loop...like java, but in Relational Algebra?

And How can I traverse down a column comparing the next row to the
previous?

the question says

Express the query with RA expressions and a series of intermediate
relations

Do I make a recursive loop or something?

as I don't know how many items there are I can't see how I can, just using
">" and "<" make sure I definately have a group of either the most
expensive, or not the most expensive item..

(this question is actually really easy and I'm missing something simple,
yeh?)
Yeh. You want to write a single expression that involves no looping or
recursion. Just describe what you want or what you don't want.


Quote:
riley

"Jan Hidders" <jan.hidders (AT) pandora (DOT) be> wrote in message
news:yhI7b.12675$FL7.476299 (AT) phobos (DOT) telenet-ops.be...
riley wrote:

I've been asked to write a Relational Algebra Expression to get the
most
expesive item

Hint: First write an algebra expression for the items that are *not* the
most expensive. Then use this expression to build a bigger expression
that
computes the answer that you want.

In case you have trouble finding that particular expression let me
remind
you of the following trivial truth:

An item is not the most expensive one if there is another one that is
more
expensive.

Good luck,

-- Jan Hidders






Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.