Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4075358
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:17:16+00:00 2026-05-20T17:17:16+00:00

I am currently working on a homework assignment that requires a selection to occur

  • 0

I am currently working on a homework assignment that requires a selection to occur that pulls out an element containing a specific attribute of maximum value compared to all other records. I’ve read a number of sources online that reference an “aggregate” relational algebra function called maximum, but they don’t describe how it works using the basic operators. How does one select the attribute containing a maximum value?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:17:17+00:00Added an answer on May 20, 2026 at 5:17 pm

    You can very well express aggregate functions with only basic operators. It’s a pretty neat thing.

    Suppose we have a table T, and we’d like to find the maximum of its “value” field. First, we should take the cartesian product of T with itself — or rather with a copy of itself, T2. Then we select the rows where T.value is smaller than T2.value: this nets us all the unwanted rows, whose value is less than the value of some other row. To get the maximal values, we should subtract these unwanted rows from the set of all rows. And that’s it. At least that’s the basic idea, we also need to use projections to get the dimensions right.

    Unfortunately I have no idea how to insert Latex here, but using relational algebra notation, it’d be something like this:

    π(T.a1...Tan, T.value)(T)
        -
    π(T.a1...Tan, T.value)(
        σ(T.value<T2.value)( ρ(T, T2) x T )
    )
    

    where π is the projection operator, – is the set difference, σ is the selection operator and ρ is the rename operator.

    SQLishly:

    SELECT T.* FROM T
        MINUS
    SELECT T.* FROM T, T as T2 WHERE T.value<T2.value
    

    And more practically:

    SELECT T.* FROM T LEFT JOIN T as T2 ON T.value<T2.value WHERE T2.value IS NULL
    

    Of course, all this is mostly only of academic interest, i.e. that it shows that the relational algebra works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a problem that requires the random selection of an element
I am currently working on a homework assignment and I am thoroughly stuck. I
I'm currently working on a Win32 program which requires a main window containing many
I'm currently working on creating a new C# project that needs to interact with
I am currently working on a project with specific requirements. A brief overview of
The system I am currently working on requires some role-based security, which is well
G'day guys, Trying currently to finish up a bit of homework I'm working on,
I'm working on a homework assignment for CS1, and I almost have it finished
I am currently working with PHP code that random selects colors: <div onclick=location.href='<?php the_permalink()
i am currently working on a approach to parse a site that contains datas

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.