Complete and print the following SQL transactions. Log your statements and resul
ID: 3708077 • Letter: C
Question
Complete and print the following SQL transactions. Log your statements and results by spooling your file (with echo on from Oracle if available).
List the ResNum, RoomNum, RoomType, RoomTypeDesc, and Rate Amt for rooms reserved with a rate amount less than or equal to $119. Sort by rate amount in descending order, then by room number in ascending order. Show the rate amount formatted as currency.
ResDetail Customer CustlD CustFName CustLName CustPhone CustType LoyaltylD Reservation ResID CheckinDate CheckOutDate CustID AgentID ReslD Room CustType CustType CustTypeDesc RoomNum RateType RateAmt RoomType Agent AgentlD AgentFName AgentLName AgentType RateType RateType RateTypeDesc RoomType RoomType RoomTypeDesc AgentType AgentType AgentTypeDescExplanation / Answer
SELECT R1.ResID as ResNum, R2.RoomNum, R3.RoomTypeDesc, '$'+R2.RateAmt as RateAmt
FROM Reservation R1, ResDetail R2, RoomType R3, Room R4
WHERE R1.ResID = R2.ResID AND R2.RoomNum = R4.RoomNum AND R4.RoomType = R3.RoomNum
AND R2.RateAmt >= 119
ORDER BY RateAmt DESC, R2.RoomNum;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.