Create Or Replace Trigger student_deleteBefore Delete On studentFor Each RowDeclare l_count Number;Begin Select Count(*) Into l_count From grade Where sno=:Old.sno; If l_count>0 Then Raise_application_error(-20001, '该学生有考试记录,不能删除'); Return; End If;End;