QuestionQ163

VerifiedUsing Conversion Functions and Conditional Expressions

Review the data in the EMPLOYEES table:

Question Image

Which statement calculates each employee’s total annual compensation?

Explanation

Total annual compensation is the annual salary plus commission: (monthly_salary * 12) + (monthly_salary * 12 * monthly_commission_pct). Employees without a commission percentage must still return their annual salary, so NVL(monthly_commission_pct, 0) substitutes zero for a null commission percentage. Oracle documents that NVL returns its second argument when the first is null, and arithmetic containing a null otherwise evaluates to null.

Learn more

Community Discussion

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