Question: Introduction to Database System Design 5. Execute the following query in your university database to create a trigger to automatically calculate total earned credit of


Introduction to Database System Design 5. Execute the following query in your university database to create a trigger to automatically calculate total earned credit of students when new pass-grade (D to A) is assigned in takes table. [15 pointsl DELIMITER create trigger credits_earned after update on takes for each row begin if new.grade'F' and new.grade is not null and (old.grade - 'F' or old.grade is null) then update student set tot_cred- tot_cred+(select credits from course where course.course_id- new.course_id) where student.id new.id; end if end// DELIMITER You have to show the effect of the trigger by modifying a "F" grade of a student to any pass- grade. For that, do followings: (i) Get screen shot of the student table marking the student who has F grade of a course in takes table (ii (iii) You should now see change in tol cred field of student table. Give the screen shot of the change Change the F grade to a pass-grade
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
