Question: 1. we need to alter an existing table and adding a bookingno that is auto-numbered. Design steps to save the current data of the booking

1. we need to alter an existing table and adding a bookingno that is auto-numbered. Design steps to save the current data of the booking table to another table, alter the booking table to add the new column bookingno which is auto-numbered and re-insert the old data automatically creating bookingno values. 2. The view for the booking table needs to include the bookingno column. 3. Using the views vhotel, vroom, vguest and vbooking, code a function that calculates the cost of a guest's stay given a bookingno as a parameter. Call the function BOOKINGPRICE(). The function take an input INT parameter of the bookingNo and calculates the booking price using the formula:

Cost of Stay = No of Days * Price of room/Day L> booking.room.price column | datediff(Checkout date,Checkin Date) 4. Test your results by running a query that reports the booking price and the following columns. Report should be for all bookings. Pass the bookingNo to the bookingprice() function in the SQL, and use bookingprice() function to calculate the tax and service charge. Hotel Name, Guest Name, Check-in Date, Check-out Date, Price of Stay, Tax, Service charge

Where tax is bookingprice * .875 and service charge is bookingprice * .18.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!