Page 1 of 1

Given the relational algebra query ρ_R(supplierId,averagePrice)_{supplierId} F_{AVGunitPrice}(Product)ρR​(supplierId,ave

Posted: Fri May 20, 2022 10:40 am
by answerhappygod
Given the relational algebra query
ρ_R(supplierId,averagePrice)_{supplierId}
F_{AVGunitPrice}(Product)ρR​(supplierId,averagePrice)supplierId​FAVGunitPrice​(Product)
, which of the following SQL queries produced the equivalent
relation?
Choice 1 of 4:SELECT supplierId, AVG(unitPrice) as averagePrice
FROM Product GROUP BY supplierId;
Choice 2 of 4:SELECT supplierId, averagePrice,
supplierIdFAVGunitPrice FROM Product;
Choice 3 of 4:SELECT RENAME supplierId, averagePrice FROM
Product WHERE supplierId=supplierID AND unitPrice =
AVG(unitPrice);
Choice 4 of 4:SELECT supplierId, averagePrice FROM Product GROUP
BY unitPrice;