Exercise 1: CREATE A VIEW Task: Create a view that shows customer rental information with customer names and film titles. Requirements: - Show: customer name, film title, rental date, return date - Name the view: customer_rental_info ============================================================ Exercise 2: CREATE A VIEW Task: Create a view showing top-earning films. Requirements: - Show: film title, category, total revenue, number of rentals - Name the view: `film_revenue` - Order by revenue (highest first) ============================================================ Exercise 3: CREATE A FUNCTION Task: Create a function to calculate late fees. Requirements: - Function name: calculate_late_fee - Input: rental_id - Logic: If returned late, charge $1.50 per day late - Return: late fee amount - Rental duration is in film.rental_duration (days allowed) ============================================================ Exercise 4: CREATE A STORED PROCEDURE Task: Create a procedure to rent a film to a customer. Requirements: - Procedure name: `rent_film` - Inputs: customer_id, inventory_id, staff_id - Should INSERT a new rental record with current timestamp - Return a message: "Rental successful" or error message ============================================================ Exercise 5: CREATE A TRIGGER Task: Create a trigger to automatically update customer's last_update timestamp. Requirements: - Trigger name: customer_last_update_trigger - Fires: BEFORE UPDATE on customer table - Action: Set last_update to current timestamp ============================================================ Exercise 6: BONUS - Using CURSOR Task: Create a procedure that uses a cursor to give loyalty points to top customers. Requirements: - Procedure name: award_loyalty_points - Give 100 points to customers who spent over $150 - Update a new column: customer.loyalty_points (you'll need to add this column first)