fablefe 发表于 2015-11-9 10:52:42

OCP-1Z0-051 第85题 显式转换和隐式转换

一、原题
View the Exhibit and examine the structure and data in the INVOICE table.

Which statements are true regarding data type conversion in expressions used in queries?(Choose all that apply.)
A. inv_amt ='0255982': requires explicit conversion
B. inv_date > '01-02-2008': uses implicit conversion
C. CONCAT(inv_amt,inv_date): requires explicit conversion
D. inv_date = '15-february-2008'    :uses implicit conversion
E. inv_no BETWEEN '101' AND '110':uses implicit conversion

答案:DE

二、题目翻译
下面是INVOICE表的结构:
关于查询中的表达式中的数据类型转换,哪句话是正确的?(选择所有正确的项)
A.inv_amt ='0255982' : 需要显式转换。
B.inv_date > '01-02-2008':使用了隐式转换。
C. CONCAT(inv_amt,inv_date) :需要显式转换。
D. inv_date = '15-february-2008' :使用了隐式转换。
E. inv_no BETWEEN '101' AND '110': 使用了隐式转换。

三、题目解析
A选项不正确,inv_amt列是nubmer类型,右边是字符类型,这个是隐式转换。
B选项不正确,inv_date列是date类型,右边的格式和默认格式不一致,需要用to_date显式转换。
C选项不正确,这里是使用隐式转换,转换成字符型。

         版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: OCP-1Z0-051 第85题 显式转换和隐式转换