Yes, this is a homework question but the names have been changed to protect the innocent. Meaning, I am not asking the homework question itself, but rather a small part of it so I can understand the whole.
Let's say you have a SQL query like this:
--The query would list car prices that occur more than once.
select car_price from cars
group by car_price
having count (car_price) > 1;
The general form of this in relational algebra is Y (gl, al) R Where Y is the greek symbol, GL is list of attributes to group, AL is list of aggregations
So the relational algebra would look like:
Y (count(car_price)) cars
So, how is the "having" clause written in that statement? Is there a shorthand? If not, do I just need to select from that relation? Something like this maybe?
SELECT (count(car_price) > 1) [Y (count(car_price)) cars]
I have searched the internet on this for hours and have found no examples of converting HAVING to relational algebra. Thanks for the help!