0 where departmentid 20m what are the result in the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y, 'NEW SAL'); END / Then, you enter the following SQL statement: UPDATE Employee SET Salary = Salary + 1000.0 Where Department_id = 20M What are the result in the EMP_LOG table? A EMP_ID LOG_DATE NEW_SALARY ACTION ---------- -------- ---------- ---------201 24-SEP-02 13000 NEW SAL 202 24-SEP-02 600 NEW SAL B. EMP_ID LOG_DATE NEW_SALARY ACTION ---------- -------- ---------- ---------201 24-SEP-02 14000 NEW SAL 202 24-SEP-02 7000 NEW SAL C. EMP_ID LOG_DATE NEW_SALARY ACTION ---------- -------- ---------- ---------201 24-SEP-02 NEW SAL 202 24-SEP-02 NEW SAL D. No rows are inserted. Answer: B Explanation: Employees with a Department Code = 20 are updated in the SQL Statement and 1000 is added to there existing salary. Employee Hartstein has a salary of 1300 and Employee Fay has a salary of 6000 before the update. The Trigger inserts a record for each row into the Emp_log table. The trigger specifies to insert the new value of the salary therefore the Salary values inserted will be 14000 for Hartstein & 700 for Fay. Answer A is incorrect the Trigger specifies to insert the new values. If the Trigger specified the: old.salary this would be correct Actualtests.com - The Power of Knowing 1Z0-147 Answer C omits the value f the: new.Salary Answer D is wrong. This trigger will fire and since it is a row-level trigger, it will insert a record into the Emp_log table for each record updated. QUESTION 90: Which code successfully calculates tax? A. CREATE OR REPLACE PROCEDURE calctax (p_no IN NUMBER) RETURN tax IS v_sal NUMBER; tax Number; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = p_no; tax := v_sal * 0.05; END; B. CREATE OR REPLACE FUNCTION calctax (p_no NUMBER) RETURN NUMBER IS v_sal NUMBER BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = p_no; RETURN:= v_sal * 0.05; end C. CREATE OR REPLACE FUNCTION calctax (p_no NUMBER) RETURN NUMBER IS v_sal NUMBER; tax NUMBER; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = p_no; tax := v_sal * 0.05; END D. CREATE OR REPLACE FUNCTION calctax (p_no...
View Full Document

Ask a homework question - tutors are online