QuestionQ14

VerifiedPL/SQL Language Fundamentals

Examine this data row from the EMPLOYEES table:

Question Image

Next, examine this code block, which executes successfully:

Question Image

What is the value of v_commission?

Explanation

v_salary is 50000 and v_title is AD_PRES. None of the preceding conditions evaluates to true: the salary is not below 20000, is not between 20000 and 40000, and the condition requiring a salary above 40000 also requires a title other than AD_PRES. The ELSE branch therefore assigns 50000 * 0.05, which is 2500. In PL/SQL, the ELSE statements run when no preceding Boolean condition is true.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!