Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

5. Our efficiency focus eliminates free time for fresh thinking.

Answered: 1 week ago