0

I'm new to relational algebra and i have a simple question. Lets say we have two tables : TOP(object_id, number) and Renter(object_id, number, rent). My job is to get : Object_id and number from TOP with the highest rent price. The thing i did is : ∏ object_id, number( Gmax(rent) (TOP ⋈ Renter))

is that correct? A saw that the calligraphic 'G' is used instead of the select operator . But why? Is it because we select a list of all the tuples and then the output is a single result?

specbk
  • 99
  • 2
  • 13
  • Please edit into your question what reference(s) you were given for "relational algebra" and curly-G. There's no standard "relational algebra". – philipxy Jan 30 '17 at 23:36

1 Answers1

0

There's no single relational algebra, and there's no single extended one beyond the original (non-aggregating) capabilities. Please give a reference to or definition of yours. If you were told to find the max value of an attribute it seems unlikely that the intended solution was to do it just by calling an extended operator that gives it, since you can do it without as long as you can restrict on inequality, so find out.

get : Object_id and number from TOP with the highest rent price

∏ object_id, number( Gmax(rent) (TOP ⋈ Renter))

Presumably Gmax returns the restriction of its relation argument to the tuples with the maximum value in the specified column?

Problem: Your expression involves selecting tuples formed from TOP tuples with the object id and number of a Renter.

See this answer.

Community
  • 1
  • 1
philipxy
  • 14,867
  • 6
  • 39
  • 83