我试图将此SQL查询写入关系代数
SELECT UserID, COUNT(ReviewID) AS NumberOfReviews FROM Reviewer
GROUP BY ReviewID
HAVING COUNT(ReviewID) > 2;
到目前为止,我已经做到了这一点:
π UserID, NumberOfReviews σ COUNT(ReviewID) > 2 γ ReviewID; COUNT(ReviewID)->NumberOfReviews (Reviewer)
我的问题是,我能否在SELECTION操作中使用COUNT()等聚合函数?