Question: 1 . 2 Write a relational algebra from this question using bag semantic. - - Question 1 . 1 SELECT users.usercode AS UserCode, AVG (
Write a relational algebra from this question using bag semantic.
Question
SELECT users.usercode AS UserCode,
AVGhotelspricepernight hotels.days AS AvgHotelPrice
FROM users
JOIN hotels ON users.usercode hotels.usercode
GROUP BY UserCode;
Write a relational algebra Question
SELECT Htravelcode AS TravelCode,
Husercode AS UserCode
FROM hotels H
JOIN hotels H ON Hhotelname Hhotelname
AND Hcheckindate Hcheckoutdate
AND Hcheckindate Hcheckoutdate
WHERE Htravelcode Htravelcode
AND Husercode Husercode;
Question : Write a relational bag semnatic algebra for this question:
SELECT travelcode,
flightprice pricepernight days AS TotalCost,
CASE
WHEN flightprice pricepernight days THEN 'Luxury'
WHEN flightprice pricepernight days THEN 'Cheap'
ELSE 'Regular'
END AS TripClass
FROM hotels
JOIN flights ON hotels.travelcode flights.travelcode;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
