Given the relational algebra query
ρ_R(supplierId,averagePrice)_{supplierId}
F_{AVGunitPrice}(Product)ρR(supplierId,averagePrice)supplierIdFAVGunitPrice(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;
Given the relational algebra query ρ_R(supplierId,averagePrice)_{supplierId} F_{AVGunitPrice}(Product)ρR(supplierId,ave
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Given the relational algebra query ρ_R(supplierId,averagePrice)_{supplierId} F_{AVGunitPrice}(Product)ρR(supplierId,ave
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!