Equivalent of GroupBy and Having clause in Relational Algebra
问题 I was doing an assignment where I had to convert SQL queries into Relational Algebra queries. I got stuck in converting the group by clause. Could anyone please tell me how the group by clause can be written in relational algebra? e.g.: SELECT job, sal FROM emp GROUP BY job ; Thanks! 回答1: First of all your query is wrong you cannot select something that you did not group unless you use aggregation. I assume you want to get sum of the sal. job F sum(sal), job(emp). 回答2: Noting you want to get