1Z0-051 QUESTION 17 NULL的运算
来源:互联网 发布:狗狗 知乎 编辑:程序博客网 时间:2024/05/22 06:07
QUESTION 17
View the E xhibitand examine the data in the EMPLOYEES table.
You want to generate areport showing the total compensation paid to each employee to date.
You issue the followingquery:
SQL>SELECT ename|| ' joined on ' || hiredate ||
', the totalcompensation paid is ' ||
TO_CHAR(ROUND(ROUND(SYSDATE-hiredate)/365)* sal + comm)
"COMPENSATION UNTILDATE"
FROM emp;
View the E xhibitand examine the data in the EMPLOYEES table.
You want to generate areport showing the total compensation paid to each employee to date.
You issue the followingquery:
SQL>SELECT ename|| ' joined on ' || hiredate ||
', the totalcompensation paid is ' ||
TO_CHAR(ROUND(ROUND(SYSDATE-hiredate)/365)* sal + comm)
"COMPENSATION UNTILDATE"
FROM emp;
What is the outcome?
A. It generates an error because the alias is not valid.
B. It executes successfully and gives the correct output.
C. It executes successfully but does not give the correct output.
D. It generates an error because the usage of the ROUND function in the expression is not valid.
E. It generates an error because the concatenation operator can be used to combine only two items.
答案:C
解析:
因为任何数值+NULL都为NULL,因此语句虽然能执行,但结果不对,选C
SQL> SELECT ename|| ' joined on ' || hiredate || 2 ', the totalcompensation paid is ' || 3 TO_CHAR(ROUND(ROUND(SYSDATE-hiredate)/365)* sal + comm) 4 "COMPENSATION UNTILDATE" 5 FROM employees;COMPENSATION UNTILDATE-------------------------------------------------------------------------SMITH joined on 17-DEC-80, the totalcompensation paid isALLEN joined on 20-FEB-81, the totalcompensation paid is 53100WARD joined on 22-FEB-81, the totalcompensation paid is 41750JONES joined on 02-APR-81, the totalcompensation paid isMARTIN joined on 28-SEP-81, the totalcompensation paid is 42650BLAKE joined on 01-MAY-81, the totalcompensation paid is6 rows selected.
0 0
- 1Z0-051 QUESTION 17 NULL的运算
- 1Z0-051 QUESTION 11 运算顺序
- 1Z0-051 QUESTION 10 运算的时候注意括号的位置和隐式转换
- OCP 1Z0 051 QUESTION NO: 17
- OCP-1Z0-051 第17题 null参与运算后仍是null
- 1Z0-051 QUESTION 5 TO_CHAR的应用
- 1Z0-051 QUESTION 7 ON和USING的用法
- 1Z0-051 QUESTION 9 关于INTERSECT的用法
- 1Z0-051 QUESTION 12 别名和INITCAP的运用
- 1Z0-051 QUESTION 13 Q字符的特殊使用
- 1Z0-051 QUESTION 14 DISTINCT的用法
- 1Z0-051 QUESTION 16 Q操作符的使用
- 1Z0-051 QUESTION 23 数据类型应该注意的地方
- 1Z0-051 QUESTION 24 数据类型应该注意的地方
- 1Z0-051 QUESTION 26 table的命名规则
- 1Z0-051 QUESTION 27 table的命名规则
- OCP 1Z0 051 QUESTION NO: 1
- 1Z0-051 QUESTION 28 关于约束
- 优先队列简单三题:POJ3253 POJ 2431 POJ 3614
- Double 类型运算时的精度问题
- 配置 yum 源的两种方法
- 复制数据库等文件文件到sdcard
- 小z的袜子 莫队算法(分块思想) O(N*sqrt(N))
- 1Z0-051 QUESTION 17 NULL的运算
- Chromium for Mac中的BrowserWindow
- NOJ [1138] Honeycomb
- savepoint(回退点)
- 关于字符设备的操作目录
- Jquer获取页面控件的值 select,checkbox,radio
- 如何在AltiumDesigner中实现两片DDR等长走线
- SQLite三种JDBC驱动的区别
- Python的一些技巧