問題詳情

QUESTION 109Which code can you use to ensure that the salary is not increased by more than 10% at a time nor is it ever decreased?
(A)ALTER TABLE emp ADDCONSTRAINT ck_sal CHECK (sal BETWEEN sal AND sal*1.1);
(B)CREATE OR REPLACE TRIGGER check_salBEFORE UPDATE OF sal ON empFOR EACH ROWWHEN (new.sal < old.sal ORnew.sal > old.sal * 1.1)BEGINRAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary not increase by more than 10%');END;
(C)CREATE OR REPLACE TRIGGER check_salBEFORE UPDATE OF sal ON empWHEN (new.sal < old.sal ORnew.sal > old.sal * 1.1)BEGINRAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary not increase by more than 10%');END;
(D)CREATE OR REPLACE TRIGGER check_salAFTER UPDATE OR sal ON empWHEN (new.sal < old.sal OR-new.sal > old.sal * 1.1)BEGINRAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary not increase by more than 10%');END;

參考答案

答案:B
難度:非常困難0
統計:A(0),B(0),C(0),D(0),E(0)