Question: 2 . 3 Modifications to course _ offers table Whenever a course is removed from the course _ of fers table, it should also update
Modifications to courseoffers table
Whenever a course is removed from the courseof fers table, it should also update the st udentcourses table such that all the student entries for that course in that particular session and semester should be removed. The totcredits in the student table for the removed students should also be updated. If the course is added, ensure that courseid is present in the courses table and professorid is present in the professor table.
Given an entry that is to be inserted into the courseof fers table, create a trigger that makes sure that a professor does not teach more than courses in a session. Also make sure that the course is being offered before the associated professor resigns. If in any case the entry is not valid show an "invalid" message or else insert the entry into the table.
Modifications to department table
Write a single trigger using which on update on the department table, if deptid is updated, updates all course ids of the courses belonging to that department according to the new deptid in courseoffers, courses and studentcourses tables ie update the first three digits of the courseid according to new deptid also update it in professor and student tables. On delete, before deletion, check if there are no students in the department, if there are students show a "Department has students" message, else delete the department record and further delete all courses from courseoffers, courses tables and professors in that department from professor table.
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
