Consider the Is A relationship between Student(Id,Major) and Person(Id, Name). Write the triggers appropriate for maintaining this relationship: when a tuple is deleted from Person, the tuple with the same Id must be deleted from Student; when a tuple is inserted into Student, check whether a corresponding tuple exists in Person and abort if not. (Do not use the ON DELETE and ON INSERT clauses
provided by the FOREIGN KEY statement.)
What will be an ideal response?
```
CREATE TRIGGER MaintainStudIsaPerson1
AFTER DELETE ON Person
REFERENCING OLD AS O
FOR EACH ROW
DELETE FROM Student
WHERE Id = O.Id
```
```
CREATE TRIGGER MaintainStudIsaPerson2
BEFORE INSERT ON Student
REFERENCING NEW AS N
FOR EACH ROW
WHEN (NOT EXISTS(
SELECT * FROM Person P
WHERE P.Id = N.Id ) )
ROLLBACK
```
You might also like to view...
A slide can be repositioned in a presentation by dragging its thumbnail in the Slides pane to the new location
Indicate whether the statement is true or false
Word can convert text into tables but cannot convert tables into text
Indicate whether the statement is true or false