1. 程式人生 > >【ocp-12c】最新Oracle OCP-071考試題庫(39題)

【ocp-12c】最新Oracle OCP-071考試題庫(39題)

put nvl2 from des sum 考試題庫 red stat for each

39.choose the best answer

View the Exhibit and examine the description of the EMPLOYEES table.

You want to calculate the total remuneration for each employee. Total remuneration is the sum of the annual salary and the percentage commission earned for a year.

Only a few employees earn commission.

Which SQL statement would you execute to get the desired output?

A) SELECT first_name, salary, salary12 + NVL(salary, 0)commission_pct "Total"

FROM EMPLOYEES;

B) SELECT first_name, salary, salary12+(salaryNVL2(commission_pct,

salary,salary+commission_pct)) "Total"

FROM EMPLOYEES;

C) SELECT first_name, salary, (salary + NVL(commission_pct,0)salary)

12 "Total"

FROM EMPLOYEES;

D) SELECT first_name, salary, salary12+salarycommission_pct "Total"

FROM EMPLOYEES;

Answer:A

(解析:題眼是“Only a few employees earn commission”,說明有人的傭金是 null,所以要用 nvl 函數)

【ocp-12c】最新Oracle OCP-071考試題庫(39題)