Question: Enable auto increment for rental numbers in the RENTAL table. Start the values with 1 1 0 0 . Create a stored procedure named prc

Enable auto increment for rental numbers in the RENTAL table. Start the values with 1100.
Create a stored procedure named prc_new_rentalto insert new rows in the RENTAL table. The procedure should satisfy the following conditions:
The membership number will be provided as a parameter.
Use a Count() function to verify that the membership number exists in the MEMBERSHIP table. If it does not exist, then a message should be
displayed that the membership does not exist and no data should be written to the database.
If the membership does exist, then retrieve the membership balance and display a message that the balance amount is the previous balance.
(E.g., if the membership has a balance of $5.00, then display "Previous balance: $5.00".)
Insert a new row in the rental table using the current system date for the RENT_DATE value, and the membership number provided as the value
for MEM_NUM. The rental number should be provided automatically from the auto increment enabled in the previous problem.
Create a stored procedure named prc_new_detailto insert new rows in the DETAILRENTAL table. The procedure should satisfy the following
requirements:
The video number will be provided as a parameter.
Verify that the video number exists in the VIDEO table. If it does not exist, then display a message that the video does not exist, and do not write
any data to the database.
If the video number does exist, then verify that the VID_STATUS for the video is "IN." If the status is not "IN," then display a message that the
video's return must be entered before it can be rented again, and do not write any data to the database.
If the status is "IN", then retrieve the values of the video's PRICE_RENTFEE, PRICE_DAILYLATEFEE, and PRICE_RENTDAYS from the PRICE
table.
Calculate the due date for the video rental by adding the number of days in PRICE_RENTDAYS to 11:59:59 PM (hours:minutes:seconds) in the
current system date.
Insert a new row in the DETAILRENTAL table using the previous value returned by RENT_NUM_SEQ as the RENT_NUM, the video number
provided in the parameter as the VID_NUM, the PRICE_RENTFEE as the value for DETAIL_FEE, the due date calculated above for the
DETAIL_DUEDATE, PRICE_DAILYLATEFEE as the value for DETAIL_DAILYLATEFEE, and null for the DETAIL_RETURNDATE.
Enable auto increment for rental numbers in the

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 Programming Questions!