De?ne triggers that ?re when a student drops a course, changes her major, or when her grade average drops belowa certain threshold. (For simplicity, assume that there is a function, grade_avg(), which takes a student Id and returns the student average grade.)

The action part of these triggers is uninteresting—just an insertion of a record into the log table, as we saw in earlier problems. We give an example of the last trigger.


```
CREATE TRIGGER WatchGPA
AFTER UPDATE, DELETE, INSERT ON Transcript
FOR EACH STATEMENT
WHEN (EXISTS (
SELECT StudId FROM Transcript T
WHERE grade_avg(StudId) < 3.0 ) )
INSERT INTO Log
SELECT DISTINCT StudId, grade_avg(StudId)
FROM Transcript T
WHERE grade_avg(StudId) < 3.0
```

Computer Science & Information Technology

You might also like to view...

In C++11, assuming mychar is a char variable and mystring is a string, what is the value of mychar after the following statement executes?

``` mychar = mystring.front(); ``` a. the ASCII value of the first character of mystring b. the first character of mystring c. nothing, the function is missing an argument d. this will cause a compiler error

Computer Science & Information Technology

Which types of routing RIP messages do you observe? The type of a RIP message is indicated by the value of the field command. For each packet type that you observed, explain the role that this message type plays in the RIP protocol.

What will be an ideal response?

Computer Science & Information Technology

Which of the following tips about text is not suggested in the Slide Show Design Principles?

A) Do not use underlined text. B) Use two spaces after punctuation in text blocks. C) Avoid using all capital letters. D) Use italics and bold sparingly.

Computer Science & Information Technology

A period and a(n) ________ separate the endnote number from the endnote reference

Fill in the blank(s) with correct word

Computer Science & Information Technology