Yes, it is a matter of homework, but the names have been changed to protect the innocent. Meaning, I do not ask the question of homework itself, but rather a small part of it, so that I can understand everything.
Let's say you have an SQL query like this:
- The request will indicate prices for cars 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 a Greek symbol, GL is a list of attributes for a group, AL is a list of aggregations
Thus, relational algebra will look like this:
Y (count(car_price)) cars
So, how is the "having" clause in this expression? Is there an abridged version? If not, do I just need to choose from this relationship? Something like this maybe?
SELECT (count(car_price) > 1) [Y (count(car_price)) cars]
I worked on the Internet for hours and did not find examples of converting HAVING to relational algebra. Thanks for the help!
relational-algebra
user251249
source share