【正文】
For Each Row Event Before When (not (exists(Select * From Sailors Where sid = ) and (exists(Select * From Boats Where bid = )) ) Rollback。 Condition Action 規(guī)則 5 Create trigger sailors_sid_update Before Update of sid on Sailors Referencing Old as O For Each Row When (exists(Select * From Reserves Where sid = )) Rollback。 創(chuàng)建觸發(fā)器,對 Sailors表的 Update操作進行監(jiān)控,如果 Reserves表中有元組引用修改前的 sid值作為外鍵 ,回卷此修改操作。 監(jiān)視 Sailors表上的 Insert操作,對每條 Insert語句,判斷其插入后的元組是否有年齡小于 18的水手,將這樣的水手自動插入到 YoungSailors表中( YoungSailors表與 Sailors表的模式相同)。 規(guī)則 6 問題:與上面各題創(chuàng)建觸發(fā)器的范例有什么不同?如何實現(xiàn)? Create trigger young_sailor_update After Insert on Sailors Referencing New as N For Each Statement Insert into YoungSailors(sid,name,age,rating) Select sid,name,age,rating From N Where 19 。 針對每條語句!