Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EX 5.5) Write triggers to enforce the referential integrity constraint from section to time slot, on updates to section, and time slot. Note that the

EX 5.5) Write triggers to enforce the referential integrity constraint from section to time slot, on updates to section, and time slot. Note that the ones we wrote in Figure 5.8 do not cover the update operation.

Please provide the answer in terms of the syntax from Database Systems Concepts, 6th Edition, Chapter 5.

Thank you.

The below SQL querry is the only thing provided in the book.

create trigger timeslot check1 after insert on section referencing new row as nrow for each row when (nrow.time slot id not in ( select time slot id from time slot)) /* time slot id not present in time slot */ begin rollback end; create trigger timeslot check2 after delete on timeslot referencing old row as orow for each row when (orow.time slot id not in ( select time slot id from time slot) /* last tuple for time slot id deleted from time slot */ and orow.time slot id in ( select time slot id from section)) /* and time slot id still referenced from section*/ begin rollback end;

Figure 5.8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

=+ How well do you think you could do your job?

Answered: 1 week ago