Question: Question 2 : Implementing Triggers for Academic Status Updates ( 1 . 5 Points ) In our university database system, each student's academic performance is
Question : Implementing Triggers for Academic Status Updates Points
In our university database system, each student's academic performance is continuously monitored to provide necessary support and interventions as needed. The system calculates each student's Grade Point Average GPA based on their grades from various courses. This GPA is crucial for determining the student's academic status, which can be one of the following:
Good Standing: A student is performing well academically, with a GPA of or higher.
Probation: A student's performance has fallen below expected standards, with a GPA between and
At Risk: A student is at risk of failing with a GPA below
The student table tracks each student's academic status, but this status needs to be dynamically updated based on the latest grades entered into the takes table. To facilitate this, a view named studentgrades has been created refer to the ranking lecture where we created this view which calculates the GPA for each student.
Your task is to implement a database trigger that automatically updates a student's academic
status in the student table whenever a new grade is recorded in the takes table. This trigger
should use the GPA calculated in the studentgrades view to determine the appropriate academic
status based on the criteria outlined above.
Requirements
Table Alteration: Alter table student and add column academicstatus.
Trigger Creation: Write a trigger named triggerupdateacademicstatus that is
activated after an insert or update operation on the takes table.
Function Logic: The trigger should invoke a function that:
o Retrieves the affected student's GPA from the studentgrades view.
o Updates the academicstatus column in the student table based on the retrieved
GPA, according to the specified criteria for academic standing ie 'Good
Standing', 'Probation', or At Risk'.
Testing: Once you create and execute your trigger, reload your small relation insertion
file. Check the current status of student ID Now, update the grade of student ID
to A in the takes table, demonstrating how the trigger works.
Deliverables
SQL Code for student table alteration points
SQL code for the trigger and the associated function. point
SQL code for update statements to change the grade of student ID to A in the
takes table to test the trigger functionality. points
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
