OCP-1Z0-051 第75题 ROUND和RPAD函数
2014-05-08 12:03
218 查看
一、原题
The following data exists in the PRODUCTS table:
PROD_ID PROD_LIST_PRICE
123456 152525.99
You issue the following query:
SQL> SELECT RPAD(( ROUND(prod_list_price)), 10,'*')
FROM products
WHERE prod_id = 123456;
What would be the outcome?
A. 152526****
B. **152525.99
C. 152525** **
D. an error message
答案:A
二、题目翻译
下面是PRODUCTS表中的数据
执行下面的SQL查询语句
执行结果是什么?
三、题目解析
表中 prod_list_price的值是152525.99,ROUND函数如果不写第二个参数,就是默认是0,保留到整数,
而ROUND四舍五入,所以ROUND(prod_list_price)=152526,
RPAD右填充函数,RPAD(( ROUND(prod_list_price)), 10,'*')表示,保留10个长度,如果不够,使用*填充,
所以RPAD(( ROUND(prod_list_price)), 10,'*')的结果为152526****
The following data exists in the PRODUCTS table:
PROD_ID PROD_LIST_PRICE
123456 152525.99
You issue the following query:
SQL> SELECT RPAD(( ROUND(prod_list_price)), 10,'*')
FROM products
WHERE prod_id = 123456;
What would be the outcome?
A. 152526****
B. **152525.99
C. 152525** **
D. an error message
答案:A
二、题目翻译
下面是PRODUCTS表中的数据
执行下面的SQL查询语句
执行结果是什么?
三、题目解析
表中 prod_list_price的值是152525.99,ROUND函数如果不写第二个参数,就是默认是0,保留到整数,
而ROUND四舍五入,所以ROUND(prod_list_price)=152526,
RPAD右填充函数,RPAD(( ROUND(prod_list_price)), 10,'*')表示,保留10个长度,如果不够,使用*填充,
所以RPAD(( ROUND(prod_list_price)), 10,'*')的结果为152526****
相关文章推荐
- OCP-1Z0-051 第75题 round和rpad函数
- OCP-1Z0-051 第78题 ROUND和TRUNC函数
- OCP-1Z0-051 补充题库 第25题 TRUNC和ROUND
- OCP-1Z0-新051-61题版本-15
- OCP-1Z0-新051-61题版本-30
- OCP-1Z0-新051-61题版本-44
- OCP-1Z0-新051-61题版本-60
- OCP-1Z0-051-2015-37题
- OCP-1Z0-051-V9.02-13题 单引号的使用
- OCP-1Z0-051 第33题 create table 建表语句
- OCP-1Z0-051 第46题 约束和索引
- OCP-1Z0-051 第58题 转义字符escape
- OCP-1Z0-051 第90题 转换函数
- OCP-1Z0-051-2015-43题
- OCP-1Z0-051 第109题 聚合函数的使用
- OCP-1Z0-051-2015-50题
- OCP 1Z0 051 14
- OCP-1Z0-051 第125题 self-join(自连接)和self-join(子查询)
- OCP 1Z0 051 36
- OCP-1Z0-051-V9.02-12题