OCP-1Z0-051 补充题库 第38题 nvl用法
来源:互联网 发布:淘宝助理二次验证取消 编辑:程序博客网 时间:2024/06/05 20:02
一、原题
二、题目翻译
三、题目解析
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;
答案: D
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;
答案: D
二、题目翻译
下面是CUSTOMERS表的结构:
根据CUSTOMERS表,生成一个报告,显示所有用户信用额度的15%的值,如果用户的信用额度没有被输入(即为null),则显示为"Not Available".
下面哪个SQL语句能得出上面要求的结果。
根据CUSTOMERS表,生成一个报告,显示所有用户信用额度的15%的值,如果用户的信用额度没有被输入(即为null),则显示为"Not Available".
下面哪个SQL语句能得出上面要求的结果。
三、题目解析
用户信用额度的15%,就是cust_credit_limit*.15,
如果信用额度为null的,显示为"Not Available",就需要使用nvl函数,来判断cust_credit_limit是否为空。
nvl的两个参数,需要类型一致,因为’Not Available’是字符类型,所以,前面的第一个参数,也需要用to_char转成字符类型。
nvl的用法,详见:
http://blog.csdn.net/holly2008/article/details/25251513
如果信用额度为null的,显示为"Not Available",就需要使用nvl函数,来判断cust_credit_limit是否为空。
nvl的两个参数,需要类型一致,因为’Not Available’是字符类型,所以,前面的第一个参数,也需要用to_char转成字符类型。
nvl的用法,详见:
http://blog.csdn.net/holly2008/article/details/25251513
0 0
- OCP-1Z0-051 补充题库 第38题 nvl用法
- OCP-1Z0-051 补充题库 第41题 nvl函数的使用
- OCP-1Z0-051 补充题库 第36题 约束
- OCP-1Z0-051 补充题库 第37题
- OCP-1Z0-051 补充题库 第16题 rownum的用法
- OCP-1Z0-051 补充题库 第1题 TRUNCATE命令的使用
- OCP-1Z0-051 补充题库 第2题 添加外键FOREIGN KEY
- OCP-1Z0-051 补充题库 第3题 隐式格式转换
- OCP-1Z0-051 补充题库 第4题 聚合函数的使用
- OCP-1Z0-051 补充题库 第5题 主查询和子查询的注意事项
- OCP-1Z0-051 补充题库 第6题 SELECT查询语句
- OCP-1Z0-051 补充题库 第7题 ORDER BY 子句
- OCP-1Z0-051 补充题库 第8题 子查询的使用范围
- OCP-1Z0-051 补充题库 第10题 集合操作中的ORDER BY子句
- OCP-1Z0-051 补充题库 第11题 SQL和SQL*Plus的区别
- OCP-1Z0-051 补充题库 第12题 oracle函数分类
- OCP-1Z0-051 补充题库 第13题 MERGE INTO语句
- OCP-1Z0-051 补充题库 第14题 关于表约束的视图
- Lucene中的MMAnalyzer中文分词器
- Spring3.x_Struts2.x_Hibernate3.x整合之声明式事务配置
- 第三章 3.5.5节练习
- cocos2d-x Box2d物理引擎基础操作
- PHP的MySQL扩展:MySQL数据库概述
- OCP-1Z0-051 补充题库 第38题 nvl用法
- 黑马程序员———Java的基础语法和数据类型、数组
- Hibernate + Proxool配置 并监控proxool连接池
- rand(),srand()产生随机数
- 有道面试 第三天 —— 杭州小记 五
- 【OJ】Ants acmclub.com 10913 // poj 1852
- 目标黑马,我的自学之路:第八章 集合框架之Collection
- PAT 06-3. 单词长度
- 淘宝logo