Question: Create a trigger to update the TotalCount in AnimalNumbers when a row is deleted in Animal table. Instead of NEW.category it will be OLD.category. Also,
Create a trigger to update the TotalCount in AnimalNumbers when a row is deleted in
Animal table. Instead of NEW.category it will be OLD.category. Also, when it's an insert we use
After Insert, with a delete we will use After Delete
Now delete a bird record from the table by typing the following,
DELETE FROM Animal WHERE AnimalID;
write the query to show the AnimalNumbers table where category equals cat or bird only.
Screenshot the command and the output.
Type the command "show triggers" and screenshot the output through the first columns,
Trigger, Event, Table, Statement, Timing, Created.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
