OCP-1Z0-051-2015-38题
来源:互联网 发布:网络教育本科能考研吗 编辑:程序博客网 时间:2024/06/05 19:28
See the Exhibit and Examine the structure of the CUSTOMERS table:
Using the CUSTOMERS table, you need to generate a report that shows an increase in the credit
limit by 15% for all customers. Customers whose credit limit has not been entered should have the
message "Not Available" displayed.
Which SQL statement would produce the required result?
A.SELECT NVL(cust_credit_limit,'Not Available')*.15 "NEW CREDIT" FROM customers;
B. SELECT NVL(cust_credit_limit*.15,'Not Available') "NEW CREDIT" FROM customers;
C. SELECT TO_CHAR(NVL(cust_credit_limit*.15,'Not Available')) "NEW CREDIT" FROM
customers;
D. SELECT NVL(TO_CHAR(cust_credit_limit*.15),'Not Available') "NEW CREDIT" FROM
customers;
Answer: D
Explanation:根据题意增加用户信用度百分之15
格式NVL(expr1,expr2)如果expr1是null,则返回expr2,如果expr1 is not null,则返回expr1.
此处考试的意图在与NVL函数里参数的数据类型的一致性以及数据类型之间的转换。
expr1 and expr2
可以是任意的数据类型,但他们必须是同一数据类型,或者是隐式转换为同一数据类型,又或者是显示转换为同一数据类型。
如果他们不是同一类型,则报错。
由题意可知,先用同to_char函数显示将cust_credit_limit*.15转换为字符类型,才能达成数据类型一致。
Converts a null value to an actual value:
Data types that can be used are date, character, and number.日期、字符、数字型
Data types must match:
– NVL(commission_pct,0)
– NVL(hire_date,'01-JAN-97')
– NVL(job_id,'No Job Yet')
- OCP-1Z0-051-2015-38题
- OCP-1Z0-051-2015-1题
- OCP-1Z0-051-2015-2题
- OCP-1Z0-051-2015-3题
- OCP-1Z0-051-2015-4题
- OCP-1Z0-051-2015-5题
- OCP-1Z0-051-2015-6题
- OCP-1Z0-051-2015-7题
- OCP-1Z0-051-2015-8题
- OCP-1Z0-051-2015-9题
- OCP-1Z0-051-2015-10题
- OCP-1Z0-051-2015-11题
- OCP-1Z0-051-2015-12题
- OCP-1Z0-051-2015-13题
- OCP-1Z0-051-2015-14题
- OCP-1Z0-051-2015-15题
- OCP-1Z0-051-2015-16题
- OCP-1Z0-051-2015-17题
- swift 手势识别
- thinkphp配置log4php
- iOS CoreData查询结果排序
- Apache Spark探秘:利用Intellij IDEA构建开发环境
- 《How Tomcat Works》学习笔记(二)
- OCP-1Z0-051-2015-38题
- Maven移植eclipse项目:Project facet Java version 1.8 is not supported.
- springmvc restful风格支持
- 关于盒子定位
- android开发游记:使用sharepreference存储复杂对象的解决方案
- linux中的find命令——查找文件名
- substr字符串截取时出现乱码
- Rest服务实现返回List<Map>结果
- MySQL忘记密码怎么办?