Question: 2 . 3 Modifications to course _ offers table Whenever a course is removed from the course _ of fers table, it should also update

2.3 Modifications to course_offers table
Whenever a course is removed from the course_of fers table, it should also update the st udent_courses table such that all the student entries for that course (in that particular session and semester) should be removed. The tot_credits in the student table for the removed students should also be updated. If the course is added, ensure that course_id is present in the courses table and professor_id is present in the professor table.
Given an entry that is to be inserted into the course_of fers table, create a trigger that makes sure that a professor does not teach more than 4 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.
2.4 Modifications to department table
Write a single trigger using which on update on the department table, if dept_id is updated, updates all course ids of the courses belonging to that department according to the new dept_id in course_offers, courses and student_courses tables (i.e update the first three digits of the course_id according to new dept_id), 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 course_offers, courses tables and professors in that department from professor table.
 2.3 Modifications to course_offers table Whenever a course is removed from

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!