You are on page 1of 5

IT607 - Lab 2

Group 20 - 202318034 (Vikram), 202318057 (Kunal)

IV. Create stored procedures for a specific section.


1. Write a stored procedure to retrieve the names of all directors.
2. Write a stored procedure to update the stock quantity of a movie based on its
movie ID(hint: new_stock is to be given as parameter).

3. Write a stored procedure to calculate the total rental fees paid by a specific
customer.
V. Create functions for a specific section.
1. Create a function that retrieves the title of highest rated movie directed by a
specific director.

2. Create a function that returns the most rented genre of movies.


3. Count the number of reviews submitted by a specific customer.

VI. Create Trigger functions for a specific section.


1. Design a trigger that prevents inserting a new movie into the Movie_Table if its
release_date is in the future.
2. Create a trigger that calculates and updates the average rating for a movie in the Movie_Table
when a new review is added to the Review_Table( Give 90% weight to old ratings and 10% to
new review, I.e if old rating = 9 and review rating = 1, than new rating = 0.9*9 + 0.1*1 = 8.2).

3. Design a trigger that ensures the stock_quantity in the Movie_Table is


decremented by one when a movie is rented out from the Current_Rental_Table.

You might also like