Complete and print the following SQL transactions. Log your statements and resul
ID: 3707999 • 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).
Change the Cust Type for Customer 120 to “C.”
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
/ Updating Customer table
UPDATE Customer
SET CustPhone = ‘214551234’
WHERE CustID = 85;
// Inserting values to Customer table
INSERT INTO Customer (CustID, CustFName, CustLName) VALUES (120, ‘Amanda’, ‘Green’)
// Updating values reservation table
UPDATE TABLE Reservation
SET CheckOutDate = ‘2/8/2018’
WHERE ResID = 1001;
// Adding a row in Reservation table
INSERT INTO Reservation VALUES (1011, ‘3/1/2018’, ‘3/4/3018’, 120, 14);
// Updating ResDetail table
UPDATE ResDetail
SET RateType = ‘C’,
RateAmt = 89
WHERE ResID = 1003;
// Updating ResDetail table for reservation 1011, the detail is updated twice so only last detail // will persist.
UPDATE ResDetail
SET RoomNum = 224,
RateType = ‘W’,
Rate = 119
WHERE ResID = 1011;
UPDATE ResDetail
SET RoomNum = 225,
RateType = ‘W’,
Rate = 129
WHERE ResID = 1011;
// Commiting the all the transactions.
COMMIT;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.