ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-262

047-262

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-19 14:21:34 0 删除 编辑
262. 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, salary*12+salary*commission_pct "Total"
FROM EMPLOYEES;
B. SELECT first_name, salary, salary*12+NVL((salary*commission_pct), 0)
"Total" FROM EMPLOYEES;
C. SELECT first_name, salary, salary*12 + NVL(salary, 0)*commission_pct
"Total" FROM EMPLOYEES;
D. SELECT first_name, salary, salary*12+(salary*NVL2(commission_pct,
salary,salary+commission_pct))"Total" FROM EMPLOYEES;
Answer: B
Remuneration:报酬 commission:委托 percentage:百分数
SQL> select 100+'' from dual;
如果加个空值返回也为空了

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11312660/viewspace-719015/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 047-252
下一篇: 047-263
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    214088