Consider given database schema and write triggers for each statement. Student ( regNo, sName, sCity, sCGPA, sAge) Student_BACKUP( regNo, sName, sCity, sCGPA, sAge) Course ( cCode, cName, credit_hours) Enrollment (regNo, cCode, semester,quality_points,Grade) Enrollment_BACKUP(regNo, cCode, semester,quality_points,Grade) 1- Whenever a record is inserted in student table, system must check following constraints in inserted value. a. sAge between 18 and 25 b. sCGPA between 0.0 and 4.0 if any of constraints are violated, system must delete record inserted by user.
Consider given
Student ( regNo, sName, sCity, sCGPA, sAge) Student_BACKUP( regNo, sName, sCity, sCGPA, sAge) Course ( cCode, cName, credit_hours)
Enrollment (regNo, cCode, semester,quality_points,Grade)
Enrollment_BACKUP(regNo, cCode, semester,quality_points,Grade)
1- Whenever a record is inserted in student table, system must check following constraints in inserted value.
a. sAge between 18 and 25
b. sCGPA between 0.0 and 4.0
if any of constraints are violated, system must delete record inserted by user.
2- Write a
Other columns of Enrollment table can be updated.
3- Write a mechanism which should copy those record to “Enrollment_BACKUP” whose GRADE is ‘F’, whenever a record is inserted in Enrollment Table.
4- Write a mechanism which stores all deleted record to Student_BACKUP table whenever a record is deleted from Student table.
5- Write a trigger which must make sure primary key is note violated in course table whenever a record is inserted in course table.
Step by step
Solved in 2 steps