Question 9:
Create a trigger named deleteGenres for the delete statement on the "Genres" table so that when we call a delete statement to delete one or more rows from the "Genres" table, the system will automatically update the table Books to set GenreID as NULL for all books of the deleted genres.
For example, if we call the following statement to delete 2 genres with GenreID = 1 and GenreID = 2 from the "Genres" table, all the books of these two genres will be updated so that the GenreID of these books will be NULL.
delete from Genres where GenreID in (1,2)
Question 10:
Write statement to update the GenreID of the book named '1984' so that this book will belong to the genre named 'Horror'
8 of 8
Paper No: 5
Zoom
+ 112%
Close