4. (2 points) Write a trigger that executes when a row is inserted into the DetailLoans table. If the number of AvailableCopies is 0, it should display a message that the book is out of stock and cannot be borrowed. Otherwise, it should decrement the AvailableCopies by one.
5. (2 points). "Create a view called OverdueLoans that displays all books that have been borrowed but not yet returned. The view should show the Title, FirstName,LastName, LoanDate, DueDate, and Notes columns.
With Notes column:
If the due date is less than or equal to the current date, the note should say: '
You are overdue for returning the book.'
If the due date is greater than the current date, the note should say: 'Pleasemake sure to return on time.'""
End
Zoom
+ 134%
Close